[R] R: log-normal distribution and shapiro test

Vito Ricci vito_ricci at yahoo.com
Wed Nov 17 14:10:11 CET 2004


Hi,

from what you're writing:
"The logaritmic transformation
"shapiro.test(log10(y))" says: W=0.9773, p-value=
2.512e-05." it seems the log-values are not
distributed normally and so original data are not
distributed like a log-normal: the p-value is
extremally small!

Other tests for normality are available in package:
nortest

compare the log-transformation of your ecdf with
normal cdf: see ? ecdf

use qqnorm and qqplot

did you calculate skewness and kurtosis? see in
package fBasics.

I remember to you that the log-normal distribution as
three parameters: shape parameter, location parameter
and scale parameter. Transfroming by the simple log,
you are missing the location parameter, or implicitely
 you assuming is =0.

See:
http://www.itl.nist.gov/div898/handbook/eda/section3/eda3669.htm
for more news about log-normal distribution.

I hope I give you a little help.
Best
Vito


 

you wrote:

Hello:

Yes I know that sort of questions comes up quite
often. But with all due 
respect I din't find how to perform what I want. I am
searching archives 
and bowsing manuals but it isn't there, though, it is
a ridiculous 
simple task for the experienced R user.

I have data and can do the following with them:

==
hist(y, prob=TRUE)
lines(density(y,bw=0.03)
==

The result actually is a nice histogram superimposed
by a line plot.

The histogram is a bit skewed to the left. My
assumption actually is 
that a log-normal transformation would cure the
problem. But how the 
hell can one plot such a density function or Gaussian
function which has 
logarithmic scales on x axis.

For example I tried:

==
plot(hist(y),log="x")

or

plot(hist(log10(y)),log="x")
==

But with no avail. I want  my axis like: 1,10,100



What would be other methods to test whether the data
are logaritmically 
distributed.

A last question to the Shapiro-Wilk test. Were can I
get critical 
parameters? I mean I get for my distribution:
W=0.9686, p-value=6.887e-07.
What does that mean? Yes I have got some books about
statics, but none 
of them says what one should do with the values then.
The logaritmic 
transformation "shapiro.test(log10(y))" says:
W=0.9773, p-value= 2.512e-05.

Sorry for disturbing you. Although, it is really no
homework. I need it 
for my Phd in physics; after a lengthy computation on
the computer I 
would like to go to see whether the outputs are
log-normal or normal 
distributed.

Regards,
Siegfried Gonzi
==
University of Graz
Institute for Physics
Tel.: ++43-316-380-8620

=====
Diventare costruttori di soluzioni
Became solutions' constructors

"The business of the statistician is to catalyze 
the scientific learning process."  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml




More information about the R-help mailing list