aalfons / robmed

Perform mediation analysis via a fast-and-robust bootstrap test, as well as various other methods
GNU General Public License v3.0
6 stars 0 forks source link

test_mediation #37

Closed akgraham89 closed 1 year ago

akgraham89 commented 1 year ago

I've checked all of my variables, my entire line of code for the model, and more, and I still get this message (the same code worked a few weeks ago):

Error in [.data.frame(data, , m, drop = FALSE) : undefined columns selected

aalfons commented 1 year ago

Without a reproducible example, I can only speculate what is going wrong. The error message means that the specified mediator variables are not found in the specified data set. Did you make sure that the supplied variable names are exactly as they are in the data set? In particular, check lower case vs upper case letters, any spaces, and so on.

Please let me know if that resolves the issue. Alternatively, you can of course send me a reproducible example.

akgraham89 commented 1 year ago

As it turns out, one of my variables was recoded into a matrix, not a vector. Once addressed, all is working. Thank you again for your quick response!