#### ExploreSpawML
# Exploratory spatially weighted multilevel with standard estimates of
# standard errors. Accepts only one contextual predictor. Predicting
# collective guilt acceptance. Contextual predictor weighted with
# geographical proximity weights, h=50,100,200.
# load individual level data, remove collective guilt assignment for the
# data frame, and remove NA's
data(traces_ind)
traces_ind <- traces_ind[,-7]
traces_ind <- na.exclude(traces_ind)
# load precise contextual indicator
data(homog_census)
# load distance matrix
data(d_geo)
# perform ExploreSpawML
acc_homog <- ExploreSpawML(individual.level.data=traces_ind,
contextual.name="Homog_00", contextual.data=NULL, context.id="area",
formula=cg_acc ~ victim_d + comb_d + male + age_1990 + high_school +
higher_edu + (1|area), precise.data=homog_census, distance.matrix=d_geo,
multilevel.bandwidths=c(50,100,200))Run the code above in your browser using DataLab