필터 지우기
필터 지우기

Using every level of a categorical array in a regression

조회 수: 2 (최근 30일)
Martin
Martin 2015년 8월 12일
답변: Tom Lane 2015년 9월 12일
I am trying to run a regression, where instead of a constant term I would like to include every level of a categorical array. I know, that the results will be numerically the same either way, the main reason why I want to do this is convenience (it is part of a larger estimation procedure).
I would like to ask You if there is a way to do it when estimating a GLM model.
Thanks in advance,
Martin

답변 (1개)

Tom Lane
Tom Lane 2015년 9월 12일
You could try using the DUMMYVAR function to generate indicator variables for each of your categories, then omit the constant term. If you supply the categorical variable directly as a predictor, MATLAB always omits one of the categories.

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by