# loglik: The non-calibrated objective function ("log-likelihood") In iWeigReg: Improved methods for causal inference and missing data problems

## Description

This function computes the objective function, its gradient and its Hessian matrix for the non-calibrated likelihood estimator in Tan (2006), JASA.

## Usage

 `1` ```loglik(lam, tr, h) ```

## Arguments

 `lam` A vector of parameters ("lambda"). `tr` A vector of non-missing or treatment indicators. `h` A constraint matrix.

## Value

 `value` The value of the objective function. `gradient` The gradient of the objective function. `hessian` The Hessian matrix of objective function.

## References

Tan, Z. (2006) "A distributional approach for causal inference using propensity scores," Journal of the American Statistical Association, 101, 1619-1637.

Tan, Z. (2010) "Bounded, efficient and doubly robust estimation with inverse weighting," Biometrika, 97, 661-682.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22``` ```data(KS.data) attach(KS.data) z=cbind(z1,z2,z3,z4) x=cbind(x1,x2,x3,x4) #logistic propensity score model, correct ppi.glm <- glm(tr~z, family=binomial(link=logit)) p <- ppi.glm\$fitted #outcome regression model, misspecified y.fam <- gaussian(link=identity) eta1.glm <- glm(y ~ x, subset=tr==1, family=y.fam, control=glm.control(maxit=1000)) eta1.hat <- predict.glm(eta1.glm, newdata=data.frame(x=x), type="response") # g1 <- cbind(1,eta1.hat) h <- cbind(p, (1-p)*g1) loglik(lam=rep(0,dim(h)[2]-1), tr=tr, h=h) ```

iWeigReg documentation built on May 29, 2017, 1:08 p.m.