lpred
is the GAMLSS specific method which extracts the linear predictor and its (approximate) standard errors
for a specified parameter from a GAMLSS objects.
The lpred
can be also used to extract the fitted values (with its approximate standard errors) or specific terms in the model
(with its approximate standard errors) in the same way that the predict.lm()
and predict.glm()
functions can be used for
lm
or glm
objects.
The function lp
extract only the linear predictor. If prediction is required for new data values then use the
function predict.gamlss()
.lpred(obj, what = c("mu", "sigma", "nu", "tau"),
type = c("link", "response", "terms"),
terms = NULL, se.fit = FALSE, ...)
lp(obj, what = "mu", ...)
what="mu"
type="link"
(the default) gets the linear predictor for the specified distribution parameter.
type="response"
gets the fitted values for the parameter while type="terms"
gets the fitted terms contributitype="terms"
, which terms to be selected (default is all terms)se.fit=FALSE
a vector (or a matrix) of the appropriate type
is extracted from the GAMLSS object for the given parameter in what
.
If se.fit=TRUE
a list containing the appropriate type
, fit
, and its (approximate) standard errors, se.fit
.Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R.
Accompanying documentation in the current GAMLSS help files, (see also
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007,
predict.gamlss
data(aids)
mod<-gamlss(y~poly(x,3)+qrt, family=PO, data=aids) #
mod.t <- lpred(mod, type = "terms", terms= "qrt")
mod.t
mod.lp <- lp(mod)
mod.lp
rm(mod, mod.t,mod.lp)
Run the code above in your browser using DataLab