Open cindyyawencheng opened 4 years ago
Thanks for the report - it's now on the to-do list.
I have similar problems with dynamically created formulas, which seem to internally throw an exception, which is not forwarded outside of nominal_test
. It probably has something to do with the environments, but it seems that using do.call
when calling clm
fixes the problem, e.g.
model = do.call(clm, list(as.formula(paste0('y', '~', paste(paste0('x', 1:3), collapse = '+'))), data = data, link = 'logit'))
I would like to create a simple function that i) automates the process of evaluating whether particular independent variables violate the parallel regression assumption and then ii) subsequently returns a regression with the in which the independent variables that do violate the parallel regression assumption are evaluated accordingly. To that end, I've written the following code, where I use the nominal_test() function in the ordinal package to implement part i).
However, I have found that for some reason, the nominal_test() function does not work as desired when using it inside another function. To illustrate, if you run the following code,
The nominal_test() function does not return any results. However, running the same model, but outside of the user-created function, nominal_test() DOES return results, as evidenced if you run the following:
I'm guessing the issue lies somewhere in the source code for nominal_test(), would it be possible to look into this? Thanks very much!