ss_ranef_beta: ss_ranef_beta

View source: R/ss_ranef.R

ss_ranef_betaR Documentation

ss_ranef_beta

Description

ss_ranef_beta() fits a mixed-effects model with random intercepts and random slopes, with a spike-and-slab prior on the random slopes.

Usage

ss_ranef_beta(
  y,
  X,
  unit,
  burnin = 1000,
  iter = 1000,
  chains = 4,
  priors = NULL,
  vars2monitor = c("alpha", "beta", "gamma", "rho", "sigma", "tau1", "tau2", "theta1",
    "theta2")
)

Arguments

y

A vector containing the outcome

X

A vector containing the predictor

unit

A vector of the same length as y containing a unique identifier

burnin

The number of iterations to use as burnin. Defaults to 1000.

iter

The number of iterations to use for estimating the parameters. Defaults to 1000.

chains

The number of MCMC chains to use. Defaults to 4.

priors

A named list to specify priors. Defaults to NULL. See README for details.

vars2monitor

A vector containing the names of which parameters to monitor. See details below.

Details

The parameters that can be tracked are:

  • alpha: The fixed effect for the intercept

  • beta: The fixed effect for the slope

  • gamma: The inclusion indicators for the slope random effects

  • rho: The correlation between theta1 and theta2

  • sigma: The residual standard deviation

  • tau1: The standard deviation for alpha

  • tau2: The standard deviation for beta

  • theta1: The random effects for alpha

  • theta2: The random effects for beta

Value

An object of type ssranef.


josue-rodriguez/SSranef documentation built on March 23, 2022, 3:27 p.m.