Dear everyone,
I am new to STATA and am a little confused when it comes to categorical variables and a logit regression using them. All my data is already in numerical form. My dependent variable y takes values from 0,1,2. Similarly, x1 takes values from 1-6. This variables already denote categories, as for instance for x1 - value 1 is allocated to those under 18. Does this mean that x and y are already categorical variables ?
I have read that in order to signalise STATA that the variable is a categorical one, I should put "i." in front of the variable when running the regression. Also as my dependent variable is categorical I tried the following command:
logit i.BTAE i.MScat6 i.gender i.Exp i.Agecat i.Finback i.Prof
but I get the following error: depvar may not be a factor variable r(198);
Is it that my dependent variable is not categorical or how do I signalise STATA it is? Also should a categorical variable have a column for each category where it takes value 0 if n is in that respective category and 0 otherwise (so for a categorical variable 0,1,2 I would have 3 columns) ?
Thank you very much in advance!
Best regards,
Eliss
0 Response to Categorical variables
Post a Comment