View source: R/RCTtoolbox-create.r
create_RCTtoolbox | R Documentation |
Create an R6 class object called "RCTtoolbox".
create_RCTtoolbox( baseline = NULL, covariate = NULL, data = NULL, treat_levels = NULL, treat_labels = treat_levels )
baseline |
two-sided formula with one or more outcome variables on LHS and one treatment variable on RHS. |
covariate |
(list of) one-sided formulas with covariates used in regression and balance test on RHS. |
data |
data.frame/tibble object you want to use. |
treat_levels |
character vector. Levels of experimental arms. The first element is control arm. |
treat_labels |
character vector.
Labels of experimental arms corresponding to |
R6 object with "RCTtoolbox" class. The returned object has following fields and methods
data
Field.
Store data.frame/tibble passed to data
argument.
You can access via $data
print()
Method.
Print information about the returned object.
Run $print()
ttest()
Method.
Implement two-sided t-test or permutation test.
Run $ttest()
.
See ttest for help.
power()
Method.
Implement power analysis.
Run $power()
.
See power for help.
balance()
Method.
Implement balance test.
Run $balance()
.
See balance for help.
lm()
Method.
Estimate linear model.
Run $lm()
.
See lm for help.
The created R6 object has also private fields. You cannot access from the outside. However, methods of RCTtoolbox use private fields. A list of private fields is as follows:
List of two-sided formula
outcome ~ treatment
.
If you pass y1 + y2 ~ d
to
the argument baseline
,
formula.yd
refers to
list(y1 ~ d, y2 ~ d)
.
Lists of one-sided formula
with covariates on RHS
which is passed to the argument covariate
.
Character vector of outcome variables.
Character vector of covariates.
Character of treatment.
Character vector
passed to the argument treat_levels
.
Character vector
passed to the argument treat_labels
.
## Not run: data(RubellaNudge) create_RCTtoolbox( baseline = itest + ivacc ~ treat, covariate = ~ age + educ, data = RubellaNudge, treat_levels = LETTERS[1:7] ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.