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

st: RE: Lowess smoothing with a twist


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Lowess smoothing with a twist
Date   Wed, 28 Aug 2002 11:49:41 +0100

SamL
>
> Is it possible to do a lowess smoothing of some data when
> the Ns vary
> across the dimension of smoothing.  In short, I have data that are
> percentages of people who believe in God, for almost every year from
> 1970-2000.  Unfortunately, the sample sizes vary
> appreciably by year,
> meaning that the percentages are obviously less precisely
> estimated in
> years with fewer cases than in years with lots of cases
> (fewer can be as
> low as 10, and lots can be as high as 150 in this context).
> I know that
> LOWESS smoothing (and other techniques) use nearby years to
> smooth the
> data.  I want to know how I can do that AND also account
> for the differing
> precision (or, what is the same thing, the varying Ns)
> across time.  Does
> anyone know whether and how I might do that in Stata or,
> barring that,
> some other graphing program.
>

At present -ksm- does not support weights. The practical
reason is that internally it makes use of weights.
I am not clear on whether in principle it could be modified to
support user-specified weights, which would then be combined
with internally-generated weights.

I don't know how far nonparametric smoothing
is essential for your problem. Although parametric,
I have found models like

. tsset t
. regress foo t L.foo

do a very good job of smoothing, yet they can also wiggle
and waggle to follow systematic structure. Time series buffs
should be able to comment further. You could extend that to
take account of weights. Gaps are not too much of an issue.

-regplot- and -ofrtplot- from SSC may be useful
for looking at the results.

Nick
[email protected]

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