I have two variables $x_1$ and $x_2$, which are correlated. I want to know which of those variables explains more variation in $y$.
I know that for linear regression, there are a bunch of options (which are discussed here, in addition you can find the paper for a recommended package here: Grömping, 2006).
Regrettably, my regression is pretty poorly explained by OLS*. Instead, I am using a quasibinomial distribution (In R
this corresponds to glm
with family quasibinomial
. In Stata this corresponds to fracreg logit
). (If any of these solutions DO work for my type of model, please let me know) Nevertheless, I still want to test for relative importance, in the best way I can (in either R or Stata).
I thought the best way to test this, would to be to just normalise both variables.
- However, now the first question arises. If I want to test which variable explains more variation in a generalized linear model,
A) do I test:
$$y = B_0 + B_1x_1 + B_2x_2 + u$$
B) Or do I test:
$$y = B_0 + B_1x_1 + u - versus - y = B_0 + B_2x_2 + u$$
Now, to make the example slightly more complicated, let's assume that $x_1$ is an ordinal variable. Now I know already that normalising ordinal data is at a minimum frowned upon (See for example link, link, link). Here I note that I am not looking for the perfect solution. Instead, I am looking for the best I can do. So the next question:
- What are my options if $x_1$ is an ordinal variable?
If I could make it even slightly more complicated,
- What if $x_2$ (NOT $x_1$) was a dummy variable (at this point we are comparing an ordinal variable to a dummy variable, which are correlated)?
Once again, I am not looking for perfect solutions. I am looking for the best I can do. References and package recommendations would be greatly appreciated.
*My first idea was to simply use a linear model to compare these variables. But the model was so poorly explained by OLS that I refrained.
EDIT:
The domin
(Stata-package) / domir
(R-package) packages allow checking for relative importance in non-linear models. I could however not find any literature on the application in relation to non-linear models).