Skip to contents

Assessing the influece of each correlated block on both the precision of the parameter estimates (COVRATIO statistics) and the sensitivity of model predictions (PRESS statistics).

Usage

runInfluence(model, id = NULL, save = FALSE, dots = FALSE)

Arguments

model

Fitted model object (glm, gamMRSea or gam)

id

blocking structure

save

(default=FALSE). Logical stating whether plot should be saved into working directory.

dots

(default=FALSE). If TRUE, progress dots are printed.

Value

Two plots one each for COVRATIO and PRESS statistics, giving the influence of each block on precision of the parameter estimates and the sensitivity of model predictions. List object:

influenceData

List of blocks, COVRATIO statistics and PRESS statistics used for making the plot of PRESS and COVRATIO statistics.

influencePoints

Row id of blocks in influenceData that lie outside the 95% quantile of COVRATIO statistics and above the 95% quantile of PRESS statistics.

Details

Always run timeInfluenceCheck first to see how long it will take to produce the plots.

Examples

# load data
data(ns.data.re)

ns.data.re$blockid<-paste(ns.data.re$GridCode, ns.data.re$Year, ns.data.re$MonthOfYear, 
                    ns.data.re$DayOfMonth, sep='')
ns.data.re$blockid<-as.factor(ns.data.re$blockid)

model<-gamMRSea(birds ~ observationhour + as.factor(floodebb) + as.factor(impact),  
              family='poisson', data=ns.data.re)

timeInfluenceCheck(model, ns.data.re$blockid)
#> [1] "Calculating the influence measures will take approximately 20 minutes"

if (FALSE) {
# **WARNING** this example takes a long time
influences<-runInfluence(model, ns.data.re$blockid)
}