Usage
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)
Arguments
individual.level.data
A data.frame containing the individual level predictor and outcome variables.
The data must be numeric (logical, integer, or plain
numeric). There must not be any missing values, NaNs
contextual.name
A name of contextual variable to be weighted.
contextual.data
A data.frame consisting of micro-level data to generate contextual
indicators by aggregation and containing a column named context.id
with the context ID variable. This is an individual level dataframe.
The data must
context.id
The name of the context ID variable. This variable allows matching
contextual units from different data sets (contextual.data,
individual.level.data, distance.matrix). Values can by of
any type but need to be d
formula
Formula description of the model.The formula is handed down to lmer function of
the package lme4. Refer to the documentation of lmer for details.
distance.matrix
A square matrix of dimension $n\times n$, where $n$ is the number of
contextual units.
multilevel.bandwidths
A vector of scalar numeric values specifying the bandwidth $h$
precise.data
A data.frame containing the precise contextual data.There must
not be any missing values, NaNs, NULLs or NAs.
By default set to NULL.
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 NULL.
aggregation.function
A name of aggregation function. Function takes either
- 1 argument in which case the corresponding individual design
weight is
NULL, - 2 arguments in which case the second argument is taken
from the corresponding individu
kernel
A function applied to the distance matrix. By default NULL, in which
case the kernel function $$w_{ij}=f(d,h) =
\left(\frac{1}{2}\right)^{d_{ij}^2/h^2}$$ is used, where $w_{ij}, d_{ij}, h$ are elements of the weight matrix $\mathbf{
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.
additional.args defaults to NULL
verbose
if TRUE, progress information and an estimate of the remaining
computing time is shown at the screen. Defaults to TRUE