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 contributtype="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
.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