Description Usage Arguments Value Examples
This function analyzes a patient with time varying treatment. It analyzes the patient with several wash-in and wash-out effects and returns the best gamma and tau. It is implemented for 2 different treatments.
1 2 3 4 5 6 7 8 9 10 11 | estimate.gamma.tau(
data,
outcome,
exposure,
variables,
bound = 10,
symmetric = TRUE,
id = "id",
time_col = "day",
one.hot = FALSE
)
|
data |
a data frame holding treatment variables and outcome. |
outcome |
defines the outcome column |
exposure |
defines the exposure variable (level) |
bound |
maximum value for gamma and tau |
symmetric |
identifies if wash-in effect is equal to wash-out effect |
a vector with best gamma and tau.
1 2 3 4 5 6 7 8 9 10 11 | # Define Variables
outcome <- "Uncertain_Low_Back_Pain"
exposure <- "treatment"
variables <- c("Activity")
id <- "patient_id"
time_col <- "day"
# use the estimate.gamma.tau function to estimate the best gamma tau values
result <- estimate.gamma.tau(data = simpatdat, outcome = outcome, exposure = exposure, variables = variables, bound = 3, symmetric = TRUE, id=id, time_col = time_col)
# fit the adjusted linear model
fit.adj.lm(data = simpatdat, outcome = outcome, exposure = exposure, variables = variables, id = id, time_col = time_col, effects = result$best)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.