simulate_ABk: simulate_ABk

Description Usage Arguments Value Examples

Description

Simulates data from an $AB^k$ study; user has option to simulate obvervational data when a matrix of beta coefficients has been supplied.

Usage

1
2
simulate_ABk(m = 6, n = 12, k = 1, min_Ni = NULL, outcome = FALSE,
  beta_matrix = NULL, phi = 0.2, sigma = 1, tau = 1)

Arguments

m

number of cases

n

maximum number of observations in a case

k

number of phases, i.e. complete AB cycles. There are 2k sub-phases.

min_Ni

minimum allowable number of time observations in a case.

outcome

Boolean, does user want simulated outcome data?

beta_matrix

m x 4k matrix with linear beta coefficients

phi

the autocorrelation coefficient

sigma

within-case variance

tau

between-case variance

Value

data.frame with case, time, treatment, phase, and outcome columns

Examples

1
sim_df <- simulate_ABk(m = 6, n = 12, k = 2)

fineiskid/scdlintrend documentation built on May 16, 2019, 12:53 p.m.