Learn R Programming

broom (version 0.4.3)

plm_tidiers: Tidiers for panel regression linear models

Description

Tidiers for panel regression linear models

Usage

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

# S3 method for plm augment(x, data = as.data.frame(stats::model.frame(x)), ...)

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

Arguments

x

a "plm" object representing a panel object

conf.int

whether to include a confidence interval

conf.level

confidence level of the interval, used only if conf.int=TRUE

exponentiate

whether to exponentiate the coefficient estimates and confidence intervals

...

extra arguments, not used

data

original dataset

Value

All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

tidy.plm returns a data frame with one row per coefficient, of the same form as tidy.lm.

augment returns a data frame with one row for each initial observation, adding the columns

.fitted

predicted (fitted) values

.resid

residuals

glance returns a one-row data frame with columns

r.squared

The percent of variance explained by the model

adj.r.squared

r.squared adjusted based on the degrees of freedom

statistic

F-statistic

p.value

p-value from the F test, describing whether the full regression is significant

deviance

deviance

df.residual

residual degrees of freedom

See Also

lm_tidiers

Examples

Run this code
# NOT RUN {
if (require("plm", quietly = TRUE)) {
    data("Produc", package = "plm")
    zz <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
              data = Produc, index = c("state","year"))
    
    summary(zz)
    
    tidy(zz)
    tidy(zz, conf.int = TRUE)
    tidy(zz, conf.int = TRUE, conf.level = .9)
    
    head(augment(zz))
    
    glance(zz)
}

# }

Run the code above in your browser using DataLab