Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Get fitted values after locpoly (follow-up)
From
Austin Nichols <[email protected]>
To
[email protected]
Subject
Re: st: Get fitted values after locpoly (follow-up)
Date
Wed, 21 Sep 2011 09:48:55 -0400
Tania Treibich <[email protected]>:
Change the bandwidth or the degree of the polynomial to change the
smoothing properties of -locpoly- (findit locpoly) or -lpoly-, not the
number of points where the smooth is computed.
On Wed, Sep 21, 2011 at 7:32 AM, Nick Cox <[email protected]> wrote:
> I don't see that fitting at a smaller set of points will itself confer
> resistance to outliers. Also, these local polynomial fits are all more or
> less fancy ways of averaging and so none is especially suited to what
> appears to be your aim.
> Furthermore, I doubt that you can extend local polynomial fits beyond the
> data used as the command(s) in question do not save anything useful for that
> purpose.
>
> To discount outliers and to get an otherwise smooth curve I would use -glm-
> with an appropriate link (e.g. logarithmic) and cubic spline variables on
> the right-hand side.
>
> Finally, it's my recollection that -locpoly- is a user-written command and
> has been superseded by -lpoly-, although the latter is not more useful for
> resistant-robust smoothing than the former. As a general point you are asked
> to flag where user-written commands you refer to come from.
>
> Nick
>
> On 21 Sep 2011, at 11:58, Tania Treibich <[email protected]> wrote:
>
>> Dear Stata List users
>>
>> I could get fitted values for my kernel regression using the at()
>> option of lpoly instead of the n() option:
>>
>> locpoly inv_rate l_kap, at(l_kap) generate (yfitted) degree(3)
>> width(1.5) noscatter
>>
>> This indeed computes the smoothing and creates the fitted value
>> yfitted for all the values of l_kap. However, it gives too much
>> weight to outliers.
>>
>> Instead, I would like the kernel regression to be computed only on a
>> limited number of points (as in the option n(50) ) BUT get the fitted
>> (approximated) value for ALL observations.
*
* 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/