predict.SSN2 | R Documentation |
Predicted values and intervals based on a fitted model object.
## S3 method for class 'ssn_lm'
predict(
object,
newdata,
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
block = FALSE,
...
)
## S3 method for class 'ssn_glm'
predict(
object,
newdata,
type = c("link", "response"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
newdata_size,
level = 0.95,
var_correct = TRUE,
...
)
object |
A fitted model object from |
newdata |
A character vector that indicates the name of the prediction data set
in the SSN object for which predictions are desired. If omitted, predictions
for all prediction data sets are returned. Note that the name |
se.fit |
A logical indicating if standard errors are returned.
The default is |
interval |
Type of interval calculation. The default is |
level |
Tolerance/confidence level. The default is |
block |
A logical indicating whether a block prediction over the entire
region in |
... |
Other arguments. Not used (needed for generic consistency). |
type |
The scale ( |
newdata_size |
The |
var_correct |
A logical indicating whether to return the corrected prediction
variances when predicting via models fit using |
The (empirical) best linear unbiased predictions (i.e., Kriging
predictions) at each site are returned when interval
is "none"
or "prediction"
alongside standard errors. Prediction intervals
are also returned if interval
is "prediction"
. When
interval
is "confidence"
, the estimated mean is returned
alongside standard errors and confidence intervals for the mean.
If se.fit
is FALSE
, predict.ssn()
returns
a vector of predictions or a matrix of predictions with column names
fit
, lwr
, and upr
if interval
is "confidence"
or "prediction"
. If se.fit
is TRUE
, a list with the following components is returned:
fit
: vector or matrix as above
se.fit:
standard error of each fit
# Copy the mf04p .ssn data to a local directory and read it into R
# When modeling with your .ssn object, you will load it using the relevant
# path to the .ssn data on your machine
copy_lsn_to_temp()
temp_path <- paste0(tempdir(), "/MiddleFork04.ssn")
mf04p <- ssn_import(temp_path, predpts = "pred1km", overwrite = TRUE)
ssn_mod <- ssn_lm(
formula = Summer_mn ~ ELEV_DEM,
ssn.object = mf04p,
tailup_type = "exponential",
additive = "afvArea"
)
predict(ssn_mod, "pred1km")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.