simulateRandomInterceptSlopeModel: Simulate random-slope, random-intercept longitudinal data

Description Usage Arguments Examples

View source: R/cohortSimulation.R

Description

Simulate random-slope, random-intercept longitudinal data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simulateRandomInterceptSlopeModel(
  n_subjects,
  n_timepoints,
  intercept_mean,
  intercept_sd,
  slope_mean,
  slope_sd,
  epsilon,
  group = "",
  id_prefix = ""
)

Arguments

n_subjects

Number of subjects

n_timepoints

Number of timepoints

intercept_mean

Mean random intercept

intercept_sd

Standard deviation of random intercept

slope_mean

Mean random slope

slope_sd

Standard deviation of random slope

epsilon

Observation-level error

group

Character string defining group name

id_prefix

Character to append to ID variable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n_subjects <- 10
n_timepoints <- 4
intercept_mean <- 0
intercept_sd <- 0.01
slope_mean <- 0
slope_sd <- 0.01
epsilon <- 0.01
group <- "testgroup"
id_prefix <- "test"
simulateRandomInterceptSlopeModel(n_subjects, n_timepoints, intercept_mean, intercept_sd, slope_mean, slope_sd, epsilon, group, id_prefix)

kikapp/kikapputils documentation built on May 24, 2021, 10:41 p.m.