Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Plotting CIs for lpolyci


From   Amy Hsin <hsin.amy@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Plotting CIs for lpolyci
Date   Sat, 6 Oct 2012 11:41:19 -0400

Dear Stata Gurus,

I have trying to plot predictions from a linear regession using kernel
weight local polynomial fit (lpolyci) along with their confidence
intervals. I am having problems graphing the confidence interval.  The
confidence interval are either so small they are not visible or they
are not there at all. I am not sure why this it.  I can manually plot
the CIs from a linear fit model without problems. The linear fit is
near identical to the kernel weighted fit so shouldn't the CIs from
lpolyci be similar to the Cis from lpoly?

For example, I run the following regression:
regress zach asian wave asianxwave data [pw=weight], cluster(newid)
predict zach_asian if asian==1, xb
predict zachsd_asian if asian==1, stdp

The following command generates the kernel weight fitted line but no
confidence intervals are produced.
lpolyci zach_asian wave

The following command generates the confidence intervals for the
linear fit which look good:
generate lacha = zach_asian-zachsd_asian*invttail(15113,.975)
generate hacha = zach_asian+zachsd_asian*invttail(15113,.975)

twoway rarea hachw lachw wave, sort bcolor(gs14)  astyle(background)
	|| lpoly zach_asian wave, clcolor(red) clstyle(foreground)      ///
	|| lfit zach_asian wave, clcolor(red) clstyle(foreground)

The lfit and lpoly give near identical lines so why isn't lpolyci
producing CIs that are in line with the ones that I produce manually.
I understand that estimates for lpoly come from bootstrapping methods
and so SE and CIs are computed using alternative methods but shouldn't
they be approximately the same?

Thank you.

Amy





-- 
Amy Hsin
Assistant Professor of Sociology
Queens College, City University of New York
http://qcpages.qc.cuny.edu/~ahsin
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index