linearRegPredict
Compute Predictions for a Linear Model from Spotfire

Description

Computes predictions for a linear model from Spotfire using the data in newdata. This function is not intended to be called by the user.

Usage

linearRegPredict(modelObj, newdata, origPredNames, newPredNames)

Arguments

modelObj an object of class "lm".
newdata a data frame to use for the predictions. It must contain columns with names newPredNames.
origPredNames a single character string containing the predictor variables used in modelObj. The values must be tab delimited.
newPredNames a single character string naming the predictor variable in newdata. This is often the same as origPredNames. The values must be tab delimited.

Details

This function gets invoked when predictions for a linear regression model are requested in Spotfire.
Value
a data frame containing the predictions.
See Also
linearRegFit, linearRegEvaluate, lm
Examples
zlm <- linearRegFit(ozone ~ wind + temperature, data=Sdatasets::air,
    modelName="lmExample")
predNamesString <- zlm$fitSummaryTable[2, 1]
predNames <- strsplit(predNamesString, "\t", fixed=TRUE)[[1]]
ap <- Sdatasets::air[1:20, predNames]
zPred <- linearRegPredict(zlm$modelObj, newdata=ap,
    predNamesString, predNamesString)
Package SpotfireStats version 6.0.0-69
Package Index