Description Usage Arguments Details Value Author(s) References Examples
These exploratory functions provide fast-track procedures, which condense steps 1 to 3. On the basis of precise contextual measures and/or micro-level survey data for estimating contextual indicators, a distance matrix between contextual units, and individual outcomes and (optional) predictor variables, it directly generates point estimates for regression coefficients of a user-defined multilevel model, for a range of different bandwidth values. This function can be used to first explore the scale of relevant contextual effects, before parametrising the model more precisely, calculating (computationally expensive) confidence intervals and estimating spatial dependency for specific models, on a step-by-step basis.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ExploreMLSpawExact(individual.level.data,
contextual.name,
context.id,
formula,
distance.matrix,
multilevel.bandwidths,
precise.data,
kernel = NULL,
verbose = TRUE)
ExploreMLSpawAggregate(individual.level.data,
contextual.name,
contextual.data,
context.id, formula,
distance.matrix,
multilevel.bandwidths,
design.weight.names = NULL,
aggregation.function = "weighted.mean",
kernel = NULL,
additional.args = NULL,
verbose = TRUE)
|
individual.level.data |
A |
contextual.name |
A name of contextual variable to be weighted. |
contextual.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 |
distance.matrix |
A square matrix of dimension n by n, where n is the number of contextual units. |
multilevel.bandwidths |
A |
precise.data |
A |
design.weight.names |
A name of optional design weight at the individual level
used for aggregation (for example, for a weighted mean). By default set to |
aggregation.function |
A name of aggregation function. Function takes either
|
kernel |
A function applied to the distance matrix. By default w_ij = f(d, h) = (1/2)^((d_ij/h)^2) is used, where w_ij, d_ij, h are elements of the weight matrix W, of the distance matrix D and the bandwidth h. User-supplied kernel functions have to take 2 arguments and return a matrix of the same dimension as the first argument. |
additional.args |
For aggregation functions which take additional arguments (that is in
addition to the data to aggregate and design weights), they can be
specified here.
|
verbose |
if |
ExploreMLSpawExact
performs exploratory multilevel analysis with a precise
spatially weighted contextual indicator. ExploreMLSpawAggregate
performs analysis
with an aggregated spatially weighted contextual indicator. Both functions provide only
conventional statistical estimates and accept only one contextual predictor.
A list
of
MLSpawExactOutput-class
objects
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 | #### ExploreMLSpaw
# Exploratory spatially weighted multilevel with standard estimates of
# standard errors. Accepts only one contextual predictor. Predicting
# collective guilt acceptance. Precise contextual predictor (ethnic homogeneity)
# weighted with geographical proximity weights, h=50,100,200.
# 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 precise contextual indicator
data(homog_census)
# load distance matrix
data(d_geo)
# perform ExploreMLSpawExact
acc_homog <- ExploreMLSpawExact(
individual.level.data=traces_ind,
contextual.name="Homog_00",
context.id="area.name",
formula=cg_acc ~ victim_d + comb_d + male + age_1990 + high_school +
higher_edu + (1|area.name),
precise.data=homog_census,
distance.matrix=d_geo,
multilevel.bandwidths=c(50, 100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.