| 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,
scale = NULL,
df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95,
type = c("response", "terms"),
block = FALSE,
local,
terms = NULL,
na.action = na.fail,
...
)
## S3 method for class 'ssn_glm'
predict(
object,
newdata,
type = c("link", "response", "terms"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
dispersion = NULL,
terms = NULL,
local,
var_correct = TRUE,
newdata_size,
na.action = na.fail,
...
)
object |
A fitted model object from |
newdata |
A character vector that indicates the name of the prediction data set
for which predictions are desired (accessible via |
se.fit |
A logical indicating if standard errors are returned.
The default is |
scale |
A numeric constant by which to scale the regular standard errors and intervals.
Similar to but slightly different than |
df |
Degrees of freedom to use for confidence or prediction intervals
(ignored if |
interval |
Type of interval calculation. The default is |
level |
Tolerance/confidence level. The default is |
type |
The scale ( |
block |
A logical indicating whether a block prediction over the entire
region in |
local |
A optional logical or list controlling the big data approximation. If omitted,
When |
terms |
If |
na.action |
Missing ( |
... |
Other arguments. Not used (needed for generic consistency). |
dispersion |
The dispersion of assumed when computing the prediction standard errors
for |
var_correct |
A logical indicating whether to return the corrected prediction
variances when predicting via models fit using |
newdata_size |
The |
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.