Statalist


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

AW: st: AW: ksmirnov


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: AW: ksmirnov
Date   Mon, 28 Sep 2009 16:16:52 +0200

<> 

" My question was actually simpler - was my procedure correct?"

Well, I gave you a tool to answer the question, even though the procedure
may look a little "opaque"...


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von tzygmund
mcfarlane
Gesendet: Montag, 28. September 2009 16:13
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: AW: ksmirnov

Thanks for your replies Martin & Nick.

Martin: My question was actually simpler - was my procedure correct?

That is, should the data be standardised by an estimate of the scale
before using the Kolmogorov-Smirnov procedure or is that not
necessary?

Also, from the help file for chi2fit by Stas Kolenikov I could not
figure out how to implement it for a t-distribution. Any help will be
appreciated.

Nick: I am particularly interested in deviation from a t-distribution.
My data is almost certainly non-normal. I agree about the merits of
plotting it, but am not aware of any tools for my particular case. Any
ideas?

Thanks.


On Mon, Sep 28, 2009 at 2:46 PM, Martin Weiss <martin.weiss1@gmx.de> wrote:
>
> <>
>
> As Maarten said back in the day
> (http://www.stata.com/meeting/snasug08/buis_MLBsimulate.zip), you have to
> -simulate- these things to make up your own mind whether you are on the
> right path:
>
>
>
> *************
> //drop it beforehand
> capt prog drop sim
>
> //define the program
> program define sim
>    version 11
>    syntax [, df(integer 5) obs(real 10000)]
>    drop _all
>    set obs `obs'
>    tempvar z
>    gen `z' = rt(`df')
>    ksmirnov `z' = 1-ttail(`df',`z')
> end
>
> //simulate it!
> simulate pcor=r(p_cor), /*
>  */ reps(1000): sim
>
> //result?
> qui cou if pcor<0.05
> di in red "Rejections: `r(N)', " /*
> */ "for a rate of: " r(N)/c(N)
> *************
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von tzygmund
> mcfarlane
> Gesendet: Montag, 28. September 2009 13:47
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: ksmirnov
>
> I am trying to test if a series is t-distributed with (say) 6 degrees
> of freedom using a Kolmogorov-Smirnov test. Is this the right way to
> do it?
>
> webuse wpi1
> g returns = D.ln_wpi
> ksmirnov returns = 1-ttail(6, returns)
>
> thanks.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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