R: Tidying methods for a speedlm model

speedlm_tidiers {broom} | R Documentation

## Tidying methods for a speedlm model

### Description

These methods tidy the coefficients of a "speedlm" object into a summary, augment the original data with information on the fitted values and residuals, and construct a one-row glance of the model's statistics.

### Usage

    ## S3 method for class 'speedlm'
    tidy(x, conf.int = FALSE, conf.level = 0.95,
      exponentiate = FALSE, quick = FALSE, ...)

    ## S3 method for class 'speedlm'
    glance(x, ...)

    ## S3 method for class 'speedlm'
    augment(x, data = stats::model.frame(x), newdata = data,
      ...)

### Arguments

`x` | speedlm 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 (typical for logistic regression)
`quick` | whether to compute a smaller and faster version, containing only the `term` and `estimate` columns.
`...` | extra arguments (not used)
`data` | data frame to augment
`newdata` | new data to use for predictions, optional

### Value

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

`tidy.speedlm` returns the tidied output of the lm with one row for each term in the formula. The columns match those in lm_tidiers.

`glance.speedlm` returns a one-row data.frame with the 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
`df` | Degrees of freedom used by the coefficients
`logLik` | the data's log-likelihood under the model
`AIC` | the Akaike Information Criterion
`BIC` | the Bayesian Information Criterion
`deviance` | deviance
`df.residual` | residual degrees of freedom

`augment.speedlm` returns one row for each observation, with just one column added:

`.fitted` | Fitted values of model

### See Also

lm_tidiers, biglm_tidiers

### Examples

    if (require("speedglm", quietly = TRUE)) {
        mod <- speedglm::speedlm(mpg ~ wt + qsec, data = mtcars)
        tidy(mod)
        glance(mod)
        augment(mod)
    }

[Package broom version 0.4.4 Index]