Description Usage Arguments Details References Examples
Calculate test statistic value (and P-value?) for testing fit to specified distribution.
1 |
statfun |
Name of one of the EDF statistics (see Details) |
x |
Vector of data to be tested for fit to the distribution |
dist |
Cumulative distribution function of distribution to be fitted |
... |
parameters to distribution |
Allowable test statistics are d
(Kolmogorov D), v
(Kuiper V),
w2
(Cramer-von Mises W-squared),
a2
(Anderson-Darling A-squared), u2
(Watson U-squared).
Statistics v
and u2
are invariant to choice
of origin, so can be used for data on a circle (for example, for testing
uniformity of times of day). Also modified versions
dmod
, vmod
, w2mod
, u2mod
for use with Table 4.2
of D'Agostino and Stephens (1986).
D'Agostino and Stephens (1986) Goodness of Fit Techniques, Chapter 4.
1 2 3 4 5 6 7 8 9 10 11 | data(leghorn)
# test the transformed data for uniformity (default)
calc.stat(a2,leghorn$z1)
# test original data for normality with mean 200 and SD 35
calc.stat("a2",leghorn$x,pnorm,200,35)
# obtain all statistics
my.stats=c("d","v","w2","a2","u2","dmod","vmod","w2mod","u2mod")
sapply(my.stats,calc.stat,leghorn$x,pnorm,200,35)
# data that are actually beta-distributed
data(beta_data)
sapply(my.stats,calc.stat,beta_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.