I'm using the sml command from the user written software package SJ8-2 st0144, Article: Stata Journal, volume 8, number 2: st0144. I am using STATA version 17.0
In what follows Degree is a binary {0,1} variable. If I write the following code:
I get the following error
All of my categorical variables are dummy variables coded {0,1} and this doesn't happen when I just run:
But I want to estimate:
And then to do this I need School recognise as a factor variable in the original estimation.
I've tried:
But then I get:
I couldn't really find anything about this naturally coded omitted message. Is this a problem? Or should I proceed with the estimation? I should reiterate that I only care about coding my variables as factors so I can then run margins. If there is another way to calculate the margins afterwards then it's fine to not code them as factors.
In what follows Degree is a binary {0,1} variable. If I write the following code:
Code:
sml Degree i.Female i.WeeklyFamInc35to49 i.WeeklyFamInc50to99 i.WeeklyFamInc100to149 i.WeeklyFamInc150to199 i.WeeklyFamInc200to249 i.WeeklyFamIncmore250 i.FatDeg i.MotDeg i.FathWorkingClassWork i.StateBens12mnths i.School pred_MathScore, offset(pred_MathScore) nolog
Code:
factor-variable and time-series operators not allowed r(101);
Code:
sml Degree Female WeeklyFamInc35to49 WeeklyFamInc50to99 WeeklyFamInc100to149 WeeklyFamInc150to199 WeeklyFamInc200to249 WeeklyFamIncmore250 FatDeg MotDeg FathWorkingClassWork StateBens12mnths School, offset(pred_MathScore) nolog
Code:
margins School
I've tried:
Code:
xi: sml Degree i.Female i.WeeklyFamInc35to49 i.WeeklyFamInc50to99 i.WeeklyFamInc100to149 i.WeeklyFamInc150to199 i.WeeklyFamInc200to249 i.WeeklyFamIncmore250 i.FatDeg i.MotDeg i.FathWorkingClassWork i.StateBens12mnths i.School pred_MathScore, offset(pred_MathScore) nolog
Code:
i.Female _IFemale_0-1 (naturally coded; _IFemale_0 omitted) i.WeeklyFam~o49 _IWeeklyFam_0-1 (naturally coded; _IWeeklyFam_0 omitted) i.WeeklyFam~o99 _IWeeklyFama0-1 (naturally coded; _IWeeklyFama0 omitted) i.WeeklyFam~149 _IWeeklyFamb0-1 (naturally coded; _IWeeklyFamb0 omitted) i.WeeklyFam~199 _IWeeklyFamc0-1 (naturally coded; _IWeeklyFamc0 omitted) i.WeeklyFam~249 _IWeeklyFamd0-1 (naturally coded; _IWeeklyFamd0 omitted) i.WeeklyFam~250 _IWeeklyFame0-1 (naturally coded; _IWeeklyFame0 omitted) i.FatDeg _IFatDeg_0-1 (naturally coded; _IFatDeg_0 omitted) i.MotDeg _IMotDeg_0-1 (naturally coded; _IMotDeg_0 omitted) i.FathWorking~k _IFathWorki_0-1 (naturally coded; _IFathWorki_0 omitted) i.StateBens12~s _IStateBens_0-1 (naturally coded; _IStateBens_0 omitted) i.School _ISchool_0-1 (naturally coded; _ISchool_0 omitted)
Comment