simulateRandomInterceptModel: Simulate fixed-slope, random-intercept longitudinal data

Description Usage Arguments Examples

View source: R/cohortSimulation.R

Description

Simulate fixed-slope, random-intercept longitudinal data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simulateRandomInterceptModel(
  n_subjects,
  n_timepoints,
  intercept_mean,
  intercept_sd,
  slope,
  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

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
n_subjects <- 10
n_timepoints <- 4
intercept_mean <- 0
intercept_sd <- 0.01
slope <- -0.5
epsilon <- 0.01
group <- "testgroup"
id_prefix <- "test"
simulateRandomInterceptModel(n_subjects, n_timepoints, intercept_mean, intercept_sd, slope, epsilon, group, id_prefix)

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