Open andybega opened 6 years ago
Like:
library(CBPS) library(data.table) library(spduration) data("bscoup") dt <- data.table(bscoup) dt <- dt[complete.cases(dt)] # get weights by matching on treatment : recentcoups fit <- CBPS(recentcoups ~ milreg + instab, data = dt,method = "exact") dt[,coup := as.numeric(coup)-1] # estimate hazard with with weights model<- glm(coup ~ instab + recentcoups + wealth, weights = fitted(fit),data=dt,family=quasibinomial(link="cloglog"))
(see Jeroen van den Ochtend email from back in September 2018)
Like: