predAntilognorm: Unbiased Prediction of Natural Log Transformed Response on...

View source: R/predAntilognorm.R

predAntilognormR Documentation

Unbiased Prediction of Natural Log Transformed Response on Original Scale

Description

Provide unbiased estimates on the original scale from a linear model with a natural log-transformed response.

Usage

predAntilognorm(modfit, xdata, k = 0)

Arguments

modfit

A fitted model object from a call to lm, aov, or glm.

xdata

A data frame with predictor variables corresponding to those in modfit for which predictions should be made.

k

A numeric scalar, the constant added to the response prior to transformation, default 0.

Value

A list with two numeric vectors, one with predicted values pred and one with standard deviation sdpred of those predictions, both on the original scale of the response.

References

Mood, AM, FA Graybill, DC Boes. 1974. Introduction to the Theory of Statistics. McGraw-Hill, New York.

Examples

fit <- aov(log(yield) ~ block + N * P + K, data=npk)
predAntilognorm(fit, npk)

JVAdams/GLFC documentation built on Jan. 5, 2023, 12:59 a.m.