Normal distribution

9 messages Options
Embed this post
Permalink
Noela Sánchez-2

Normal distribution

Reply Threaded More More options
Print post
Permalink
Hi,

I am dealing with how to check in R if some data that I have belongs to a
normal distribution or not. I am not interested in obtaining the
theoreticall frequencies. I am only interested in determing if (by means of
a test as Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


--
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Peter Ehlers

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
Noela,

Package nortest has 5 tests of normality.

A word of caution: the wording of your question suggests that
you believe that, if the test you use does not reject the
normality hypothesis, you then have proof that your data come
from a Normal distribution. That's *NOT* true. Normality will
still be an *assumption*, albeit perhaps a reasonable one.
This is particularly important to realize if you have small
samples.

  -Peter Ehlers

Noela Sánchez wrote:

> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to a
> normal distribution or not. I am not interested in obtaining the
> theoreticall frequencies. I am only interested in determing if (by means of
> a test as Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Richardson, Patrick

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
In reply to this post by Noela Sánchez-2
?shapiro.test


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Noela Sánchez
Sent: Thursday, October 01, 2009 12:47 PM
To: [hidden email]
Subject: [R] Normal distribution

Hi,

I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


--
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

        [[alternative HTML version deleted]]

This email message, including any attachments, is for th...{{dropped:6}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Steve Lianoglou-6

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
Hi,

I think you can also use a qq-plot to do the same, no? You won't get a
statistic score + p.value, but perhaps you're more of a visual person?
:-)

-steve

On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
<[hidden email]> wrote:

> ?shapiro.test
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Noela Sánchez
> Sent: Thursday, October 01, 2009 12:47 PM
> To: [hidden email]
> Subject: [R] Normal distribution
>
> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
> --
> Noela
> Grupo de Recursos Marinos y Pesquerías
> Universidad de A Coruña
>
>        [[alternative HTML version deleted]]
>
> This email message, including any attachments, is for th...{{dropped:6}}
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



--
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Richardson, Patrick

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
I don't disagree. And to that end one could probably look at the skewness and kurtosis values as well. A combination of several techniques would probably be a good idea.

Best regards,

Patrick

-----Original Message-----
From: Steve Lianoglou [mailto:[hidden email]]
Sent: Thursday, October 01, 2009 1:18 PM
To: Richardson, Patrick
Cc: Noela Sánchez; [hidden email]
Subject: Re: [R] Normal distribution

Hi,

I think you can also use a qq-plot to do the same, no? You won't get a
statistic score + p.value, but perhaps you're more of a visual person?
:-)

-steve

On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
<[hidden email]> wrote:

> ?shapiro.test
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Noela Sánchez
> Sent: Thursday, October 01, 2009 12:47 PM
> To: [hidden email]
> Subject: [R] Normal distribution
>
> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
> --
> Noela
> Grupo de Recursos Marinos y Pesquerías
> Universidad de A Coruña
>
>        [[alternative HTML version deleted]]
>
> This email message, including any attachments, is for ...{{dropped:25}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Peter Ehlers

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
In reply to this post by Steve Lianoglou-6
Another interesting visual technique is given by the
qreference() function in pkg:DAAG. I've used this type
of display effectively with non-stats people as well
as in teaching intro courses in stats.
(I would randomize the location of the actual-data panel
and not use a different colour. The question then is,
can you discern the actual data from the simulated data?)

  -Peter Ehlers

Steve Lianoglou wrote:

> Hi,
>
> I think you can also use a qq-plot to do the same, no? You won't get a
> statistic score + p.value, but perhaps you're more of a visual person?
> :-)
>
> -steve
>
> On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
> <[hidden email]> wrote:
>> ?shapiro.test
>>
>>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]] On Behalf Of Noela Sánchez
>> Sent: Thursday, October 01, 2009 12:47 PM
>> To: [hidden email]
>> Subject: [R] Normal distribution
>>
>> Hi,
>>
>> I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not.
>>
>> But I have tried with ks.test() and I have not got it.
>>
>>
>> --
>> Noela
>> Grupo de Recursos Marinos y Pesquerías
>> Universidad de A Coruña
>>
>>        [[alternative HTML version deleted]]
>>
>> This email message, including any attachments, is for th...{{dropped:6}}
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Colin Millar

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
A quick google on 'normality test' (no quotes) gives http://en.wikipedia.org/wiki/Normality_test. This gives you a few more tests than the KS test.

Cheers,
Colin.


Steve Lianoglou wrote:

> Hi,
>
> I think you can also use a qq-plot to do the same, no? You won't get a
> statistic score + p.value, but perhaps you're more of a visual person?
> :-)
>
> -steve
>
> On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
> <[hidden email]> wrote:
>> ?shapiro.test
>>
>>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]] On Behalf Of Noela Sánchez
>> Sent: Thursday, October 01, 2009 12:47 PM
>> To: [hidden email]
>> Subject: [R] Normal distribution
>>
>> Hi,
>>
>> I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not.
>>
>> But I have tried with ks.test() and I have not got it.
>>
>>
>> --
>> Noela
>> Grupo de Recursos Marinos y Pesquerías
>> Universidad de A Coruña
>>
>>        [[alternative HTML version deleted]]
>>
>> This email message, including any attachments, is for th...{{dropped:6}}
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Greg Snow-2

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
In reply to this post by Noela Sánchez-2
See fortune(234)

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
801.408.8111


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of Noela Sánchez
> Sent: Thursday, October 01, 2009 10:47 AM
> To: [hidden email]
> Subject: [R] Normal distribution
>
> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to
> a
> normal distribution or not. I am not interested in obtaining the
> theoreticall frequencies. I am only interested in determing if (by
> means of
> a test as Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
> --
> Noela
> Grupo de Recursos Marinos y Pesquerías
> Universidad de A Coruña
>
> [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
mandalic05

Re: Normal distribution

Reply Threaded More More options
Print post
Permalink
In reply to this post by Noela Sánchez-2
Normal distribution check within R can be done with functions available in nortest package. This package consists of several normality tests. In order to install package type install.packages('nortest'). Afterwards, you should consider running ks.test() only if mu and sigma parameters are known (these stand for population arithmetic mean and variance) - and that's only applicable if your data is gathered from the population. Therefor I recommend using lillie.test() function, which is Lilliefors' modification of Kolmogorov-Smirnov statistic. It's applicable both for data gathered from a sample, but can also be applied to population data. You can run ks.test(x, pnorm), but don't worry if you get several ties - these occur due to rounding of values, or if your data come from descrete probability function...

You can also try shapiro.test() function if your sample counts less then 50 responses (Shapiro-Wilks' test for small samples), or ad.test() for Anderson-Darling normality test. You should revise these statistical procedures in official literature, but there's also a lot of info on wikipedia about stated statistical techniques.

If absolute value of skewness is larger than 1.96 * standard error of skewness, your distribution significantly differs from normal. Also stands for kurtosis. Value 1.96 implies p-value lower than .05, and 2.58 lower than .01
Skewness function is called with skew(), and kurtosis with kurtosi() function.

Standard error of skewness is calculated from formula se.sk <- sqrt(6/length(x)) and standard error of kurtosis from formula se.ku <- sqrt(24/length(x))

If mean is not located in the middle of the range, this can also indicate a violation of normality.

I strongly recommend reading official help for nortest package, and consulting an official statistical literature!

P.S.

shapiro.test() is located in stats package, but running it on a large sample (N >> 50) is not quite applicable, hence use lillie.test() for those purposes, or ks.test(x, pnorm) - where x argument is variable which normality you're about to check, and pnorm stands for normal distribution function.


Noela Sánchez-2 wrote:
Hi,

I am dealing with how to check in R if some data that I have belongs to a
normal distribution or not. I am not interested in obtaining the
theoreticall frequencies. I am only interested in determing if (by means of
a test as Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


--
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

        [[alternative HTML version deleted]]


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.