augment.logitr: Glance a 'logitr' class object

View source: R/broom.R

augment.logitrR Documentation

Glance a logitr class object

Description

Glance a logitr class object

Usage

## S3 method for class 'logitr'
augment(x, newdata = NULL, obsID = NULL, type = "prob", ...)

Arguments

x

is an object of class logitr.

newdata

a data.frame. Each row is an alternative and each column an attribute corresponding to parameter names in the estimated model. Defaults to NULL, in which case predictions are made on the original data used to estimate the model.

obsID

The name of the column that identifies each set of alternatives in the data. Required if newdata != NULL. Defaults to NULL, in which case the value for obsID from the data in object is used.

type

A character vector defining what to predict: prob for probabilities, outcomes for outcomes. If you want both outputs, use c("prob", "outcome"). Outcomes are predicted randomly according to the predicted probabilities. Defaults to "prob".

...

further arguments.

Value

A tibble of ...

Examples

library(logitr)

# Estimate a preference space model
mnl_pref <- logitr(
  data    = yogurt,
  outcome = "choice",
  obsID   = "obsID",
  pars    = c("price", "feat", "brand")
)

# Extract a tibble of the model summary statistics
augment(mnl_pref)


logitr documentation built on Sept. 29, 2023, 5:06 p.m.