predict.glmssn function calculates prediction values for prediction
sites based on the results stored within an object of class glmssn
the glmssn object
the prediction points ID
other arguments passed to predict
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
The overall structure is the same as an object of class
the prediction points data.frame in the SpatialStreamNetwork object (list-item 2) is appended by the
1 2 3
Details of this object structure can be found using the
Jay Ver Hoef support@SpatialStreamNetworks.com
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.