Does a function exist that combines a normal probability plot
with a histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot",
and I think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that
Wikipedia article if you feel so inclined.
qqnorm with histogram?
7 messages · Jim Lemon, Spencer Graves, Charles C. Berry +2 more
Hi Spencer, The last example for the twoord.plot function (plotrix) does this. Jim
On Sun, 3 Aug 2014 12:38:10 PM Spencer Graves wrote:
Does a function exist that combines a normal probability plot
with a histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot",
and I think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that
Wikipedia article if you feel so inclined.
______________________________________________ R-help at 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.
Hi, Jim et al.:
Thanks for the reply, Jim.
What are your favorite examples using normal probability plots to
identify outliers, skewness, kurtosis, mixtures, and the need for
transformations in plots of raw data and residuals from model fits -- or
using half-normal plots with estimated parameters?
I ask, because I believe the current Wikipedia article on "Normal
probability plot" could be improved dramatically with a set of great
examples. I also plan to write a function to display a normal
probability plot with a histogram, a density estimate, and a boxplot and
use it with the examples. My current plan is to create this with a
function qqnormPlus(..., datax=TRUE, histargs, densityargs, boxplotargs)
that passes histargs, densityargs and boxplotargs to truehist{MASS},
density, and boxplot, respectively. I plan to add this to the Ecfun
package (for which I'm the author and maintainer).
This wikipedia article received 14774 views in the past 90 days,
averaging not quite 700 per day, so I think it's worth doing. I could
use suggestions (and help from other Wikipedians on this list).
Thanks,
Spencer
On 8/3/2014 2:59 PM, Jim Lemon wrote:
Hi Spencer, The last example for the twoord.plot function (plotrix) does this. Jim On Sun, 3 Aug 2014 12:38:10 PM Spencer Graves wrote:
Does a function exist that combines a normal probability plot
with a histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot",
and I think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that
Wikipedia article if you feel so inclined.
______________________________________________ R-help at 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.
Spencer Graves <spencer.graves <at> structuremonitoring.com> writes:
Hi, Jim et al.:
Thanks for the reply, Jim.
What are your favorite examples using normal probability plots to
identify outliers, skewness, kurtosis, mixtures, and the need for
transformations in plots of raw data and residuals from model fits -- or
using half-normal plots with estimated parameters?
Not sure I have a *favorite*, but the so-called "Fisher's iris data" provide an illustration of an obvious mixture and the value of conditioning. Try: qqnorm(iris$Petal.Length,col=as.numeric(iris$Species)) qqnorm(residuals(lm(Petal.Length~Species,iris))) As a bonus, you can reference this pretty page: http://en.wikipedia.org/wiki/Iris_%28plant%29 where the contributions of the iris to water purification, art, and symbolism are noted. Maybe a section on the iris in statistics... ;-) HTH, Chuck
Not that I want to get deeply involved with this, but techniques that allow you to take the random variation of the plots into account are badly needed in practice. I mean, running qqnorm(rnorm(10)) a dozen times _ought_ to cure you of overinterpreting plots that are not bang-on a straight line but have apparent curvature, outliers, etc., but tell that to students these days... Confidence bands would be good to include. Various techniques are in circulation; I believe John Fox implemented one for Rcmdr/car. I seem to recall that these are based on the binomial distribution or its asymptotic approximation. If you are qqnorm()-in residuals, the theory for constructing CI's for the normal plot breaks down and you need to resort to simulation techniques, e.g. something like
Y <- rgamma(10, 5) qqnorm(scale(Y)) for (i in 1:10) lines(qqnorm(sort(scale(rnorm(10))),plot=FALSE), col="lightgray")
-pd
On 04 Aug 2014, at 18:55 , Spencer Graves <spencer.graves at structuremonitoring.com> wrote:
Hi, Jim et al.:
Thanks for the reply, Jim.
What are your favorite examples using normal probability plots to identify outliers, skewness, kurtosis, mixtures, and the need for transformations in plots of raw data and residuals from model fits -- or using half-normal plots with estimated parameters?
I ask, because I believe the current Wikipedia article on "Normal probability plot" could be improved dramatically with a set of great examples. I also plan to write a function to display a normal probability plot with a histogram, a density estimate, and a boxplot and use it with the examples. My current plan is to create this with a function qqnormPlus(..., datax=TRUE, histargs, densityargs, boxplotargs) that passes histargs, densityargs and boxplotargs to truehist{MASS}, density, and boxplot, respectively. I plan to add this to the Ecfun package (for which I'm the author and maintainer).
This wikipedia article received 14774 views in the past 90 days, averaging not quite 700 per day, so I think it's worth doing. I could use suggestions (and help from other Wikipedians on this list).
Thanks,
Spencer
On 8/3/2014 2:59 PM, Jim Lemon wrote:
Hi Spencer, The last example for the twoord.plot function (plotrix) does this. Jim On Sun, 3 Aug 2014 12:38:10 PM Spencer Graves wrote:
Does a function exist that combines a normal probability plot
with a histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot",
and I think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that
Wikipedia article if you feel so inclined.
______________________________________________ R-help at 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.
______________________________________________ R-help at 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.
Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Thanks to Charles Berry for suggesting "iris{datasets}" and to Peter
Dalgaard for suggesting Confidence Intervals as produced by qqPlot{car}.
Spencer
On 8/5/2014 2:55 AM, peter dalgaard wrote:
Not that I want to get deeply involved with this, but techniques that allow you to take the random variation of the plots into account are badly needed in practice. I mean, running qqnorm(rnorm(10)) a dozen times _ought_ to cure you of overinterpreting plots that are not bang-on a straight line but have apparent curvature, outliers, etc., but tell that to students these days... Confidence bands would be good to include. Various techniques are in circulation; I believe John Fox implemented one for Rcmdr/car. I seem to recall that these are based on the binomial distribution or its asymptotic approximation. If you are qqnorm()-in residuals, the theory for constructing CI's for the normal plot breaks down and you need to resort to simulation techniques, e.g. something like
Y <- rgamma(10, 5) qqnorm(scale(Y)) for (i in 1:10) lines(qqnorm(sort(scale(rnorm(10))),plot=FALSE), col="lightgray")
-pd On 04 Aug 2014, at 18:55 , Spencer Graves <spencer.graves at structuremonitoring.com> wrote:
Hi, Jim et al.:
Thanks for the reply, Jim.
What are your favorite examples using normal probability plots to identify outliers, skewness, kurtosis, mixtures, and the need for transformations in plots of raw data and residuals from model fits -- or using half-normal plots with estimated parameters?
I ask, because I believe the current Wikipedia article on "Normal probability plot" could be improved dramatically with a set of great examples. I also plan to write a function to display a normal probability plot with a histogram, a density estimate, and a boxplot and use it with the examples. My current plan is to create this with a function qqnormPlus(..., datax=TRUE, histargs, densityargs, boxplotargs) that passes histargs, densityargs and boxplotargs to truehist{MASS}, density, and boxplot, respectively. I plan to add this to the Ecfun package (for which I'm the author and maintainer).
This wikipedia article received 14774 views in the past 90 days, averaging not quite 700 per day, so I think it's worth doing. I could use suggestions (and help from other Wikipedians on this list).
Thanks,
Spencer
On 8/3/2014 2:59 PM, Jim Lemon wrote:
Hi Spencer, The last example for the twoord.plot function (plotrix) does this. Jim On Sun, 3 Aug 2014 12:38:10 PM Spencer Graves wrote:
Does a function exist that combines a normal probability plot
with a histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot",
and I think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that
Wikipedia article if you feel so inclined.
______________________________________________ R-help at 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.
Not a single function, but the subplot function in the TeachingDemos package can be used to add the histogram and/or density plot in the empty part of a qqplot. On Sun, Aug 3, 2014 at 1:38 PM, Spencer Graves
<spencer.graves at structuremonitoring.com> wrote:
Does a function exist that combines a normal probability plot with a
histogram and maybe a density estimate on the same plot?
I'm revising the Wikipedia article on "Normal probability plot", and I
think it would be good to provide examples of this.
Thanks,
Spencer
p.s. Please reply also with suggestions for how to improve that Wikipedia
article if you feel so inclined.
______________________________________________ R-help at 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.
Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com