model.frame.logitr: Extracting the Model Frame from a Formula or Fit

View source: R/methods.R

model.frame.logitrR Documentation

Extracting the Model Frame from a Formula or Fit

Description

Returns a data.frame with the variables needed to use formula and any ... arguments.

Usage

## S3 method for class 'logitr'
model.frame(formula, ...)

Arguments

formula

a model formula or terms object or an R object.

...

further arguments.

Value

A data.frame with the variables needed to use formula and any ... arguments.

Examples

library(logitr)

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

# Get the model.frame data frame
model.frame(mnl_pref)

logitr documentation built on Sept. 11, 2024, 6:40 p.m.