if (FALSE) {
require(devtools) # load devtools package
install_github("szonszein/interference") # install interference package
library(interference) # load interference package
data(india) # load data
attach(india) # attach data
india=na.omit(india) # drop observations with missings
group=india$village_id # cluster id
group_tr=india$mech # indicator high treatment proportion
indiv_tr=india$treat # individual treatment (insurance)
obs_outcome=india$EXPhosp_1 # outcome (hospital expenditure)
dat=data.frame(group,group_tr,indiv_tr,obs_outcome) # generate data frame
estimates_hierarchical(dat)} # run estimation
Run the code above in your browser using DataLab