altCausal: Alternative Causal Effect estimation methods.

altCausalR Documentation

Alternative Causal Effect estimation methods.

Description

This documentation file presents a collection of popular methods used to estimate the average causal effect, the causal effect on the treated and the causal effect on the nontreated.

Usage


matching(form,  balm, data, type=c("ACE","ACT","ACN"), M=4,
         psForm=NULL, bcForm=NULL, vJ=4)

LLmatching(form, psForm, data, type=c("ACE","ACT","ACN"),
           kern=c("Gaussian","Epanechnikov"),tol=1e-4,
           h=NULL, from=.00001, to=5, ngrid=10, maxit=100,
           hMethod=c("Brent","Grid"))

ipw(form, psForm, data, type=c("ACE","ACT","ACN"),
    normalized=FALSE, tolPS=0, ...)

Arguments

form

A formula that links the outcome variable to the treatment indicator. For the moment, only one treatment group is allowed.

balm

A formula or a matrix with balancing covariates to be matched.

data

A data.frame or a matrix with column names.

type

The type of causal effect to compute. ACE stands for average causal effect, ACT for causal effect on the treated and ACN for causal effect on the control or nontreated.

M

The minimum number of matches

psForm

It is the formula argument passed to glm to estimate the propensity scores by a logistic regression.

bcForm

A formula that represents the right hand side in the regression used for the bias correction.

kern

The type of kernel to use in the local linear regression method.

tol

The tolerance level for the stopping rule used to compute the optimal bandwidth.

tolPS

Observations for which the propensity scores are not between tolPS and (1-tolPS) are removed. It is meant to satisfy the assumption that the propensity score is bounded away from, 0 and 1. The default is 0, in which case observations with negative or greater than 1 propensity scores are dropped.

h

A fixed bandwidth. By default, the optimal bandwidth is found by minimizing a cross-validation.

from

The lower bound for the search of the optimal bandwidth.

to

The upper bound for the search of the optimal bandwidth.

ngrid

The number of grid points if the optimal bandwidth is obtained by grid search.

maxit

The maximum number of iterations for the minimization of the cross-validation.

hMethod

The method used to find the optimal bandwidth.

normalized

Should the weights be normalized. If set to GPE, the GPE method is used.

vJ

The minimum number of matches for the standard error estimation

...

Additional arguments to pass to optim when the GPE method is used.

Value

All methods return an object of classes "causalfit". It is a list with the following elements:

estim

The causal effect estimate.

se

The standard error estimate of the causal effect.

type

The type of causal effect. It is the value of the argument type.

method

A description of the method.

form

A list of formulas used for the estimation.

details

A more detailed description of the method.

info

Convergence information if relevant.

Examples

data(simDat3)

balm <-  ~ X1 * X2
g <- Y ~ Z
ps <- Z~X1*X2

## A print and summary methods exist for this class
           
fit1 <- matching(form=g, balm=balm, data=simDat3, type="ACE", bcForm=balm)
fit1

fit2 <- LLmatching(form=g, psForm=ps, data=simDat3, type="ACE")
fit2

fit3 <- ipw(form=g, psForm=ps, data=simDat3, type="ACE", normalized=TRUE)
fit3

## A print and summary methods exist for this class

summary(fit1)


causalSLSE documentation built on Aug. 28, 2025, 3 a.m.