Description Usage Arguments Value References Examples
Simulates from the generalized pivotal quantities.
1 | rGPQ(fit, n = 10000)
|
fit |
an |
n |
number of simulations |
The simulations in a dataframe.
Samaradasa Weerahandi. Exact Statistical Methods for Data Analysis. Springer, New York, NY (1995). <doi:10.1007/978-1-4612-0825-9>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dat <- simAOV1R(I=20, J=5, mu=10, sigmab=1, sigmaw=1)
fit <- aov1r(y ~ group, data=dat)
nsims <- 20000
pivsims <- rGPQ(fit, nsims)
pivsims$GPQ_sigma2tot <- pivsims$GPQ_sigma2b + pivsims$GPQ_sigma2w
# Generalized confidence intervals:
lapply(pivsims, quantile, probs = c(0.025, 0.975))
# compare with the frequentist confidence intervals:
confint(fit, SDs = FALSE)
# Generalized prediction interval:
with(
pivsims,
quantile(rnorm(nsims, GPQ_mu, sqrt(GPQ_sigma2tot)),
probs = c(0.025, 0.975))
)
# compare with the frequentist prediction interval:
predict(fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.