Я пытался запустить панель регрессии вар в R, но получил эту ошибку
dataset1 <- pvargmm(dependent_vars = c("Income Inequality"),lags = 2, exog_vars = c("Age Dependency ratio", "private credit by financial sector", "inf", "gcf", "gdp", "agri emp", "govt exp", "Pop growth", "total emp", "capital openess", "secondary enrollement", "Trade to GDP", "Portfolio equity assets (stock)", "Portfolio equity liabilities (stock)", "FDI assets (stock)","FDI liabilities (stock)", "Debt assets (stock)","Debt liabilities (stock)", "financial derivatives (assets)", "financial derivatives (liab)", "FX Reserves minus gold" ), transformation = fd, data = High_Development_countries, panel_identifier = c("Year", "country"), steps = c("twostep"))
Error: Must use a vector in `[`, not an object of class matrix.
Run `rlang::last_error()` to see where the error occurred.
> rlang::last_error()
<error/rlang_error>
Must use a vector in `[`, not an object of class matrix.
Backtrace:
1. panelvar::pvargmm(...)
3. base::sort.default(unique(Set_Vars[, 1]))
7. base::order(x, na.last = na.last, decreasing = decreasing)
8. base::lapply(z, function(x) if (is.object(x)) as.vector(xtfrm(x)) else x)
9. base:::FUN(X[[i]], ...)
12. base::xtfrm.default(x)
14. base::rank(x, ties.method = "min", na.last = "keep")
16. tibble:::`[.tbl_df`(x, !nas)
17. tibble:::check_names_df(i, x)
Run `rlang::last_trace()` to see the full context.
> rlang::last_trace()
<error/rlang_error>
Must use a vector in `[`, not an object of class matrix.
Backtrace:
x
1. \-panelvar::pvargmm(...)
2. +-base::sort(unique(Set_Vars[, 1]))
3. \-base::sort.default(unique(Set_Vars[, 1]))
4. +-x[order(x, na.last = na.last, decreasing = decreasing)]
5. +-tibble:::`[.tbl_df`(x, order(x, na.last = na.last, decreasing = decreasing))
6. | \-tibble:::check_names_df(i, x)
7. \-base::order(x, na.last = na.last, decreasing = decreasing)
8. \-base::lapply(z, function(x) if (is.object(x)) as.vector(xtfrm(x)) else x)
9. \-base:::FUN(X[[i]], ...)
10. +-base::as.vector(xtfrm(x))
11. +-base::xtfrm(x)
12. \-base::xtfrm.default(x)
13. +-base::as.vector(rank(x, ties.method = "min", na.last = "keep"))
14. \-base::rank(x, ties.method = "min", na.last = "keep")
15. +-x[!nas]
16. \-tibble:::`[.tbl_df`(x, !nas)
17. \-tibble:::check_names_df(i, x)