Hi all. I am trying to estimate a regression that looks like this:
Let's say that I want to estimate the beta coefficients for each variable on the right-hand side of the equation for the entire sample except for tenure, for which I want Stata to compute the coefficient only on the subset of people that are married, that is, married==1 in this dataset. In other words, I want the coefficients for hours, wks_work, and ttl_exp to be estimated on the entire sample, while the coefficient for tenure is estimated only on the subsample of people that are married.
How do I go about it? I do not know what to do. Simply doing c.tenure#i.married does not work of course.
Any help is appreciated. Thank you!
Code:
use "https://www.stata-press.com/data/r17/nlswork.dta" reg ln_wage tenure hours wks_work ttl_exp
How do I go about it? I do not know what to do. Simply doing c.tenure#i.married does not work of course.
Any help is appreciated. Thank you!

Comment