emee | R Documentation |
Returns the estimated causal excursion effect (on log relative risk scale) and the estimated standard error. Small sample correction using the "Hat" matrix in the variance estimate is implemented.
emee(
data,
id,
outcome,
treatment,
rand_prob,
moderator_formula,
control_formula,
availability = NULL,
numerator_prob = NULL,
start = NULL,
verbose = TRUE
)
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 ( |
start |
A vector of the initial value of the estimators used in the numerical
solver. If using default value ( |
verbose |
If default ('TRUE'), additional messages will be printed during data preprocessing. |
An object of type "emee_fit"
## estimating the fully marginal excursion effect by setting
## moderator_formula = ~ 1
emee(
data = data_binary,
id = "userid",
outcome = "Y",
treatment = "A",
rand_prob = "rand_prob",
moderator_formula = ~1,
control_formula = ~ time_var1 + time_var2,
availability = "avail"
)
## estimating the causal excursion effect moderated by time_var1
## by setting moderator_formula = ~ time_var1
emee(
data = data_binary,
id = "userid",
outcome = "Y",
treatment = "A",
rand_prob = "rand_prob",
moderator_formula = ~time_var1,
control_formula = ~ time_var1 + time_var2,
availability = "avail"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.