estimate.gamma.tau: Estimate Gamma and Tau

Description Usage Arguments Value Examples

View source: R/adjtreat.R

Description

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.

Usage

 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
)

Arguments

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

Value

a vector with best gamma and tau.

Examples

 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)

thogaertner/cinof1 documentation built on Jan. 8, 2022, 10:37 a.m.