Description Usage Arguments Value Examples
Predict means and variance of the response variable for a blm
object.
1 2 3 |
object |
a |
newdata |
an optional data frame containing variables with which to predict. If missing, values used for fitting will be extracted from the object. |
se.fit |
report also standard deviation for the predicted values. |
interval |
Type of interval calculation, currently only |
level |
confidence level for interval calculation. |
... |
other arguments (currently ignored). |
A vector of predicted fit
values. If se.fit = TRUE
, a
named list containing the fit values under $fit
and standard
deviations of the fit values under $se.fit
. If interval =
"confidence"
, pseudo-confidence interval, ie lower and upper bounds of
quantiles of the fit distrib ution are provided at level
for the fit
values are provided with $fit
as data.frame with columns
$fit
, $lwr
, $upr
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | x <- rnorm(100)
b <- 1.3
w0 <- 0.2 ; w1 <- 3
y <- rnorm(100, mean = w0 + w1 * x, sd = sqrt(1/b))
model <- blm(y ~ x, prior = NULL, beta = b, data = data.frame(x=x, y=y))
predict(model)
#with standard deviation"of the fit distribution
predict(model, se.fit=TRUE)
#with "confidence interval" of the fit values
predict(model, interval = 'confidence', level = .95)
#predict for new explanatory values
x <- rnorm(10)
predict(model, data.frame(x=x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.