| OUTmethod | R Documentation |
The function OUTmethod is an internal function to estimate the potential outcomes given a specified model through formula.
It is built into function PSweight, and is used for constructing the augmented estimators.
OUTmethod(
out.formula = out.formula,
y = y,
out.method = "glm",
family = "gaussian",
datain = datain,
dataout = dataout,
out.control = list()
)
out.formula |
an object of class |
y |
a vector of the observed outcome in the training data ( |
out.method |
a character to specify the method for estimating the outcome regression model. |
family |
a description of the error distribution and link function to be used in the outcome model. Supported distributional families include
|
datain |
The training data for the outcome model. In the context of |
dataout |
The prediction data for the outcome model. In the context of |
out.control |
a list to specify additional options when |
A typical form for out.formula is y ~ terms where y is the outcome
variable and terms is a series of terms which specifies linear predictors (on the link function scale). out.formula by default specifies generalized
linear model given the gaussian error through the default arguments method = "glm" and family = "gaussian". It fits the logistic regression when family = "binomal",and poisson
regression when family = "poisson". The argument out.method allows user to choose
model other than glm to fit the outcome regression models for constructing the augmented estimator. We have included gbm and SuperLearner as alternative machine learning estimators.
Additional argument in them can be supplied through the ... argument. Please refer to the user manual of the gbm and SuperLearner packages for all the
allowed arguments.
m.esta vector of predicted outcome on the dataout.
gamma.hestimated coefficient of the outcome model when method = "glm".
#' the outcome model
out.formula <- Y~cov1+cov2+cov3+cov4+cov5+cov6
y <- psdata$Y
#train on model with treatment group 1
datain <- psdata[psdata$trt==1, ]
outfit <- OUTmethod(out.formula = out.formula, y=y, datain = datain, dataout = psdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.