0

Hello I am trying to generate a time series least square regression with multiple combinations with a set of variables incluiding their lags. I found this useful link:

How can I modify these dplyr code for multiple linear regression by combination of all variables in R.

But when I try to replicate, I obtain this error:

that appears in this image

I try to use the vec_names() package, but it says that have to be a character vector or the rename package but it didn't recognize it.

prosoitos
  • 6,679
  • 5
  • 27
  • 41
  • 2
    The `dplyr` functions `rename_with` and `rename` allow to change the name of multiple columns, but in your case, the error gives the solution. The problem is that `glance`, and therefore `unnest(result1)` produce columns `statistic` and `p.value` relative to the model, while `tidy` and therefore `unnest(result2)` produce columns `statistic` and `p.value` relative to the estimates. The error gives the solution because it tells using the argument `names_repair`. For example, you can add `unnest(results2, names_repair = tidyr_legacy)` – iago Oct 06 '20 at 15:36
  • @iago, please post your suggestion as a solution, so that it helps others looking for same/similar issue. – YBS Oct 06 '20 at 16:57
  • Thanks for the help @iago – eliasjose92 Oct 06 '20 at 18:35

0 Answers0