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
Ramsey Test - ARDL ModelHi Everyone, My ardl model has passed every test (eg Jarque-Bera normality test, White test and LM …
Firm-Sector Multilevel generalised structural equation modeling or control variable or sector control variable?- …
Firm-Sector Multilevel generalised structural equation modeling or sector control variable?Good afternoon, I am running a few GSEM regressions at the firm-level, wanting to check whether x1, …
Extracting a subset of a varlist using wildcards such as *I am writing a command which takes a varlist as anargument. The variables correspond to different dr…
Combine the values of several obserationsDear Stata users, Can someone help me to combine data of same month but different dates into one. …
Subscribe to:
Post Comments (Atom)
0 Response to Categorical variables
Post a Comment