predictDuan | R Documentation |
Predicts bias-corrected expected mean response values from a log-transformed regression model, using either the minimum variance unbiased estimate(MVUE), Duan's smoothing estimate, or Ferguson's maximum likelihood estimate.
predictDuan(object, newdata, back.trans = exp) predictFerguson(object, newdata, Log10 = FALSE) predictMVUE(object, newdata, Log10 = FALSE)
object |
an object of class "lm" 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. |
back.trans |
the back-transformation function. For common log
transforms, use |
Log10 |
is the transform of the response variable the common log? |
A vector of predictions matching newdata
or the model data.
Bradu, D. and Mundlak, Y., 1970, Estimation in the lognormal linear models: Journal of the American Statistical Association, v. 65, no. 329, p. 198–211.
Duan, N., 1983, Smearing estimate: a nonparametric retransformation method: Journal of the American Statistical Association, v. 78, p. 159–178.
Ferguson, R.I. 1986, River loads underestimated by rating curves: Water Resources Research, v. 22, p 74–76.
Helsel, D.R. and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.
lm
## Generate random log-normal data and build the regression model set.seed(111) XX.df <- data.frame(x=sort(runif(32, 1, 5)), y=rlnorm(32, seq(1,2, length.out=32))) XX.lm <- lm(log(y) ~ x, data=XX.df) ## Compare the results for x=1:5 ## The simple back-transformed estimates exp(predict(XX.lm, newdata=data.frame(x=1:5))) ## The bias corrected estimates of the mean response predictFerguson(XX.lm, newdata=data.frame(x=1:5)) predictDuan(XX.lm, newdata=data.frame(x=1:5)) predictMVUE(XX.lm, newdata=data.frame(x=1:5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.