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

Re: Re: st: ksm


From   Weihua Guan <wguan@stata.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: ksm
Date   Thu, 18 Jul 2002 13:03:37 -0500

--Constantine Daskalakis <constantine.daskalakis@mail.tju.edu> wrote:

> But as I pointed out in my original email, I HAVE updated my Stata (v7) with
> 
> . update all
> 
> The date showing up in my -update query- is   11 Jul 2002.

I am not sure what happened, but the error can not be reproduced here.  I will
send Constantine another version to test out.

Constantine also asked:

> Currently, the -by()- option simply DISPLAYS the smoother separately for 
> each group. But the smoother is the same for all groups -- estimated from 
> the full dataset. What would be of interest is to allow a specification, 
> where the smoother is ESTIMATED separately for each group. As it now 
> stands, I have to do this manually by using the -if- option or the -use- 
> command. And I can't get the various plots on one page that way (unless I 
> go to the trouble of saving all the individual graphs and afterwards 
> combining them manually).

Actually, the current -by()- option does estimate the smoothers separately for
each group.  The following example may elaborate:

. use auto, clear

. gen x = int(uniform()*2)

. ksm for price, logit by(x) gen(sm1)

. ksm for price if x==0, logit gen(sm2)

. list sm1 sm2 if x==0

           sm1        sm2
  1. -.9650809  -.9650809
  3. -.9808292  -.9808292
  4. -.7339692  -.7339692
  5. -.5306283  -.5306283
  6. -.5260931  -.5260931
  7. -1.021651  -1.021651
  8. -.7339692  -.7339692
 10. -1.098612  -1.098612
......

The smoothed values are the same from the two approaches.


Weihua Guan <wguan@stata.com>
Stata Corp.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index