Description Usage Arguments Value Examples
construct the 4k x 1 beta vector corresponding to treatment effect and slope coefficients per subphase
1 | beta_vector(X, y, Sigma)
|
X |
the (4k, N_i)-dimensional design matrix for case i. |
y |
the vector of N_i outcomes for case i |
Sigma |
the AR(1) covariance matrix |
a (4k, 1) vector of beta coefficients
1 2 3 4 5 6 | #assuming you've run >sim <- simulate_ABk(...)
design_1 <- design_matrix_ABk(sim$df[sim$df$case == 1, "treatment"], k = 2)
y_1 <- sim$df[sim$df$case == 1, "outcome"]
sigma_1 <- AR1_matrix(phi = 0.4, rho = 0.05, times = 1:14)
beta_vec <- beta_vector(design_1, y_1, sigma_1)
#NOTE: beta_vec is [intercept_1, intercept_2,...,intercept_k, slope_1, slope_2,...,slope_k], and should match corresp values in sim$betas
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.