abso_diff_est function

Estimate the Gini's mean difference/mean absolute difference(MAD) for a Given Treatment Regime

Estimate the Gini's mean difference/mean absolute difference(MAD) for a Given Treatment Regime

Estimate the MAD if the entire population follows a treatment regime indexed by the given parameters. This function supports the IPWE_MADopt function.

abso_diff_est(beta, x, y, a, prob, Cnobs)

Arguments

  • beta: a vector indexing the treatment regime. It indexes a linear treatment regime:
d(x)=I{β0+β1x1+...+βkxk>0}.d(x)=Iβ0+β1x1+...+βkxk>0. d(x)= I\{\beta_0 + \beta_1 x_1 + ... + \beta_k x_k > 0\}.d(x)= I{\beta_0 + \beta_1*x_1 + ... + \beta_k*x_k > 0}.
  • x: a matrix of observed covariates from the sample. Notice that we assumed the class of treatment regimes is linear. This is important that columns in x matches with beta.
  • y: a vector, the observed responses from a sample
  • a: a vector of 0s and 1s, the observed treatments from a sample
  • prob: a vector, the propensity scores of getting treatment 1 in the samples
  • Cnobs: A matrix with two columns, enumerating all possible combinations of pairs of indexes. This can be generated by combn(1:n, 2), where n is the number of unique observations.

Examples

library(stats) GenerateData.MAD <- function(n) { x1 <- runif(n) x2 <- runif(n) tp <- exp(-1+1*(x1+x2))/(1+exp(-1+1*(x1+x2))) a<-rbinom(n = n, size = 1, prob=tp) error <- rnorm(length(x1)) y <- (1 + a*0.3*(-1+x1+x2<0) + a*-0.3*(-1+x1+x2>0)) * error return(data.frame(x1=x1,x2=x2,a=a,y=y)) } n <- 500 testData <- GenerateData.MAD(n) logistic.model.tx <- glm(formula = a~x1+x2, data = testData, family=binomial) ph <- as.vector(logistic.model.tx$fit) Cnobs <- combn(1:n, 2) abso_diff_est(beta=c(1,2,-1), x=model.matrix(a~x1+x2, testData), y=testData$y, a=testData$a, prob=ph, Cnobs = Cnobs)

References

Rdpack::insert_ref(key="wang2017quantile",package="quantoptr")

See Also

The function IPWE_MADopt is based on this function.

  • Maintainer: Yu Zhou
  • License: GPL (>= 2)
  • Last published: 2018-02-05

Useful links