|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: RE: weighted "lowess"
I work on Stata 10 so I will try the restricted cubic splines...
Thanks!!
C�line
Nick Cox a �crit :
This is difficult. -lowess- doesn't accept weights. The most
obvious reason is that it uses weights internally as a key part
of the lowess algorithm.
In principle, you could -expand- the data first to replicate the
effect of frequency weights, but that might leave you with a dataset
of millions, and very slow -lowess-. On the other hand, something like
this
gen popwt = round(pop/1000)
expand popwt
lowess ...
would be in practice surely precise enough, and faster.
However, an alternative is to use restricted cubic splines,
for which weights are allowed.
-rcspline- from SSC would automate that you (and be _much_
faster). Stata 10 is needed.
Celine Carrere
I use the command "Lowess" to obtain the locally weighted regression of
the "wage growth" (yvar) on a "geographical variable" (xvar). My
individuals are cities and I would like to (also) weight the regression
of yvar on xvar by the number of inhabitants in the city. How can I do?
*
* 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/
--
====================================================
C�line CARRERE, CERDI-CNRS
65 Bd F. Mitterrand
63009 Clermont-Ferrand Cedex 1, FRANCE
Tel : (00 33) (0) 473 17 75 14
Fax : (00 33) (0) 473 17 74 28
Web: http://carrere.cerdi.org/
*
* 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/