Можете ли вы уточнить немного больше желаемого результата? Модели имеют несколько терминов AR и несколько терминов MA, что приводит к множеству P-значений.
ОБНОВЛЕНИЕ: Так вот как?
library(tidyverse)
test <- list(
"MA2" = coeftest(arima(ar2 , order = c(0,0,2))),
"MA3" = coeftest(arima(ar2 , order = c(0,0,3))),
"MA4" = coeftest(arima(ar2 , order = c(0,0,4))),
"AR1" = coeftest(arima(ar2 , order = c(1,0,0))),
"AR2" = coeftest(arima(ar2 , order = c(2,0,0))),
"ARMA(1,1)" = coeftest(arima(ar2 , order = c(1,0,1))),
"ARMA(2,1)" = coeftest(arima(ar2 , order = c(2,0,1))),
"ARMA(1,2)" = coeftest(arima(ar2 , order = c(2,0,1))))
map_df(test, tidy, .id = "model") %>%
select(-std.error, -statistic) %>%
complete(model, term, fill = list(NA)) %>%
nest(estimate, p.value, .key = 'stats') %>%
spread(key = term, value = stats) %>%
unnest(.sep = '_') -> res
# A tibble: 8 x 15
model ar1_estimate ar1_p.value ar2_estimate ar2_p.value intercept_estim~
<chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 AR1 0.750 8.92e- 60 NA NA 1.04
2 AR2 1.29 1.54e-152 -0.714 2.28e-48 1.00
3 ARMA~ 0.625 1.03e- 26 NA NA 1.05
4 ARMA~ 1.30 5.92e- 77 -0.722 3.33e-32 1.00
5 ARMA~ 1.30 5.92e- 77 -0.722 3.33e-32 1.00
6 MA2 NA NA NA NA 0.982
7 MA3 NA NA NA NA 1.00
8 MA4 NA NA NA NA 1.07
# ... with 9 more variables: intercept_p.value <dbl>, ma1_estimate <dbl>,
# ma1_p.value <dbl>, ma2_estimate <dbl>, ma2_p.value <dbl>, ma3_estimate <dbl>,
# ma3_p.value <dbl>, ma4_estimate <dbl>, ma4_p.value <dbl>
Куда бы ты хотел пойти отсюда?