Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Chiara Mussida <cmussida@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: playing with coefficients |
Date | Fri, 23 Mar 2012 16:08:44 +0100 |
I got it: for categorical variable c.namevariable, and for dummy variables? or continuous variable? On 23/03/2012, Chiara Mussida <cmussida@gmail.com> wrote: > Occupation takes the values from 1 to 7, therefore by using > i.occupation I get 7 coefs. i.fem is instead a dummy variable (fem==1 > if female, 0 otherwise). The use of both i.occupation and i.fem > therefore gives me the coefs for female. How do I get the one for male > (fem==0)? > > Thanks > chiara > > On 23/03/2012, Christopher Baum <kit.baum@bc.edu> wrote: >> <> >> Chiara said >> >> I totally agree: is there a way to cast this as a single regression: >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==1 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==1 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==2 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==2 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==3 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==3 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==4 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==4 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==5 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==5 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==6 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==6 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==0 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==7 >> reg lwage pexper pexpersq edu2 edu3 child12 married northe centre >> south ftc partime d09 if fem==1 & cond3==1 & age>=15 & age<=64 & >> dipind==1 & hours>20 & hours<55 & occupation==7 >> >> preserve >> keep if cond3==1 & age>=15 & age<=64 & dipind==1 & hours>20 & hours<55 >> reg lwage i.fem##i.occupation##c.(pexper pexpersq edu2 edu3 child12 >> married >> northe centre south ftc partime d09) >> restore >> >> If some of the parenthesized variables are categorical, rewrite the >> latter >> as >> >> (c.pexper c.pexpersq i.edu2 i.edu3 c.child12 ... ) >> >> You can then use margins to produce coefficients or conditional means for >> any combinations of gender and occupation. >> >> Kit >> >> Kit Baum | Boston College Economics & DIW Berlin | >> http://ideas.repec.org/e/pba1.html >> An Introduction to Stata Programming | >> http://www.stata-press.com/books/isp.html >> An Introduction to Modern Econometrics Using Stata | >> http://www.stata-press.com/books/imeus.html >> >> >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/statalist/faq >> * http://www.ats.ucla.edu/stat/stata/ >> > > > -- > Chiara Mussida > PhD candidate > Doctoral school of Economic Policy > Catholic University, Piacenza (Italy) > -- Chiara Mussida PhD candidate Doctoral school of Economic Policy Catholic University, Piacenza (Italy) * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/