add_quantile.lm {ciTools}  R Documentation 
This function is one of the methods of add_quantile
. It is
called automatically when add_quantile
is called on objects
of class lm
.
## S3 method for class 'lm'
add_quantile(
df,
fit,
p,
name = NULL,
yhatName = "pred",
log_response = FALSE,
...
)
df 
A data frame of new data. 
fit 
An object of class 
p 
A real number between 0 and 1. Sets the level of the quantiles. 
name 

yhatName 
A string. Name of the vector of predictions. 
log_response 
A logical. If TRUE, quantiles will be generated
for the prediction made with a loglinear model: 
... 
Additional arguments. 
Quantiles for linear models are determined parametrically, by
applying a pivotal quantity to the distribution of Yx
.
A dataframe, df
, with predicted values and level 
p quantiles attached.
add_ci.lm
for confidence intervals for
lm
objects, add_pi.lm
for prediction
intervals of lm
objects, and add_probs.lm
for response probabilities of lm
objects.
# Fit a linear Model
fit < lm(dist ~ speed, data = cars)
# Find the 0.7quantile (70th percentile) of new distances, given
# the linear model fit.
add_quantile(cars, fit, p = 0.7)
# As above, but with a custom name for the vector of quantiles
add_quantile(cars, fit, p = 0.7, name = "my_quantile")