model_frame: Make model frames for panel_data objects

View source: R/model_frame.R

model_frameR Documentation

Make model frames for panel_data objects

Description

This is similar to model.frame, but is designed specifically for panel_data() data frames. It's a workhorse in wbm() but may be useful in scripting use as well.

Usage

model_frame(formula, data)

Arguments

formula

A formula. Note that to get an individual-level mean with incomplete data (e.g., panel attrition), you should use imean() rather than mean().

data

A panel_data() frame.

Value

A panel_data() frame with only the columns needed to fit a model as described by the formula.

Examples


data("WageData")
wages <- panel_data(WageData, id = id, wave = t)
model_frame(lwage ~ wks + exp, data = wages)


panelr documentation built on Aug. 22, 2023, 5:08 p.m.