| data.preproc {precmed} | R Documentation |
Data preprocessing
Apply at the beginning of pmcount() and cvcount(), after arg.checks()
Description
Data preprocessing
Apply at the beginning of pmcount() and cvcount(), after arg.checks()
Usage
data.preproc(
fun,
cate.model,
ps.model,
data,
prop.cutoff = NULL,
prop.multi = NULL,
ps.method,
initial.predictor.method = NULL
)
Arguments
fun |
A function for which argument check is needed; "pm" for |
cate.model |
A formula describing the outcome model to be fitted. The outcome must appear on the left-hand side. |
ps.model |
A formula describing the propensity score model to be fitted.
The treatment must appear on the left-hand side. The treatment must be a numeric vector
coded as 0/1. If data are from a RCT, specify |
data |
A data frame containing the variables in the outcome and propensity score models;
a data frame with |
prop.cutoff |
A vector of numerical values (in (0, 1]) specifying percentiles of the
estimated log CATE scores to define nested subgroups. Each element represents the cutoff to
separate observations in nested subgroups (below vs above cutoff).
The length of |
prop.multi |
A vector of numerical values (in [0, 1]) specifying percentiles of the
estimated log CATE scores to define mutually exclusive subgroups.
It should start with 0, end with 1, and be of |
ps.method |
A character value for the method to estimate the propensity score.
Allowed values include one of:
|
initial.predictor.method |
A character vector for the method used to get initial
outcome predictions conditional on the covariates. Only applies when |
Value
A list of 6 elements:
- y: outcome; vector of length n (observations)
- trt: binary treatment; vector of length n
- x.ps: matrix of p.ps baseline covariates (plus intercept); dimension n by p.ps + 1
- x.cate: matrix of p.cate baseline covariates; dimension n by p.cate
- time: offset; vector of length n
- if fun = "pm":
- prop: formatted prop.cutoff
- if fun = "cv"
- prop.onlyhigh: formatted prop.cutoff with 0 removed if applicable
- prop.bi; formatted prop.cutoff with 0 and 1 removed if applicable
- prop.multi: formatted prop.multi, starting with 0 and ending with 1