Multiple regression analysis, categorial variables, continuous variable

1 次查看(过去 30 天)
Hi, I would like to run a multiple regression where my dependent variable is continuous. One of my independent variable is continuous, and the other independent variable is a category (small cap, midcap, largecap). I am not sure how to construct categorical independent variable. Do I have to use dummyvar function or can I just use 0 and 1 (1 for the category that applies to the observation).
Thank you in advance.

采纳的回答

bym
bym 2012-1-12
as long as you have one category variable, you can use just (0,1).
If , for example you had more than one category (small cap , mid cap, large cap); (public,private);(transportation,conglomerate,medical,etc) you would have to use dummyvar

更多回答(1 个)

KKR
KKR 2012-1-12
Thank you for your quick response. So, I should just add three more columns (with zeros and ones) with first one(continuous variale) and run a normal regression. Correct?

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by