beta_vector: beta_vector

Description Usage Arguments Value Examples

Description

construct the 4k x 1 beta vector corresponding to treatment effect and slope coefficients per subphase

Usage

1
beta_vector(X, y, Sigma)

Arguments

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

Value

a (4k, 1) vector of beta coefficients

Examples

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

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