Comparing whether the effect of variable $x_1$ is stronger on a response variable $y_1$ than another $y_2$ is reasonably straightforward if certain conditions are met such that the question is well-defined.
Generally speaking, the coefficient $\beta_1$ gives us an idea about the estimated average change in response per unit of change of $x_1$. Now, assuming $y_1$ and $y_2$ are on the same scale, we are comparing changes to $y_1$ apples to $y_2$ apples, so we are good.
Thus the first issue here is that $y_1$ is an ordinal categorical variable and $y_2$ is a Gaussian; on face value, this is "not great" but not all is lost. Luckily, we have an identity link for our ordinal model m_1
meaning that our linear predictor is "just" a latent variable that is then segmented based on the estimated transition thresholds.
That means that we can squint our eyes and say that the beta's from m_1
and m_2
refer to the same scale, just for m_1
the scale is the latent scale and in m_2
the response scale. So the first thing to do here is to rescale aggDefol
and canopyd
to have the same scale. This is is going to be a quirky thing to do as I strongly suspect that changing canopyd
to be in $[1,3]$ is likely necessary because R encodes order categorical variables as integers. But theoretically can be done. Let me note if we simply use defol
and canopyd
directly as numeric values normalised to be $N(0,1)$, our task would be greatly simplified and probably more coherent. We are using splines for age
and ph
after all so if there are strong non-linearities due to them we should still be able to account for them.
The second issue is that aggDefol
is a response variable in model m_1
but one of the explanatory variables in m2
. That makes the effect of age
and watermoisture
in m_2
compounded by any information we have in m_1
by aggDefol
. Simply put, we should't do it as it is complicated and rife with possible bias due to confounding and/or mediating effects. But let's say we throw caution to the wind. We could use the estimated response of defol
from m_1
as a feature in m_2
, not the raw values. As such, our comparison on "whether the effect of age
on defol
is greater than the one on canopyd
" becomes the comparison of $\beta_{\text{age}}^{m_1}$ against the combined effect of age
in canopyd
which will be $\beta_{\text{age}}^{m_2} + \beta_{\text{age}}^{m_1}$. It is very messy, but assuming that canopyd
and defol
are on the same scale it "works". It will be also a mess to do when using a spline basis so I would strongly suggest using a polynomial basis so it is clear what comparisons are done.
To recap, I strong suggest reformulating the question. First of all, use similar response scales so it is obvious what they represent. Second, avoid using the same variable $x$ as a response variable and as an explanatory variable; if we cannot help it, we can use the predicted variable from the one model instead of the raw variables because in that way we effectively allow information from variable $x$ to come in the second model only through the other variables (as the response from m_1
will be simply the linear combination of the explanatory variables of it).
OK and some code:
forest$defol_norm = scale(forest$defol)
forest$canopyd_norm = scale(forest$canopyd)
forest.m1 <- gam(defol_norm ~ poly(age,2) + s(ph) + watermoisture,
data = forest, method = "REML")
forest$pred_defol = predict(forest.m1)
forest.m2 <- gam(canopyd_norm ~ poly(age,2) + s(ph) + watermoisture + pred_defol,
data = forest, method = "REML")
# Get the effects expected by "watermoisture2", perform similar analysis for other vars
abs(forest.m1 |> coefficients()|> getElement("watermoisture2"))
abs(forest.m2 |> coefficients()|> getElement("watermoisture2") +
forest.m1 |> coefficients()|> getElement("watermoisture2"))
suggesting that both age
and watermoisture
have a much more pronounced effect on (normalised) canopyd
rather than on (normalised) defol
. Also, note that this methodology only focused on $\beta$'s. As all $p$-values suggested reasonable levels of statistical significance across all the explanatory variables examined, there is the working assumption that "all variables are equally important but have different effect sizes".
aggDefol
andcanopyd
to be on a similar scale? Also,ph
is used as a categorical variable in this code and I am doubtful that this is intentional or correct. Finally, usingdefol
in its "numeric state" might be more straightforward for immediate comparisons so the two models has response variables of the same family. $\endgroup$aggDefol
is a response variable inm1
but an explanatory variable inm2
. That makes the effect ofs(age)
andwatermoisture
inm2
compounded by any information we have inm1
byaggDefol
. It would be more straightforward to excludeaggDefol
fromm2
. $\endgroup$m2
is very badly mispecified. 0 to 100 in 10 steps and 50% is 90 or 100. That will never have normal residuals and should probably be another ordinal category model. Maybe with some aggregation for the lower values. $\endgroup$s(age)
andwatermoisture
is stronger onaggDefol
than oncanopyd
when givendefol
/aggDefol
information?" (Also, you can always usedefol
in a spline and avoid bucketing it but that's a minor point here.) $\endgroup$