This is the code I'm trying to run:
varex1 <- pvargmm(dependent_vars = c("en_con_tot_toe", "gdp", "pop_urb_per"), lags = 1, transformation = "fod", data = VARtestdata, panel_identifier = c("country", "year"), steps = c("twostep"), system_instruments = FALSE)
I keep getting this error:
Error: Can't subset columns that don't exist.
x Locations 5, 2, 4, 3, 8, etc. don't exist.
i There are only 1 column.
Here is the last_error() and last_trace():
rlang::last_error()
<error/vctrs_error_subscript_oob>
Can't subset columns that don't exist.
x Locations 5, 2, 4, 3, 8, etc. don't exist.
i There are only 1 column.
Backtrace:
- panelvar::pvargmm(...)
- base::sort.default(unique(Set_Vars[, 1]))
- tibble:::
[.tbl_df
(x, order(x, na.last = na.last, decreasing = decreasing)) - tibble:::vectbl_as_col_location(...)
- vctrs::vec_as_location(j, n, names)
- vctrs:::stop_subscript_oob(...)
- vctrs:::stop_subscript(...)
Runrlang::last_trace()
to see the full context.
rlang::last_trace()
<error/vctrs_error_subscript_oob>
Can't subset columns that don't exist.
x Locations 5, 2, 4, 3, 8, etc. don't exist.
i There are only 1 column.
Backtrace:
x
- -panelvar::pvargmm(...)
- +-base::sort(unique(Set_Vars[, 1]))
- -base::sort.default(unique(Set_Vars[, 1]))
-
+-x[order(x, na.last = na.last, decreasing = decreasing)]
-
\-tibble:::`[.tbl_df`(x, order(x, na.last = na.last, decreasing = decreasing))
-
\-tibble:::vectbl_as_col_location(...)
-
+-tibble:::subclass_col_index_errors(...)
-
| \-base::withCallingHandlers(...)
-
\-vctrs::vec_as_location(j, n, names)
-
\-(function () ...
-
\-vctrs:::stop_subscript_oob(...)
-
\-vctrs:::stop_subscript(...)
PLEASE HELP. Also, if you want me to upload the dataset I'm using, how do I do that?