MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Normality test

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107507] Re: [mg107204] Re: Normality test
  • From: michael partensky <partensky at gmail.com>
  • Date: Mon, 15 Feb 2010 05:46:59 -0500 (EST)
  • References: <8dd79b761002121109w33756ccp1902d87c3e9e2c84@mail.gmail.com>

*Thanks, Ray.
*

> Here's another approach that you might find interesting: plot the
> observed data against multiple samples from a standard normal
> distribution.
>
> Show[Graphics@Table[Line@Transpose@{Sort@RandomReal[
> NormalDistribution[0,1], Length@data], data}, {50}],
> PlotRange->All, Frame->True]
>
> *I was thinking of something like this, but could not implement it so
nicely. **Comparing directly the  data sets with the averaged same- size
(ordered) samples from the normal distribution **can be also very helpful
for teaching.  After such a discussion,  a quartiles-based approach can be
introduced more naturally. Does it make sense?*

> Then compare that plot to what you get when you replace the data by
> a single fixed sample of the same size from a normal distribution.
>
> >
> > Which *quantitative* measure of the normality do you prefer?
>
> I've never had need of such a measure, so I haven't thought about it.
> My top-of-the-head response is that there probably is no measure that
> will be best for all purposes, that it will depend on the particular
> aspect of non-normality that is most important in the situation at
> hand.
>
> *I see. I just wanted to grasp where, say, in hypothesis-testing we can
use some quantitative measures of non-normality derived from the
aforementioned tests.*

 >
> > Thanks.
> > Michael.
> >
> > On Fri, Feb 5, 2010 at 3:24 AM, Ray Koopman <koopman at sfu.ca> wrote:
> >
> >> Here, prompted by off-line conversations, is an improved version of
> >> qqnorm:
> >>
> >> qqnorm2[data_] := Block[{n, y,y1,y2,y3, x,x1,x2,x3, b,a},
> >> n = Length@data; y = Sort@data; {y1,y2,y3} = Quartiles@y;
> >> x = InverseErf[Range[1-n,n-1,2]/(n+.33(n-1.25)^-.1)]*Sqrt[2.];
> >> {x1,x2,x3} = Quartiles@x; b = (y3-y1)/(x3-x1); a = y1 - b*x1;
> >> ListPlot[Transpose@{x,y}, PlotRange->All, Frame->True, Axes->None,
> >> AspectRatio->((Last@y-First@y)/(y3-y1))/((Last@x-First@x)/(x3-x1)),
> >> Prolog->Line[{#,#*b+a}&/@{First@x,Last@x}],
> >> FrameLabel->{"Standard Normal","Observed Data"}]]
> >>
> >> The most notable changes are that the reference line is now drawn so
> >> that it passes through the joint first and third quartile points, and
> >> the aspect ratio now varies so that the visual slope of the reference
> >> line is always approximately 1. Also, the normal scores are now a
> >> better approximation of the expected order statstics.
> >>
> >> On Feb 2, 3:48 am, Ray Koopman <koop... at sfu.ca> wrote:
> >>> On Feb 2, 12:28 am, michael partensky <parten... at gmail.com> wrote:
> >>>> Hi.
> >>>> I wonder if anybody knows a function similar to qqnorm(data) from
> >>>> *R*, producing a normal scores plot, or some related tools in M.
> >>>> for testing normality of data?
> >>>>
> >>>> Thanks
> >>>> Michael Partenskii
> >>>
> >>> qqnorm[y_] := Block[
> >>>  {n = Length@y, m = Mean@y, s = StandardDeviation@y, x},
> >>>  x = InverseErf[Range[1-n,n-1,2]/n]*Sqrt[2.];
> >>>  ListPlot[Transpose@{x,Sort@y},
> >>>  PlotRange->All, Frame->True, Axes->None, AspectRatio->1,
> >>>  Prolog->Line[{{x[[1]],x[[1]]*s+m},{x[[-1]],x[[-1]]*s+m}}],
> >>>  FrameLabel->{"Theoretical Standard Normal Quantiles",
> >>>               "Observed Quantiles"}]]
>


  • Prev by Date: Re: Shadow error when trying to use ParallelTable
  • Next by Date: Re: Shadow error when trying to use ParallelTable
  • Previous by thread: Re: Re: Normality test
  • Next by thread: Re: Re: Normality test