R function output can’t find name of the object
I have 4 data objects (AR1, AR2, AR3, and AR4) which contain the regression output information (each obtained after running dynlm function which is part of dynlm package). I tried to run the following function which should return test statistics obtained by LjungBox function (part of the portes package) for each of these models (where I use the number of observations of the model and the length of the coefficients variable):
self_function can’t work– Can’t subset columns past the end
There is dataframe raw_df
as below: