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 change_group.

type

Character string. Which model should be fitted (defaults to pick_group)? The options are described in Details.

iter

Numeric. The number of posterior samples per chain (excluding burnin).

chains

Numeric. The number of chains (defaults to 2).

burnin

Numeric. The number of burnin samples, which are discarded (defaults to 500).

prior_scale

Numeric. The prior distribution scale parameter (defaults to 1). Note the prior is a half student-t distribution with 10 degrees of freedom.

prior_prob

Numeric. The prior inclusion probability (defaults to 0.5). This is used for type = "pick_tau" or type = "pick_group" and ignored otherwise.

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")


[Package vICC version 1.0.0 Index]