| vicc {vICC} | R Documentation | 
Varying Intraclass Correlation Coefficients
Description
Compute varying intraclass correlation coefficients with the method introduced in Williams et al. (2019).
Usage
vicc(
  y,
  group,
  type = "pick_group",
  iter = 5000,
  chains = 2,
  burnin = 500,
  prior_scale = 1,
  prior_prob = 0.5
)
Arguments
| y | Numeric vector. The outcome variable. | 
| group | Numeric vector. The grouping variable (e.g., subjects). Note that the groups
must be numbered from 1 to the total number of groups.
See  | 
| type | Character string. Which model should be fitted
(defaults to  | 
| iter | Numeric. The number of posterior samples per chain (excluding  | 
| chains | Numeric. The number of chains (defaults to  | 
| burnin | Numeric. The number of burnin samples, which are discarded
(defaults to  | 
| prior_scale | Numeric. The prior distribution scale parameter
(defaults to  | 
| prior_prob | Numeric. The prior inclusion probability (defaults to  | 
Value
An object of class vicc.
References
Williams DR, Martin SR, Rast P (2019). “Putting the Individual into Reliability: Bayesian Testing of Homogeneous Within-Person Variance in Hierarchical Models.” PsyArXiv.
Examples
# congruent trials
congruent <- subset(flanker, cond == 0)
# subset 25 from each group
dat <- congruent[unlist(tapply(1:nrow(congruent),
                            congruent$id,
                            head, 25)), ]
# fit model
fit <- vicc(y  = dat$rt,
            group = dat$id,
            iter = 250,
            burnin = 10,
            type =  "customary")