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

Description Details Author(s) References Examples

Description

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

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 ~~

Author(s)

Emily Goren and Quan Zhang

Maintainer: Emily Goren <emily.goren@gmail.com>

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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)

GibbsACOV documentation built on May 2, 2019, 12:36 p.m.