| gof | R Documentation |
Performs a test of goodness of fit (by default: see the testfn argument for possible alternatives). The only method implemented so far is based on randomized quantile residuals (Dunn & Smyth, 1996).
gof(object, method = "RQR", plot.=FALSE, testfn=stats::shapiro.test, ...)
object |
A fit object inheriting from class |
method |
Character string; a method of test of goodness of fit. |
plot. |
Boolean: whether to produce a plot (effectively |
testfn |
A function with the following interface: it takes the vector of values whose normality is assessed as first argument; and it returns a |
... |
Further arguments passed to |
Returns a list made up of the return value of a call to the function provided by the testfn argument, with added element RQR, itself a list including the randomized residuals.
The default testfn, shapiro.test (except for datasets of more than 5000 fitted response values), returns “a list with class "htest"” which is therefore the class of the default result.
Dunn, K. P., and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics 5, 1-10.
data("Orthodont", package = "nlme")
sp1 <- fitme(distance ~ age * Sex + (1 | Subject), data = Orthodont)
gof(sp1) # classic toy example, but poor fit.
gof(sp1, testfn=ks.test, y="pnorm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.