This method wraps tidy.lm().

# S3 method for orcutt
tidy(x, ...)

Arguments

x

An orcutt object returned from orcutt::cochrane.orcutt().

...

Arguments passed on to tidy.lm

x

An lm object created by stats::lm().

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.

conf.level

The confidence level to use for the confidence interval if conf.int = TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.

quick

Logical indiciating if the only the term and estimate columns should be returned. Often useful to avoid time consuming covariance and standard error calculations. Defaults to FALSE.

exponentiate

Logical indicating whether or not to exponentiate the the coefficient estimates. This is typical for logistic and multinomial regressions, but a bad idea if there is no log or logit link. Defaults to FALSE.

See also

Value

A tibble::tibble() with columns:

estimate

The estimated value of the regression term.

p.value

The two-sided p-value associated with the observed statistic.

statistic

The value of a T-statistic to use in a hypothesis that the regression term is non-zero.

std.error

The standard error of the regression term.

term

The name of the regression term.

Examples

library(orcutt) reg <- lm(mpg ~ wt + qsec + disp, mtcars) tidy(reg)
#> # A tibble: 4 x 5 #> term estimate std.error statistic p.value #> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 19.8 5.94 3.33 0.00244 #> 2 wt -5.03 1.22 -4.11 0.000310 #> 3 qsec 0.927 0.342 2.71 0.0114 #> 4 disp -0.000128 0.0106 -0.0121 0.990
co <- cochrane.orcutt(reg) co
#> Cochrane-orcutt estimation for first order autocorrelation #> #> Call: #> lm(formula = mpg ~ wt + qsec + disp, data = mtcars) #> #> number of interaction: 7 #> rho 0.26819 #> #> Durbin-Watson statistic #> (original): 1.49575 , p-value: 4.063e-02 #> (transformed): 2.05696 , p-value: 5.21e-01 #> #> coefficients: #> (Intercept) wt qsec disp #> 21.814858 -4.852590 0.797029 -0.001359
tidy(co)
#> Warning: deal with tidy.orcutt conf.int nonsense
#> # A tibble: 4 x 5 #> term estimate std.error statistic p.value #> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 21.8 6.63 3.29 0.00279 #> 2 wt -4.85 1.33 -3.65 0.00112 #> 3 qsec 0.797 0.370 2.15 0.0402 #> 4 disp -0.00136 0.0110 -0.123 0.903
glance(co)
#> # A tibble: 1 x 8 #> r.squared adj.r.squared rho number.interact… dw.original p.value.original #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 0.799 0.777 0.268 7 1.50 0.0406 #> # ... with 2 more variables: dw.transformed <dbl>, p.value.transformed <dbl>