EnvStats by Steven P. Millard

EnvStats by Steven P. Millard

Author:Steven P. Millard
Language: eng
Format: epub
Publisher: Springer New York, New York, NY


gofGroupTest

Shapiro-Wilk, Shapiro-Francia, and PPCC goodness-of-fit tests for normality for two or more groups

gofCensoredTest

Shapiro-Wilk, Shapiro-Francia, and PPCC goodness-of-fit tests for normality for censored data

7.2.1 One Sample Goodness-of-Fit Tests for Normality

In Chaps.​ 1 and 3 we saw that the Reference area TcCB data appear to come from a lognormal distribution based on a histogram (Fig.​ 1.​2), an empirical cdf plot (Fig.​ 1.​5), a normal Q-Q plot (Fig.​ 1.​7), a Tukey mean-difference Q-Q plot (Fig.​ 1.​8), and a plot of the probability plot correlation coefficient (PPCC) versus λ for a variety of Box-Cox transformations (Fig.​ 3.​7). In Sect.​ 1.​11.​7 we showed the results of using the Shapiro-Wilk test to test the adequacy of the lognormal distribution. Here we will formally test whether the Reference area TcCB data appear to come from a normal distribution versus a lognormal distribution, and in the call to gofTest for testing lognormality we will specify using the alternative parameterization of the lognormal distribution (i.e., estimating the mean and CV of the original distribution).

> attach(EPA.94b.tccb.df)

> TcCB.Ref < - TcCB[Area == "Reference"]

> sw.list.norm < - gofTest(TcCB.Ref)

> sw.list.norm

Results of Goodness-of-Fit Test

-------------------------------

Test Method: Shapiro-Wilk GOF

Hypothesized Distribution: Normal

Estimated Parameter(s): mean = 0.5985106

sd = 0.2836408

Estimation Method: mvue

Data: TcCB.Ref

Sample Size: 47

Test Statistic: W = 0.9176408

Test Statistic Parameter: n = 47

P-value: 0.002768207

Alternative Hypothesis: True cdf does not equal the

                    Normal Distribution.

> sw.list.lnormAlt < - gofTest(TcCB.Ref, dist = "lnormAlt")

> sw.list.lnormAlt

Results of Goodness-of-Fit Test

-------------------------------

Test Method: Shapiro-Wilk GOF

Hypothesized Distribution: Lognormal

Estimated Parameter(s): mean = 0.5989072

cv = 0.4899539

Estimation Method: mvue

Data: TcCB.Ref

Sample Size: 47

Test Statistic: W = 0.978638

Test Statistic Parameter: n = 47

P-value: 0.5371935

Alternative Hypothesis: True cdf does not equal the

Lognormal Distribution.

The p-value for the test of normality (p = 0.003) clearly indicates that we should not assume the Reference area TcCB data come from a normal distribution, but the assumption of a lognormal distribution appears to be adequate (p = 0.54). Figures 7.1 and 7.2 show companion plots for the results of the Shapiro-Wilk tests for normality and lognormality, respectively. These plots include the observed distribution overlaid with the fitted distribution, the observed and fitted CDF, the normal Q-Q plot, and the results of the hypothesis test. They were created with these commands:

Fig. 7.1Companion plots for the Shapiro-Wilk test for normality for the Reference area TcCB data



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.