c_vector: c_vector

Description Usage Arguments Value Examples

Description

construct c vector containing multipliers and midpoints for multiplying with beta matrix. user should make one of these per case.

Usage

1
c_vector(trt_vec, k, x_is = NULL, treatment_name = "TREATMENT")

Arguments

trt_vec

character vector indicating sub-phase of a particular case, e.g. c("BASELINE", "BASELINE", "TREATMENT", "TREATMENT")

k

number of complete sub-phase cycles, as in (AB)^k

x_is

(2k-1)x1 vector of times at which we evaluate the treatment effect, perhaps subphase introduction times or midpoints of subphases.

treatment_name

string indicating name of the treatment sub-phase as recorded in df.

Value

vector of -1's, 1's, and f(midpoints)

Examples

1
c_1 <- c_vector(sim_df[sim_df$case == 1, "treatment"], k = 2)

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