Hello, I was wondering if anyone knew how to specify margins for medians at specific ages? More precisly, I have a model that looks very similar to the model below. The one exception is that the model I actually use a mixed model. Unfortunately, I could not find a toy panel data that was similar to my own, but the dataset below pretty mudh has the variables that I will be using:
In my dataset, exper is a time-varying variable that refers to years of work experience. I would like to predict the lwage values by scol across ages while holding exper at its age-specific median. So far, I did this:
However, I assume that is just setting ihs_faminc to the overall median rather than the age-specifc median.
In simpler terms, if the median at age 30 is 8, I want to set exper at 8 years for age 30. If the median at age 31 is 10, I want to exper to 10 years for age 31. etc.
Code:
use http://fmwww.bc.edu/ec-p/data/wooldridge/cps78_85, clear recode educ (0/12=0) (13/18=1),gen(scol) reg lwage i.scol age c.age#c.age i.scol#c.age i.scol#c.age#c.age i.scol#c.exper
In my dataset, exper is a time-varying variable that refers to years of work experience. I would like to predict the lwage values by scol across ages while holding exper at its age-specific median. So far, I did this:
Code:
quietly margins scol, at(c.age=(25(1)59) (median) c.exper) marginsplot
However, I assume that is just setting ihs_faminc to the overall median rather than the age-specifc median.
In simpler terms, if the median at age 30 is 8, I want to set exper at 8 years for age 30. If the median at age 31 is 10, I want to exper to 10 years for age 31. etc.
Comment