riedwyl@giub.unibe.ch
2005-Sep-09 14:03 UTC
[R] test for exponential,lognormal and gammadistribution
hello! i don't want to test my sample data for normality, but exponential- lognormal- or gammadistribution. as i've learnt the anderson-darling-test in R is only for normality and i am not supposed to use the kolmogorov-smirnov test of R for parameter estimates from sample data, is that true? can you help me, how to do this anyway! thank you very much! nadja
Spencer Graves
2005-Sep-11 02:55 UTC
[R] test for exponential,lognormal and gammadistribution
I just got 73 hits for 'RSiteSearch("test for exponential distribution")'. In skimming quickly the first 20, the one that seemed most relevant to me was a reply I wrote to a similar question two months ago (http://finzi.psych.upenn.edu/R/Rhelp02a/archive/37055.html). Of course, some of the remaining 72 may help you more. spencer graves riedwyl at giub.unibe.ch wrote:> hello! > i don't want to test my sample data for normality, but exponential- lognormal- > or gammadistribution. > as i've learnt the anderson-darling-test in R is only for normality and i am > not supposed to use the kolmogorov-smirnov test of R for parameter estimates > from sample data, is that true? > can you help me, how to do this anyway! > thank you very much! > nadja > > ______________________________________________ > 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-- Spencer Graves, PhD Senior Development Engineer PDF Solutions, Inc. 333 West San Carlos Street Suite 700 San Jose, CA 95110, USA spencer.graves at pdf.com www.pdf.com <http://www.pdf.com> Tel: 408-938-4420 Fax: 408-280-7915
Christoph Buser
2005-Sep-12 06:20 UTC
[R] test for exponential,lognormal and gammadistribution
Hi Nadja It depends on your purpose. Often people are using tests to show that a sample follows a distribution (normal, exponential, lognormal, ...). If a test rejects the null hypothesis that the sample comes from the specified distribution, you are on the safe side, since you are controlling the significance level (e.g. 5%) and therefore know the alpha error. But if a test do not reject the null hypothesis, generally you have NOT shown that the sample has the specified distribution. This is related to the power of your test (to detect differences). If the power of a test is lousy, the conclusion that "your sample has the distribution ...". based on the nonsignificant test result is misleading or even wrong. As you mentioned below the kolmogorov-smirnov test does not adapt for the fact that the parameters of the distribution you test against are estimated from the data sample. It assumes that the parameters are know. But in practice that's not the case in general. Since the parameter are estimated from the data, but the test do not have this information, but assumes that these parameters are a fixed known quantity, the test is to conservative and has a small power to detect differences. Therefore it is quite dangerous to conclude that a sample has a specified distribution, based on the kolmogorov-smirnov test. An alternative way might be using graphical tools, e.g. quantile plots (see ?qqplot and ?qqnorm). Obviously you have the same difficulty by interpreting the plots, since nobody can tell you for sure if a deviation from the straight line is significant or just by chance. But if you conclude that a sample has a distribution by looking at the plot you will be aware of this subjectivity that can not be avoided. The test result will often give you the wrong impression of objectivity. The best example to see this is if you have a very small sample. In general any test has a small power if your sample is small and it is most probable that the test is nonsignificant. If we look at the quantile plot (with a small sample) we often can not judge if it is a straight line or not (since the sample is to small) and in this case it is the correct conclusion that we can not say anything about the distribution. I hope this will be helpful. Regards, Christoph Buser -------------------------------------------------------------- Christoph Buser <buser at stat.math.ethz.ch> Seminar fuer Statistik, LEO C13 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-44-632-4673 fax: 632-1228 http://stat.ethz.ch/~buser/ -------------------------------------------------------------- riedwyl at giub.unibe.ch writes: > > hello! > i don't want to test my sample data for normality, but exponential- lognormal- > or gammadistribution. > as i've learnt the anderson-darling-test in R is only for normality and i am > not supposed to use the kolmogorov-smirnov test of R for parameter estimates > from sample data, is that true? > can you help me, how to do this anyway! > thank you very much! > nadja > > ______________________________________________ > 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 > > > !DSPAM:43219660106581956711619!