Description Usage Arguments Value Author(s) References Examples
This step-3 function performs multilevel analyses with spatially weighted context data based on aggregate survey estimates. The context data created in step 2 are combined with additional individual outcome and (optional) predictor variables, to test a user-defined model. An ad hoc stratified bootstrap resampling procedure generates robust point estimates for regression coefficients and model fit indicators, and computes confidence intervals adjusted for measurement dependency and measurement error of the aggregate estimates. For each tested model, contextual residuals can be stored for later re-use.
1 2 3 4 5 6 7 8 9 |
individual.level.data |
A |
context.id |
The name of the context ID variable. This variable allows matching
contextual units from different data sets ( |
formula |
Formula description of the model.The formula is handed down to |
aggregates |
A |
precise.data |
A |
confidence.intervals |
|
individual.sample.seed |
Seed used to generate the random sampling of the individual data Is one of three things
Defaults to |
verbose |
if |
... |
All additional named arguments are handed through to the function
|
An object of class SpawAggregateOutput-class
.
Till Junge, Sandra Penic, Guy Elcheroth
Elcheroth, G., Penic, S., Fasel, R., Giudici, F., Glaeser, S., Joye, D., Le Goff, J.-M., Morselli, D., & Spini, D. (2012). Spatially weighted context data: a new approach for modelling the impact of collective experiences. LIVES Working Papers, 19.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ## Spatially weighted multilevel analysis, with resampled both individual
## level indicators and contextual predictors for aggregation. It may
## include non-resampled precise contextual indicator.
## It is step-3 function
## Predicting collective guilt acceptance.
## Data preparation
## load individual level data, remove collective guilt assignment from the
## data frame, and remove NA's
data(traces_ind)
traces_ind <- traces_ind[,-7]
traces_ind <- na.exclude(traces_ind)
## load contextual indicator for aggregation
data(traces_event)
## load precise contextual indicator
data(homog_census)
## load distance matrix
data(d_geo)
## Step 1: Create spatial weights
geow.100 <- WeightMatrix(d_geo, bandwidth=100)
## Step 2: Create spatially weighted aggregated and precise indicators
wv.agg.100 <- SpawAggregate(
contextual.data = traces_event,
context.id="area.name",
contextual.names = "w_all",
contextual.weight.matrices=geow.100,
nb.resamples=5,
aggregation.functions="weighted.mean",
design.weight.names="weight",
sample.seed=1)
homog.100 <- SpawExact(precise.data=homog_census,
context.id="area.name",
contextual.names="Homog_00",
contextual.weight.matrices=geow.100)
## rename weighted variable names so they reflect the used weighting
## matrix
names(wv.agg.100) <- "w_all.100"
names(homog.100)[2] <- "Homog.100"
## Step 3: Perform ResampleMLSpawAggregate
acc_w_homog_100 <-
ResampleMLSpawAggregate(
individual.level.data=traces_ind,
context.id="area.name",
formula=cg_acc ~ victim_d + comb_d + male + age_1990 + high_school +
higher_edu + (1|area.name) + w_all.100 + Homog.100,
aggregates=wv.agg.100,
precise.data=homog.100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.