當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R broom glance.orcutt 瞥一眼 orcutt 對象

Glance 接受模型對象並返回 tibble::tibble(),其中僅包含一行模型摘要。摘要通常是擬合優度度量、殘差假設檢驗的 p 值或模型收斂信息。

Glance 永遠不會返返回自對建模函數的原始調用的信息。這包括建模函數的名稱或傳遞給建模函數的任何參數。

Glance 不計算匯總度量。相反,它將這些計算外包給適當的方法並將結果收集在一起。有時擬合優度測量是不確定的。在這些情況下,該度量將報告為 NA

無論模型矩陣是否秩虧,Glance 都會返回相同的列數。如果是這樣,則不再具有明確定義值的列中的條目將使用適當類型的 NA 進行填充。

用法

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

參數

x

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

...

附加參數。不曾用過。僅需要匹配通用簽名。注意:拚寫錯誤的參數將被吸收到 ... 中,並被忽略。如果拚寫錯誤的參數有默認值,則將使用默認值。例如,如果您傳遞 conf.lvel = 0.9 ,所有計算將使用 conf.level = 0.95 進行。這裏有兩個異常:

  • tidy() 方法在提供 exponentiate 參數時會發出警告(如果該參數將被忽略)。

  • augment() 方法在提供 newdata 參數時會發出警告(如果該參數將被忽略)。

也可以看看

glance() , orcutt::cochrane.orcutt()

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

恰好隻有一行和一列的 tibble::tibble()

adj.r.squared

調整後的 R 平方統計量,除了考慮自由度之外,與 R 平方統計量類似。

dw.original

Durbin-Watson原始擬合統計。

dw.transformed

Durbin-Watson 變換擬合的統計量。

nobs

使用的觀察數。

number.interaction

交互次數。

p.value.original

原始 Durbin-Watson 統計量的 P 值。

p.value.transformed

變換後自相關的 P 值。

r.squared

R 平方統計量,或模型解釋的變異百分比。也稱為決定係數。

rho

Spearman 的 rho 自相關

例子


# 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

相關用法


注:本文由純淨天空篩選整理自大神的英文原創作品 Glance at a(n) orcutt object。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。