[R] Kolmogorov-Smirnof test for lognormal distribution with estimated parameters

Christian Hennig fm3a004 at math.uni-hamburg.de
Wed Jan 12 18:25:02 CET 2005


For the KS-test of normality with estimated parameters see

?lillie.test in package nortest.

Best,
Christian

On Wed, 12 Jan 2005, Christoph Buser wrote:

> Hi Kwabena
> 
> I did once a simulation, generating normal distributed values
> (500 values) and calculating a KS test with estimated
> parameters. For 10000 times repeating this test I got about
> 1 significant tests (on a level alpha=0.05 I'm expecting about 500 
> significant tests by chance)
> So I think if you estiamte the parameters from the data, you fit
> to good and the used distribution of the test statistic is not
> adequate as it is indicated in the help page you cited. There
> (in the help page) is some literature, but it is no easy stuff
> to read.
> Furthermore I know no implementation of an KS test which
> accounts for this estimation of the parameter.
> 
> I recommend a graphical tool instead of a test:
> 
> x <- rlnorm(100)
> qqnorm(log(x))
> 
> See also ?qqnorm and ?qqplot.
> 
> If you insist on testing a theoretical distribution be aware
> that a non significant test does not mean that your data has the
> tested distribution (especially if you have few data, there is
> no power in the test to detect deviations from the theoretical
> distribution and the conclusion that the data fits well is
> trappy)
> 
> If there are enough data I'd prefer a chi square test to the KS
> test (but even there I use graphical tools instead). 
> 
> See ?chisq
> 
> For this test you have to specify classes and this is 
> subjective (you can't avoid this).
> 
> You can reduce the DF of the expected chi square distribution
> (under H_0) by the number of estimated parameters from the data
> and will get better results. 
> 
> DF = number of classes - 1 - estimated parameters
> 
> I think this test is more powerful than the KS test,
> particularly if you must estimate the parameters from data.
> 
> Regards,
> 
> Christoph
> 
> -- 
> Christoph Buser <buser at stat.math.ethz.ch>
> Seminar fuer Statistik, LEO C11
> ETH (Federal Inst. Technology)	8092 Zurich	 SWITZERLAND
> phone: x-41-1-632-5414		fax: 632-1228
> http://stat.ethz.ch/~buser/
> 
> 
> 
> Kwabena Adusei-Poku writes:
>  > Hello all,
>  > 
>  > Would somebody be kind enough to show me how to do a KS test in R for a
>  > lognormal distribution with ESTIMATED parameters. The R function
>  > ks.test()says "the parameters specified must be prespecified and not
>  > estimated from the data" Is there a way to correct this when one uses
>  > estimated data?
>  > 
>  > Regards,
>  > 
>  > Kwabena.
>  > 
>  > --------------------------------------------
>  > Kwabena Adusei-Poku
>  > University of Goettingen
>  > Institute of Statistics and Econometrics
>  > Platz der Goettingen Sieben 5
>  > 37073 Goettingen
>  > Germany
>  > Tel: +49-(0)551-394794
>  > 
>  > ______________________________________________
>  > R-help at stat.math.ethz.ch mailing list
>  > https://stat.ethz.ch/mailman/listinfo/r-help
>  > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

***********************************************************************
Christian Hennig
Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/
#######################################################################
ich empfehle www.boag-online.de




More information about the R-help mailing list