View source: R/predict.fitmixture.R
| predict.fitmixture | R Documentation |
Obtain predictions from a fit_mixture() object. If newdata is omitted, predictions are obtained using the underlying model's predict method (predict.coxph(), predict.glm(), or predict.lm()). If newdata is provided, predictions are computed directly from the reconstructed model matrix and estimated coefficients.
## S3 method for class 'fitmixture'
predict(object, newdata, type, terms = NULL, na.action = na.pass, ...)
object |
the result of a call to |
newdata |
optional new data to obtain predictions for. The original data is used by default. |
type |
the type of prediction. When |
terms |
the terms when type = "terms". By default, all terms are included. Note: This is only supported when |
na.action |
a function for what to do with missing values in |
... |
for future predict arguments |
a vector or matrix of predictions based on arguments specified.
## commonness score of first and last names used for linkage
mformula <- ~commf + comml
## hand-linked records are considered "safe" matches
safematches <- ifelse(lifem$hndlnk =="Hand-Linked At Some Level", TRUE, FALSE)
## overall mismatch rate in the data set is assumed to be ~ 0.05
mrate <- 0.05
fit <- fit_mixture(age_at_death ~ poly(unit_yob, 3, raw = TRUE), data = lifem,
family = "gaussian", mformula, safematches, mrate)
predict(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.