Learn R Programming

spacom (version 1.0-5)

MLSpawExactOutput-class: Class "MLSpawExactOutput"

Description

Output object of the function MLSpawExact.

Arguments

Objects from the Class

Objects can be created by calls of the form new("MLSpawExactOutput", ...).

Slots

lme:
Object of class "merMod"
beta:
Object of class "numeric"

Methods

AIC
signature(object = "MLSpawExactOutput"): merMod of lme4
BIC
signature(object = "MLSpawExactOutput"): merMod of lme4
fixef
signature(object = "MLSpawExactOutput"): merMod of lme4
print
signature(x = "MLSpawExactOutput")
ranef
signature(object = "MLSpawExactOutput"): merMod of lme4
show
signature(object = "MLSpawExactOutput")
summary
signature(object = "MLSpawExactOutput")
VarCorr
signature(x = "MLSpawExactOutput"): merMod of lme4

Examples

Run this code
## Perform MLSpawExact

## Import and prepare data (see details in MLSpawExact)

data(traces_ind)
traces_ind <- traces_ind[,-7]
traces_ind <- na.exclude(traces_ind)
data(traces_event)

data(homog_census)
data(d_geo)

## Step 1: Create spatial weights
geow.100 <- WeightMatrix(d_geo, bandwidth=100)

## Step 2: Create spatially weighted contextual indicators
aggregate <- SpawAggregate(contextual.data=traces_event,
                           context.id="area.name",
                           contextual.names='w_all',
                           contextual.weight.matrices=geow.100,
                           aggregation.functions="weighted.mean",
                           design.weight.names="weight",
                           nb.resamples=0)

## Step 3: Perform MLSpawExact with the spatially weighted indicator
acc_w100 <- MLSpawExact(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.1,
              			precise.data=aggregate)
              			
## acc_w100 is an object of class MLSpawExactOutput              			
class(acc_w100)

## to assess standardized coefficients
acc_w100@beta

## look at the fitted mixed-effect model :
acc_w100@lme 
## to assess non-standardized fixed coefficients
fixef(acc_w100@lme)

## to assess the deviance of the fitted model
deviance(acc_w100@lme)

## for details about slots within @lme see   ?merMod-class{lme4}

Run the code above in your browser using DataLab