Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polynomial Terms and RWA #17

Open
JohnPap91 opened this issue Nov 27, 2023 · 3 comments
Open

Polynomial Terms and RWA #17

JohnPap91 opened this issue Nov 27, 2023 · 3 comments
Labels
question Further information is requested

Comments

@JohnPap91
Copy link

Hi all!

I am Ioannis, PhD student in marketing. I am interesting in estimating the relative weights of my variables in the following regression model:

Z ~ Xa + Ya + I(Xa^2) + Xa:Ya

As you can see the model has two variables, the interaction between them and the square of one of the two. When I try to implement in RWA,
I receive the same results as if I had calclulate Xa2 and XaYa before and then use them in the model (i.e., Z ~ Xa + Ya + Xa2 +XaYa). This way I receive the relative importance of each of them.

Yet, my question is whether I can take the relative importance of Xa and Ya overall, since these are the “basic” explanatory units in my case. This means for Xa its relative importance, plus its importance as Xa2 and as its importance in the interaction with Ya (maybe at some level of Ya). If yes, do you have some tips for the code I can use?

Thank you very much for your time!
Ioannis

@martinctc
Copy link
Owner

Hi @JohnPap91, thank you for the great question, and apologies for the delay in responding!

On whether you can take the relative importance of Xa and Ya overall, I can find the abstract of a paper by LeBreton et al. (2013) that I think covers strategies for high-order or interactive multiple regression models like the one you have mentioned, i.e. residualized relative importance analysis:

LeBreton, J. M., Tonidandel, S., & Krasikova, D. (2013). Residualized relative importance analysis: A technique for the comprehensive decomposition of variance in higher-order effects regression models. Organizational Research Methods, 16, 449–473. doi:10.1177/1094428113481065.

Since I don't have access to the paper, I'm unsure whether you can take the relative importance of Xa and Ya overall (e.g. by aggregating them), and moreover considerations such as the statistical significance of relative weights. This is a great question and I would like to investigate further myself.

Unfortunately I've not recently really had the capacity to update this package beyond its original implementation in RWA Web - but would certainly welcome any contributions to take the package beyond!

@stonid - wondering if this is a question you can help with? Thank you!

@martinctc martinctc added the question Further information is requested label Dec 10, 2023
@stonid
Copy link
Collaborator

stonid commented Dec 10, 2023

Hi @JohnPap91, @martinctc is correct. The article he mentions above describes the process for using higher-order terms. The good news is that the process requires you to do some initial data prep prior to running rwa. This means that once you do that, you can still use rwa to get the results you need.

@JohnPap91
Copy link
Author

Hi !

Thanks a lot for your answers. After reading a bit on the topic, I found residualRWA package, which I assumed it does this. Yet, still have not managed to do what I wanted. Its developer , Maikol Solis told me the following:

Basically, residualRWA can be used with the rcs transformation function in the rms package
(https://hbiostat.org/r/rms/).

In particular, you can use something like:

ex <- residualrwa(
response = "Y",
control = NULL,
fixed = NULL,
free = c("rcs(X1)", "rcs(X2)", "rcs(X3)"),
data = data,
include_interactions = TRUE,
boot_ci = TRUE,
n_boot = 5
)
where the rcs function is used to specify the restricted cubic spline transformation of the variables. You can see a dummy example here: https://github.com/harrelfe/rms/blob/master/inst/tests/rcs.r.

Yet, I am not sure how I can do this. Do you have any suggestions? Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants