You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a function (I've searched the API and can't find it but maybe have missed it) to compute variance explained? I'm using robust models from this package to compute p-values for correlations in the case of a single independent variable:
y = b0 + b1 * x
ideally I'd also want to compute the correaltion coefficient, which in the model above in the ols case is just sign(b1) * sqrt(R^2), but in this case I can't simply predict the responses and compute R^2 as per usual because of the potential for negative values.
I would use this one as it is stricly equivalent to R2 in the OLS case, but I don't know if it's guaranteed to be non-negative. If it is negative, it means the fit with a slope is worse than no fit, in this case, you can consider that R2=0.
But I am not sure this is what you want. If what you want is a signed correlation, it would be better to z-score y and X before doing the regression so the coefficients b0 and b1 are scaled. For OLS, z-scoring before the regression leads to a0 = 0 and a1 = Σxi yi which is the same as computing the Pearson correlation of the z-scored x and y.
Is there a function (I've searched the API and can't find it but maybe have missed it) to compute variance explained? I'm using robust models from this package to compute p-values for correlations in the case of a single independent variable:
ideally I'd also want to compute the correaltion coefficient, which in the model above in the ols case is just
sign(b1) * sqrt(R^2)
, but in this case I can't simply predict the responses and compute R^2 as per usual because of the potential for negative values.I see in the API one possibility is (i think)
but I'm wondering if there's potentially the same issue here?
The text was updated successfully, but these errors were encountered: