I am trying to figure how to plot a linear function of coefficients from a first-difference regression.
Here's a non-sensical example:
Given this model, I would like to plot the function y = 100*(-.0046281+ .0345487)*x for x=1 and x=2, along with the implied confidence interval.
I tried to do it with lincom:
but that command does not let you vary x or nor can you combine two lincoms, so there's no way to combine the estimates in a single plot:
I suppose I can save these to a resultset, merge and then combine, but there must be an easier way.
I also tried to do it with margins:
This produces the error "unknown function ()".
Here's a non-sensical example:
Code:
webuse nlswork, clear xtset idcode year reg D.(ln_wage hours ttl_exp), cluster(idcode)
I tried to do it with lincom:
Code:
lincom 100*((_b[D.ttl_exp] + _b[D.hours])*1) lincom 100*((_b[D.ttl_exp] + _b[D.hours])*2)
I suppose I can save these to a resultset, merge and then combine, but there must be an easier way.
I also tried to do it with margins:
Code:
margins, expression(100*((_b[D.ttl_exp] + _b[D.hours])*D.ttl_exp)) at(D.ttl_exp ==(1 2))