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 on April 23, and its replacement, is already up and running.

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

Re: st: Get fitted values after locpoly (kernel regression)

From   Austin Nichols <>
Subject   Re: st: Get fitted values after locpoly (kernel regression)
Date   Sun, 18 Sep 2011 07:34:35 -0400

Tania Treibich <>:
webuse motorcycle
lpoly accel time, degree(3) kernel(epan2) generate(hat) at(time) nograph

On Sun, Sep 18, 2011 at 7:03 AM, Tania Treibich
<> wrote:
> Dear Partho,
> thank you for your interest!
> What I want to do is to fit the model Yi=m(Xi)+ei without making any
> assumption on the functional form of m().
> The output generated by the kernel regression is a graph as well as a
> series of coordinates (new variables created in the database which I
> called xker and yker). These coordinates are the points used for the
> smoothing. Indeed, xker defines the smoothing grid : at each x0 in the
> grid, a weighted regression is performed and associated with a value
> y0. Then all these points are joined.
> What I want to retrieve instead is for each value of X, the associated
> value Yhat through the transformation m().
> I am now using locpoly for this regression but I saw I can also use
> kernreg2, but I didn't find any help files.
> Regards,
> Tania
> 2011/9/18 Partho Sarkar <>:
>> Hello Tania
>> I was puzzled by this post at first, as I knew of  locpoly as a R
>> package, rather than a  Stata command.  But a quick search via findit
>> showed the user-written locpoly (a good find for me, as I have an
>> interest in kernel regression too!)  But after looking through the
>> program help file and some examples, I am still puzzled by your
>> question.  What exactly do you mean by "fitted values"?  Are the
>> generated yker values in your example not exactly what one usually
>> calls by that name, or am I missing something?
>> Regards
>> Partho
>> On Sat, Sep 17, 2011 at 1:18 AM, Tania Treibich
>> <> wrote:
>>> Dear Statalist,
>>> I have done a kernel regression using the command locpoly :
>>> locpoly inv_rate l_kap_L, degree(3) width(1.5) n(20) generate (xker
>>> yker) noscatter
>>> I want to retrieve the fitted values, is that possible?

*   For searches and help try:

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