View source: R/model_evaluation.R
predict.RprobitB_fit | R Documentation |
This function predicts the discrete choice behavior
## S3 method for class 'RprobitB_fit'
predict(object, data = NULL, overview = TRUE, digits = 2, ...)
object |
An object of class |
data |
Either
|
overview |
If |
digits |
The number of digits of the returned choice probabilities. |
... |
Ignored. |
Predictions are made based on the maximum predicted probability for each choice alternative. See the vignette on choice prediction for a demonstration on how to visualize the model's sensitivity and specificity by means of a receiver operating characteristic (ROC) curve.
Either a table if overview = TRUE
or a data frame otherwise.
data <- simulate_choices(
form = choice ~ cov, N = 10, T = 10, J = 2, seed = 1
)
data <- train_test(data, test_proportion = 0.5)
model <- fit_model(data$train)
predict(model)
predict(model, overview = FALSE)
predict(model, data = data$test)
predict(
model,
data = data.frame("cov_A" = c(1, 1, NA, NA), "cov_B" = c(1, NA, 1, NA)),
overview = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.