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
Short Deadline: Help with xtreg regressionHello, I am facing a problem with my panel data which has "loans disbursed" as a panel variable and…
Else operator - from SAS to STATADear users, I've been try (and struggling) to translate some SAS code to STATA. Unfortunately I don…
Plotting using survey weightsI have responses of survey on students and the data needed to be weighted based on the faculty of th…
Omitted "Treatment" variable in DiD fixed panel regressionOmitted "Treatment" variable in DiD fixed panel regression 01 May 2021, 08:30 Hi, I'm currently stu…
How to merge multiple observations into 1 observation with multiple variables?Hi all, I have a problem with merging different family members into 1 family with multiple variable…
Subscribe to:
Post Comments (Atom)
0 Response to Categorical variables
Post a Comment