# NOT RUN {
data(LaLonde)
y <- LaLonde$outcome
trt <- LaLonde$treat
x.varnames <- c("age", "educ", "black", "hisp", "white",
"marr", "nodegr", "log.re75", "u75")
# covariates
data.x <- LaLonde[, x.varnames]
# construct design matrix (with no intercept)
x <- model.matrix(~ -1 + ., data = data.x)
const.propens <- function(x, trt)
{
mean.trt <- mean(trt == "Trt")
rep(mean.trt, length(trt))
}
subgrp_fit_w <- fit.subgroup(x = x, y = y, trt = trt,
loss = "logistic_loss_lasso",
propensity.func = const.propens,
cutpoint = 0,
type.measure = "auc",
nfolds = 10)
summary(subgrp_fit_w)
# }
Run the code above in your browser using DataLab