I am analyzing a cross-sectional data and ran a multiple linear regression using a variable called 'fit' as a predictor while adjusting for covariates using 3dMVM script below.
I then would like to run interaction between sex and fit. Could you please advise how the script should be modified to obtain the interaction between sex and fit?
Incorporating the covariate fit already introduces a significant level of complexity. A regression model entails more intricacies than those typically covered in conventional textbooks. Therefore, it is important to exercise caution when considering additional covariates unless all interrelationships are thoroughly understood and clearly delineated. Given that I have no knowledge about the nature of those variables, it is difficult for me to provide specific suggestions at this time.
I was able to solve this issue thanks to Gang's help. For those who might experience the same issue, the main issue for this thread was that I put 1 and -1 for the variable 'sex'. However, it should be either male or female under datatable.
Also, I had no packaged called 'afex' installed.
updating R_LD_LIBRARY_PATH ...
Error in library("afex") : there is no package called ‘afex’
Execution halted
So I ran rPkgsInstall -pkgs ALL which installed all the packages. After that, I ran the 3dMVM script and it is running.
Thanks again for Gang for all the help!
Best,
JW
1 Like
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.