predict.glmssn: Calculate Predictions for Prediction Sites

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/predict.glmssn.R

Description

The predict.glmssn function calculates prediction values for prediction sites based on the results stored within an object of class glmssn

Usage

1
2
## S3 method for class 'glmssn'
predict(object, predpointsID, ...)

Arguments

object

the glmssn object

predpointsID

the prediction points ID

...

other arguments passed to predict

Details

predict.glmssn is a generic function that has been modified for glmssn objects. Two new columns are added to the prediction points data.frame (point.data) within the existing glmssn object. The first column contains prediction values and has the same name as the response variable. The second column <response name>.predSE contains the standard errors for the predictions.

Value

The overall structure is the same as an object of class glmssn, except the prediction points data.frame in the SpatialStreamNetwork object (list-item 2) is appended by the following columns:

1
2
3
    <response name> # The prediction value for each prediction site
    <response name>.predSE # The standard error of the prediction value
  

Details of this object structure can be found using the names command.

Author(s)

Jay Ver Hoef support@SpatialStreamNetworks.com

See Also

glmssn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(SSN)

# get some model fits stored as data objects
data(modelFits)
#NOT RUN use this one
#fitSp <- glmssn(Summer_mn ~ ELEV_DEM + netID,
#    ssn.object = mf04p, EstMeth = "REML", family = "Gaussian",
#    CorModels = c("Exponential.tailup","Exponential.taildown",
#    "Exponential.Euclid"), addfunccol = "afvArea")
#for examples only, make sure fitSp has the correct path
#if you use importSSN(), path will be correct
fitSp$ssn.object <- updatePath(fitSp$ssn.object, 
	paste0(tempdir(),'/MiddleFork04.ssn'))

ssnpred <- predict(fitSp, predpointsID = "pred1km")
names(ssnpred)
names(ssnpred$ssn.object) ## Note additional predicted columns in pred1km
plot(ssnpred)

SSN documentation built on March 13, 2020, 1:49 a.m.