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
Related Posts with Categorical variables
Tracking changes in population by geography over timeHello, In my dataset I have a number of small geographical areas (beginning with A in the sample da…
Generate primary, secondary, tertiary employer each month in panel dataHi everybody I am working with panel data to test how employees are affected when they are insource…
L'option Orthogonal dans le GMM en système two-stepJ'évalue l'effet de la qualité des institutions (DIM_POL) sur le développement financier (DFI). Pour…
Adjusting for correlations in regressionHi everyone, I ran two economics experiments and I am having trouble making the correct inference. …
Multistate model analysisDear All, I want to calculate the extra LOS attributable to a HAI. Using the command "predictms" I h…
Subscribe to:
Post Comments (Atom)
0 Response to Categorical variables
Post a Comment