predict.move.1: Predict Maintenance of Variance Extension, Type 1

View source: R/predict.move.1.R

predict.move.1R Documentation

Predict Maintenance of Variance Extension, Type 1

Description

Predicts new values from a maintenance of variance extension, type 1 (MOVE.1) model fit.

Usage

## S3 method for class 'move.1'
predict(object, newdata, type = c("response", "link"),
  var.fit = FALSE, ...)

Arguments

object

an object of class "move.1" on which to base the predicted values.

newdata

an optional data.frame in which to look for variables with which to predict. If omitted, then the fitted values are used.

type

the type of prediction ("response" or "link"). See Details.

var.fit

logical if TRUE, then compute the variance of the predicted values. If FALSE, then the varainces are not computed.

...

not used, required for method function.

Details

If type is "response," then the predicted values are back-transformed. Otherwise, the predicted values are computed directly from the model equation.

Value

If var.fit is FALSE, then a vector of predictions matching newdata or the model data. If var.fit is TRUE, then a data frame containing the columns:

fit

the predicted values

var.fit

the variance of the predicted values

References

Lorenz, D.L., 2015, smwrStats-an R package for analyzing hydrologic data, version 0.7.0: U.S. Geological Survey Open-File Report 2015-XXXX, XX p.

See Also

move.1, jackknifeMove.1

Examples

library(smwrData)
data(IonBalance)
# Build model for non missing Alkalinity
IB.move <- move.1(Anion_sum ~ Cation_sum, data=IonBalance, subset=abs(Pct_Diff) < 10)
print(IB.move)
# Predict Anion_sum for missing Alkalinity
predict(IB.move, IonBalance[1, ])

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.