predict.sbm {sbd} | R Documentation |
Predict estimates
Description
Generates predicted underlying averages from a size biased model, given a set of covariates if these are used in the model.
Usage
## S3 method for class 'sbm'
predict(object, newdata = NULL, reps = 999, ...)
Arguments
object |
A size biased model fit of class |
newdata |
A dataframe of covariate values with fields matching
covariates used in |
reps |
Integer giving the number of random draws for variance estimation. |
... |
Additional arguments (unused). |
Details
When newdata
is missing, make_table
is used to
generate a dataframe of covariates at which to predict, based on the
model formula and covariate data.
Value
A dataframe of predictions with fields est
(estimated average),
se
(estimated standard error), and lcl
, ucl
(lower and
upper 95 percent confidence limits).
Examples
data(BCI_speed_data)
agoutiData <- subset(BCI_speed_data, species=="agouti")
lmod_mass <- sbm(speed~mass, agoutiData, pdf="lnorm")
nd <- data.frame(mass = c(1, 10, 100))
predict(lmod_mass, nd)
[Package sbd version 0.1.0 Index]