Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: lpoly and nonmissing fitted values where the dependent variable is missing

 From Austin Nichols To statalist@hsphsun2.harvard.edu Subject Re: st: lpoly and nonmissing fitted values where the dependent variable is missing Date Mon, 9 Aug 2010 11:58:42 -0400

```Alex Olssen <alex.olssen@gmail.com> :
Your -if- tells -lpoly- to fit the regression for values of length
less than 190; your -at()- option tells it to predict at *every* value
of length in the data.  If 190 is the cutoff, you could instead:

sysuse auto, clear
g x=190 in 1
lpoly price length if length<190, ker(rec) deg(1) bwidth(12) gen(L) at(x)
lpoly price length if length>=190, ker(rec) deg(1) bwidth(12) gen(R) at(x)
li L R x in 1

http://www.stata-journal.com/article.html?article=st0136
http://www-personal.umich.edu/~nicholsa/ciwod.pdf
http://fmwww.bc.edu/repec/bocode/r/rd.html

On Mon, Aug 9, 2010 at 12:01 AM, Alex Olssen <alex.olssen@gmail.com> wrote:
> Hi Statalisters
>
> I got an email from StataCorp LP saying the last attempt to send this
> didn't work.  Apologies if you receive this twice.
>
> I am doing a regression discontinuity analysis and want to understand
> how -lpoly- is working.  I use the -lpoly- options -gen- and -at- to
> create fitted values for my local linear regression.
> Due to the nature of regression discontinuity I look at two subgroups
> separately.  Fitted values are generated to observation that are even
> outside the subgroup.  I want to understand how it chooses where to
> fit them.
>
> For example,
>
> sysuse auto, clear
> lpoly price length if length<190, ker(rec) deg(1) bwidth(12) gen(L) at(length)
> sort length
> br L length
>
> Cars with lengths up to 212cm long have fitted values.  Does anyone know why?
>
> Note the if statement causes no problems.  If I gen lengthlt190=length
> if length<190 and then lpoly price lengthlt190 the results are
> identical.
>
> Kind regards,
>
> Alex

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```