sim.data.cluster: Goodness-of fit test for LMM, function to simulate data

View source: R/functions_gofLMM.R

sim.data.clusterR Documentation

Goodness-of fit test for LMM, function to simulate data

Description

This function can be used to simulate (balanced) cluster data as used in the simulation study of Peterlin et al. See the paper for details.

Usage

sim.data.cluster(
  N,
  n,
  betas,
  norm.eps,
  var.eps = NULL,
  shape = NULL,
  scale = NULL,
  norm.re.intercept,
  var.re.intercept = NULL,
  shape.re.intercept = NULL,
  scale.re.intercept = NULL,
  sim.re.slope,
  norm.re.slope = NULL,
  var.re.slope = NULL,
  shape.re.slope = NULL,
  scale.re.slope = NULL,
  sim.x2.qdr = FALSE,
  b.qdr = NULL
)

Arguments

N

number of clusters

n

number of subjects per cluster (the same for all clusters)

betas

Vector of true regression coefficients for the fixed effects

norm.eps

Logical, if TRUE the errors are simulated from a (zero mean) normal distribution with variance var.eps, otherwise from a (centered) gama with parameters shape and scale

var.eps

see above

shape

see above

scale

see above

norm.re.intercept

Logical, if TRUE the random intercepts are simulated from a (zero mean) normal distribution with variance var.re.intercept, otherwise from a (centered) gama with parameters shape.re.intercept and scale.re.intercept

var.re.intercept

see above

shape.re.intercept

see above

scale.re.intercept

see above

sim.re.slope

Logical. If TRUE random slopes are simulated.

norm.re.slope

Logical, if TRUE the random slopes are simulated from a (zero mean) normal distribution with variance var.re.slope, otherwise from a (centered) gama with parameters shape.re.slope and scale.re.slope

var.re.slope

see above

shape.re.slope

see above

scale.re.slope

see above

sim.x2.qdr

Logical. If TRUE the square of X2 is included in the true (correct) fixed effects design matrix.

b.qdr

True beta coefficient associated with the square of X2

Author(s)

Rok Blagus, rok.blagus@mf.uni-lj.si

See Also

gof.lmm


rokblagus/gofLMM documentation built on April 4, 2022, 8:41 p.m.