Learn R Programming

dpm (version 1.2.0)

tidy.dpm: Tidy methods for dpm

Description

dpm objects support the broom package's tidy method.

Usage

# S3 method for dpm
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)

# S3 method for dpm glance(x, ...)

Value

A tibble::tibble() with information about model components. These will be coefficient estimates (for tidy()) or model fit (for glance()), following the naming standards established by the broom package.

Arguments

x

A dpm object.

conf.int

Logical indicating whether or not to include a confidence interval in the tidy data frame.

conf.level

The confidence level to use for the confidence interval when conf.int is TRUE. Default is .95, corresponding to a 95% confidence interval.

...

Other arguments passed to summary.dpm.

Examples

Run this code
if (requireNamespace("broom")) {
  library(broom)
  # Load example data
  data("WageData", package = "panelr")
  # Convert data to panel_data format for ease of use
  wages <- panel_data(WageData, id = id, wave = t)

  fit <- dpm(wks ~ pre(lag(union)) + lag(lwage) | ed, data = wages)
  tidy(fit)
}

Run the code above in your browser using DataLab