OUTmethod {PSweight}R Documentation

Fitting potential outcome regression with different methods

Description

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.

Usage

OUTmethod(
  out.formula = out.formula,
  y = y,
  out.method = "glm",
  family = "gaussian",
  datain = datain,
  dataout = dataout,
  out.control = list()
)

Arguments

out.formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the outcome model to be fitted.

y

a vector of the observed outcome in the training data (datain).

out.method

a character to specify the method for estimating the outcome regression model. "glm" is default, and "gbm" and "SuperLearner" are also allowed.

family

a description of the error distribution and link function to be used in the outcome model. Supported distributional families include "gaussian" (link = identity), "binomial" (link = logit) and "poisson" (link = log). Default is "gaussian".

datain

The training data for the outcome model. In the context of PSweight, it refers to the data observed for each treatment group.

dataout

The prediction data for the outcome model. In the context of PSweight, it refers to the full data.

out.control

a list to specify additional options when out.method is set to "gbm" or "SuperLearner".

Details

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.

Value

m.est

a vector of predicted outcome on the dataout.

gamma.h

estimated coefficient of the outcome model when method = "glm".

Examples


#' 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)


[Package PSweight version 1.2.0 Index]