Description Usage Arguments Value Examples
Simulates data from an $AB^k$ study; user has option to simulate obvervational data when a matrix of beta coefficients has been supplied.
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)
|
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 |
data.frame with case, time, treatment, phase, and outcome columns
1 | sim_df <- simulate_ABk(m = 6, n = 12, k = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.