Description Usage Arguments Value Author(s) References See Also Examples

The main function for estimating the average treatment effect or the average treatment effect on the treated. This function creates an `ATE`

object which can be used as inputs for generic S3 `plot`

or `summary`

functions. This function uses a covariate balancing method which creates weights for each subject, without a need to specific a propensity score or an outcome regression model. The main function depends on a Newton-Raphson algorithm with backtracking. For details of the estimator see Chan et al. (2015).

1 2 3 4 5 |

`Y` |
The response vector of length |

`Ti` |
The vector of treatment assignments of length |

`X` |
A |

`theta` |
A real scalar parameter for the Cressie-Read family of objective functions. The default is |

`ATT` |
A logical value indicating whether to estimate the treatment effect on the treated. |

`verbose` |
A logical value indicating whether to print the progress of the function. |

`max.iter` |
The maximum number of iterations for the Newton-Raphson methods. For most problems (e.g. with well-behaved functions |

`tol` |
The absolute tolerance used to determine a stopping criteria for the Newton-Raphson algorithm. |

`initial.values` |
A numeric vector or matrix of possible initial values for the Newton-Raphson algorithm. Must be a |

`backtrack` |
A logical value indicating whether to use backtracking in the Newton-Raphson algorithm. |

`backtrack.alpha` |
A scalar parameter for backtracking with |

`backtrack.beta` |
A scalar parameter for backtracking with |

`...` |
Additional arguments. |

The function reruns an object of type "ATE", a list with the following elements

`est` |
The vector of point estimates for the average treatment effect. For a binary treatment it also contains the average difference of treatment effects. |

`vcov` |
The estimated variance covariance matrix for the estimates of the treatment effects for each treatment group. |

`lam` |
The resulting solution of the main optimization problems, |

`weights` |
The weights obtained by the balancing covariate method for each treatment group. In the case of |

`gp` |
A string specifying the type of study design. For binary treatment effect with |

`conv` |
A logical value indicating convergence of Newton-Raphson algorithm. |

`X,Y, Ti` |
The data which was used for estimation. |

`rho, rho1, rho2` |
The Cressie-Read functions |

`FUNu` |
A function that append a vector of constants to the covariates. Required to make sure that the weights sum to 1 in each group. |

`J` |
A scalar indicating the number of treatment arms. |

`K` |
A scalar indicating the one plus the dimension of the range space of X. |

`call` |
The matched call. |

Asad Haris, Gary Chan.

Chan, K. C. G. and Yam, S. C. P. and Zhang, Z. (2015). "Globally Efficient Nonparametric Inference of Average Treatment Effects by Empirical Balancing Calibration Weighting", under revision.

Haris, Asad and Chan, K. C. G. (2015). "ATE: An `R`

package for Nonparametric Inference of Average Treatment Effects ", under revision

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ```
library(ATE)
#binary treatment
set.seed(25)
n <- 200
Z <- matrix(rnorm(4*n),ncol=4,nrow=n)
prop <- 1 / (1 + exp(Z[,1] - 0.5 * Z[,2] + 0.25*Z[,3] + 0.1 * Z[,4]))
treat <- rbinom(n, 1, prop)
Y <- 200 + 10*treat+ (1.5*treat-0.5)*(27.4*Z[,1] + 13.7*Z[,2] +
13.7*Z[,3] + 13.7*Z[,4]) + rnorm(n)
X <- cbind(exp(Z[,1])/2,Z[,2]/(1+exp(Z[,1])),
(Z[,1]*Z[,3]/25+0.6)^3,(Z[,2]+Z[,4]+20)^2)
#estimation of average treatment effects (ATE)
fit1<-ATE(Y,treat,X)
summary(fit1)
#plot(fit1)
#estimation of average treatment effects on treated (ATT)
fit2<-ATE(Y,treat,X,ATT=TRUE)
summary(fit2)
#plot(fit2)
#three treatment groups
set.seed(25)
n <- 200
Z <- matrix(rnorm(4*n),ncol=4,nrow=n)
prop1 <- 1 / (1 + exp(1+Z[,1] - 0.5 * Z[,2] + 0.25*Z[,3] + 0.1 * Z[,4]))
prop2 <- 1 / (1 + exp(Z[,1] - 0.5 * Z[,2] + 0.25*Z[,3] + 0.1 * Z[,4]))
U <-runif(n)
treat <- numeric(n)
treat[U>(1-prop2)]=2
treat[U<(1-prop2)& U>(prop2-prop1)]=1
Y <- 210 + 10*treat +(27.4*Z[,1] + 13.7*Z[,2] +
13.7*Z[,3] + 13.7*Z[,4]) + rnorm(n)
X <- cbind(exp(Z[,1])/2,Z[,2]/(1+exp(Z[,1])),
(Z[,1]*Z[,3]/25+0.6)^3,(Z[,2]+Z[,4]+20)^2)
fit3<-ATE(Y,treat,X)
summary(fit3)
#plot(fit3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.