I am using Scott Long's user created command mtable which is from his Spost13 package.
I have generated a variable that I am trying to calculate the margins for a variable I have created (HispanicUnhealthyLifestyle) against my outcome variable (clinicaldepression) but it says there are no observations.
gen HispanicUnhealthyLifestyle = race == 2 & numcigs_r == 30 & exercise == 0
sum clinicaldepression if HispanicUnhealthyLifestyle
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
clinicalde~n | 0
qui mtable if HispanicUnhealthyLifestyle, rowname(HispanicUnhealthyLifestyle)
> ///
> atmeans ci below
no observations
r(2000);
I am providing a data example below.
dataex HispanicUnhealthyLifestyle
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Listed 100 out of 420 observations
Use the count() option to list more
My question is the following: How do I locate at which values there would be observations for my variable Hispanic?
I have generated a variable that I am trying to calculate the margins for a variable I have created (HispanicUnhealthyLifestyle) against my outcome variable (clinicaldepression) but it says there are no observations.
gen HispanicUnhealthyLifestyle = race == 2 & numcigs_r == 30 & exercise == 0
sum clinicaldepression if HispanicUnhealthyLifestyle
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
clinicalde~n | 0
qui mtable if HispanicUnhealthyLifestyle, rowname(HispanicUnhealthyLifestyle)
> ///
> atmeans ci below
no observations
r(2000);
I am providing a data example below.
dataex HispanicUnhealthyLifestyle
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float HispanicUnhealthyLifestyle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 end
Listed 100 out of 420 observations
Use the count() option to list more
My question is the following: How do I locate at which values there would be observations for my variable Hispanic?
Comment