当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R broom tidy.orcutt 整理 a(n) orcutt 对象


Tidy 总结了有关模型组件的信息。模型组件可能是回归中的单个项、单个假设、聚类或类。 tidy 所认为的模型组件的确切含义因模型而异,但通常是不言而喻的。如果模型具有多种不同类型的组件,您将需要指定要返回哪些组件。

用法

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

参数

x

orcutt::cochrane.orcutt() 返回的 orcutt 对象。

...

附加参数。不曾用过。仅需要匹配通用签名。注意:拼写错误的参数将被吸收到 ... 中,并被忽略。如果拼写错误的参数有默认值,则将使用默认值。例如,如果您传递 conf.lvel = 0.9 ,所有计算将使用 conf.level = 0.95 进行。这里有两个异常:

  • tidy() 方法在提供 exponentiate 参数时会发出警告(如果该参数将被忽略)。

  • augment() 方法在提供 newdata 参数时会发出警告(如果该参数将被忽略)。

也可以看看

orcutt::cochrane.orcutt()

其他 orcutt 整理器:glance.orcutt()

带有列的 tibble::tibble()

estimate

回归项的估计值。

p.value

与观察到的统计量相关的两侧 p 值。

statistic

在回归项非零的假设中使用的 T-statistic 的值。

std.error

回归项的标准误差。

term

回归项的名称。

例子


# load libraries for models and data
library(orcutt)

# fit model and summarize results
reg <- lm(mpg ~ wt + qsec + disp, mtcars)
tidy(reg)
#> # A tibble: 4 × 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)
tidy(co)
#> # A tibble: 4 × 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 × 9
#>   r.squared adj.r.squared   rho number.interaction dw.original
#>       <dbl>         <dbl> <dbl>              <dbl>       <dbl>
#> 1     0.799         0.777 0.268                  7        1.50
#> # ℹ 4 more variables: p.value.original <dbl>, dw.transformed <dbl>,
#> #   p.value.transformed <dbl>, nobs <int>
源代码:R/orcutt-tidiers.R

相关用法


注:本文由纯净天空筛选整理自大神的英文原创作品 Tidy a(n) orcutt object。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。