Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Plotting (time-dependent) regression coefficients


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Plotting (time-dependent) regression coefficients
Date   Thu, 17 Jan 2008 13:55:38 -0500

Maarten buis and Davide Cantoni:

Note you do not need to destroy the data in memory to do this:

sysuse nlsw88, clear
gen ln_w = ln(wage)
recode grade 0/5=6
tab grade, gen(lev)
foreach lev of varlist lev* {
       gen unionX`lev' = union*`lev'
}
drop lev1
reg ln_w lev* unionX* tenure ttl_exp
g g=_n+5 in 1/13
la var g "Grade completed"
g b=.
g se=.
forv i=1/13 {
 replace b=_b[unionXlev`i'] in `i'
 replace se=_se[unionXlev`i'] in `i'
}
gen lb = b-invttail(`e(df_r)', .025)*se
gen ub = b+invttail(`e(df_r)', .025)*se
la var b "Point Estimate"
la var lb "Lower"
la var ub "Upper bound of CI"
tw rcap lb ub g ||sc b g, yline(0)

On Jan 17, 2008 9:47 AM, Maarten buis <[email protected]> wrote:
> --- Davide Cantoni <[email protected]> wrote:
> > I am looking for an elegant way to plot the regression coefficients
> > (including their 95% confidence interval) that result from a
> > regression on the interactions of a treatment indicator and time.
> > Ultimately, I have some coefficients for the "treatment effect" in
> > every period of time, and I would like to plot their evolution.
>
> *------------------ begin example -----------------
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index