wcls {MRTAnalysis} | R Documentation |
Estimates the causal excursion effect for continuous outcome MRT
Description
Returns the estimated causal excursion effect (on additive scale) and the estimated standard error. Small sample correction using the "Hat" matrix in the variance estimate is implemented.
Usage
wcls(
data,
id,
outcome,
treatment,
rand_prob,
moderator_formula,
control_formula,
availability = NULL,
numerator_prob = NULL,
verbose = TRUE
)
Arguments
data |
A data set in long format. |
id |
The subject id variable. |
outcome |
The outcome variable. |
treatment |
The binary treatment assignment variable. |
rand_prob |
The randomization probability variable. |
moderator_formula |
A formula for the moderator variables. This should
start with ~ followed by the moderator variables. When set to |
control_formula |
A formula for the control variables. This should
start with ~ followed by the control variables. When set to |
availability |
The availability variable. Use the default value ( |
numerator_prob |
Either a number between 0 and 1, or a variable name for
a column in data. If you are not sure what this is, use the default value ( |
verbose |
If default ('TRUE'), additional messages will be printed during data preprocessing. |
Value
An object of type "wcls_fit"
Examples
wcls(
data = data_mimicHeartSteps,
id = "userid",
outcome = "logstep_30min",
treatment = "intervention",
rand_prob = 0.6,
moderator_formula = ~1,
control_formula = ~logstep_pre30min,
availability = "avail",
numerator_prob = 0.6
)