Learn R Programming

dpm (version 1.2.0)

get_wide_data: Retrieve wide-format data from fitted dpm model

Description

This helper function provides a simple way to retrieve the widened data from a fitted dpm() object.

Usage

get_wide_data(model)

Value

A data.frame with input data transformed from "long" to "wide" format, with just one row per person/entity. Internally, this is generated by calling panelr::widen_panel() after some preprocessing.

Arguments

model

A dpm object.

Examples

Run this code

data("WageData", package = "panelr")
wages <- panel_data(WageData, id = id, wave = t)
fit <- dpm(wks ~ pre(lag(union)) + lag(lwage), data = wages)
get_wide_data(fit)

Run the code above in your browser using DataLab