Learn R Programming

GibbsACOV (version 1.1)

GibbsACOV-package: Gibbs Sampler for One-Way Mixed-Effects ANOVA and ANCOVA Models

Description

Gibbs sampler for one-way linear mixed-effects models (ANOVA, ANCOVA) with homoscedasticity of errors and uniform priors.

Arguments

Details

Package:
GibbsACOV
Type:
Package
Version:
1.1
Date:
2013-05-05
License:
GPL (>= 2)
~~ An overview of how to use the package, including the most important functions ~~

References

Gelman, A and Rubin, DB (1992) Inference from iterative simulation using multiple sequences, Statistical Science, 7, 457-511.

Examples

Run this code
## Not run: 
# # ANCOVA with 2 continuous predictors and 5 factor levels
#   data(corn)
#   init1 <- c(rep(0,7), 1, 1)
#   init2 <- c(rnorm(7), rgamma(2,2,1))
#   init3 <- c(rnorm(7), rgamma(2,2,1))
#   init4 <- c(rnorm(7), rgamma(2,2,1))
#   initval <- rbind(init1, init2, init3, init4)
#   acovamcmc(corn$yield, corn$variety, cbind((corn$nitrogen)^2, corn$nitrogen), 4, 10000 , initval)
#   
# # ANOVA with grand mean parameterization and 12 factor levels
#   data(csection)
#   init1 <- c(rep(0,13), 1, 1)
#   init2 <- c(rnorm(13), rgamma(2,2,1))
#   init3 <- c(rnorm(13), rgamma(2,2,1))
#   init4 <- c(rnorm(13), rgamma(2,2,1))
#   initval <- rbind(init1, init2, init3, init4)
#   Y = log(csection$rate / (1-csection$rate))
#   acovamcmc(Y, factor(csection$hospital), matrix(1,length(csection$hospital),1), 4, 10000, initval)
# ## End(Not run)

Run the code above in your browser using DataLab