Takes a "gcrq" objects and computes fitted values
# S3 method for gcrq
predict(object, newdata, se.fit=FALSE, transf=NULL, xreg,
type=c("sandw","boot"), ...)If se.fit=FALSE, a matrix of fitted values with number of rows equal to number of rows of input data
and number of columns depending on the number of fitted quantile curves (i.e length of taus). If se.fit=TRUE, a list of matrices (fitted values and standard errors).
a fitted "gcrq" object.
a dataframe including all the covariates of the model. The smooth term is represented by a covariate
and proper basis functions will be build accordingly. If omitted, the fitted values are used. Ignored if xreg is provided.
logical. If TRUE, standard errors of the fitted quantiles are computed using the bootstrap or the sandwich covariance matrix, according to the argument type.
An optional character string (with "y" as argument) meaning a function to apply to the predicted values. E.g. "(exp(y)-0.1)".
If NULL (default) it is taken as the inverse of function transf (*if*) supplied in gcrq. The standard errors (provided se.fit=TRUE has been set) are adjusted accordingly via the Delta method. See argument "transf" in gcrq(). If transf has been specified in gcrq(), use transf="y" to force predictions on the transformed scale, i.e. without back transforming.
the design matrix for which predictions are requested. If provided, xreg has to include the basis functions of the B-spline.
If se.fit=TRUE, which cov matrix should be used? 'boot' means case-resampling bootstrap (see n.boot in gcrq()), 'sandw' mean via the sandwich formula.
arguments passed to other functions
Vito M.R. Muggeo
predict.gcrq computes fitted quantiles as a function of observations included in newdata or xreg.
Either newdata or xreg have to be supplied, but newdata is ignored
when xreg is provided.
gcrq, plot.gcrq
##see ?gcrq
## predict(m1, newdata=data.frame(x=c(.3,.7)))
Run the code above in your browser using DataLab