[R] QQ plots and boxcox
John Fox
jfox at mcmaster.ca
Tue Dec 2 23:05:13 CET 2008
Dear Erin,
What you characterize as "snaky" might also be called bimodal and
short-tailed. Try, e.g., plot(density(residuals(dog1.aov))) to see the
bimodality more clearly. A Box-Cox transformation can correct skewness, but
won't help here.
I hope this helps,
John
------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of Erin Hodgess
> Sent: December-02-08 4:28 PM
> To: r-help at r-project.org
> Subject: [R] QQ plots and boxcox
>
> Dear R People:
>
> In the DASL library, there is a story about hot dogs.
>
> Here are the data:
> Beef 186 495
> Beef 181 477
> Beef 176 425
> Beef 149 322
> Beef 184 482
> Beef 190 587
> Beef 158 370
> Beef 139 322
> Beef 175 479
> Beef 148 375
> Beef 152 330
> Beef 111 300
> Beef 141 386
> Beef 153 401
> Beef 190 645
> Beef 157 440
> Beef 131 317
> Beef 149 319
> Beef 135 298
> Beef 132 253
> Meat 173 458
> Meat 191 506
> Meat 182 473
> Meat 190 545
> Meat 172 496
> Meat 147 360
> Meat 146 387
> Meat 139 386
> Meat 175 507
> Meat 136 393
> Meat 179 405
> Meat 153 372
> Meat 107 144
> Meat 195 511
> Meat 135 405
> Meat 140 428
> Meat 138 339
> Poultry 129 430
> Poultry 132 375
> Poultry 102 396
> Poultry 106 383
> Poultry 94 387
> Poultry 102 542
> Poultry 87 359
> Poultry 99 357
> Poultry 107 528
> Poultry 113 513
> Poultry 135 426
> Poultry 142 513
> Poultry 86 358
> Poultry 143 581
> Poultry 152 588
> Poultry 146 522
> Poultry 144 545
>
>
> Here is my work:
> > dog1.df <- read.table(file="dog1.dat",as.is=F,header=F,
> + col.names=c("type","cal","sodium"))
> > dog1.aov <- aov(cal~type,data=dog1.df)
> > summary(dog1.aov)
> Df Sum Sq Mean Sq F value Pr(>F)
> type 2 17692.2 8846.1 16.074 3.862e-06 ***
> Residuals 51 28067.1 550.3
> ---
> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> > TukeyHSD(dog1.aov)
> Tukey multiple comparisons of means
> 95% family-wise confidence level
>
> Fit: aov(formula = cal ~ type, data = dog1.df)
>
> $type
> diff lwr upr p adj
> Meat-Beef 1.855882 -16.82550 20.53726 0.9688129
> Poultry-Beef -38.085294 -56.76667 -19.40391 0.0000277
> Poultry-Meat -39.941176 -59.36515 -20.51720 0.0000239
>
> > plot(dog1.aov)
>
> When I look at the QQ plot, it's quite "snaky".
> I thought that doing a transformation (based on boxcox) would help
> with the snakiness.
>
> However, when I re-run with the transformation, it's still snaky.
>
> Any suggestions, please?
>
> Thanks,
> Sincerely,
> Erin
>
>
> --
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: erinm.hodgess at gmail.com
>
> ______________________________________________
> 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.
More information about the R-help
mailing list