Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Nonparametric regression with bootstrapped SEs


From   Michael Ash <[email protected]>
To   [email protected]
Subject   st: Nonparametric regression with bootstrapped SEs
Date   Fri, 24 Jan 2003 18:17:47 -0500 (EST)

A colleague is trying to compute a locally-weighted
regression with bootstrapped standard errors or confidence
intervals.

We are following ex3-8.do and ex4-1.do in Deaton's excellent
Analysis of Household Surveys. See
http://www.worldbank.org/lsms/tools/deaton/ for more about
the book and the programs.

I have two questions:

1) Is there a canned way to to compute a locally-weighted
regression with bootstrapped standard errors or confidence
intervals in Stata, for example, with ksm and bstrap.

2) Does anyone familiar with Deaton's book know if there is
a typo in the code for the lowrex program (the core of the
locally-weighted regression estimation), in particular, at
line 12,
reg `1' `2' =kz if kz ~= .;  SHOULD PERHAPS READ
reg `1' `2' [weight=kz] if kz ~= .;  



cap program drop lowrex; 
program def lowrex;
        local ic=1;
        gen `3'=.;
        gen `4'=.;
        while `ic' <= $gsize {;
        dis `ic';
        quietly {;
        local xx=`6'[`ic'];
        gen z=abs((`2'-`xx')/`5');
        gen kz=(15/16)*(1-z^2)^2 if z <= 1;
        reg `1' `2' =kz if kz ~= .;
        replace `4'=_b[`2'] in `ic';
  *     replace `3'=_b[_cons]+_b[`2']*`xx' in `ic';
        drop z kz;
        };
        local ic=`ic'+1;
        };
end;



Thank you.
Best regards,


Michael Ash, Assistant Professor 
  of Economics and Public Policy         
Department of Economics and CPPA
University of Massachusetts
Amherst, MA 01003        
Tel 413-545-6329 Fax 413-545-2921
Email [email protected]
http://www-unix.oit.umass.edu/~maash


*
*   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