0
votes

I have a question related to multiple regression in R.

  1. How to get r (not R squared) from multiple regression. I think do square root of R squared is not the answer, because r may be a negative number. For linear regression, I know that I can run cor (correlation) to calculate r value, but how can I do it in multiple regression?

  2. How can I get partial r (i.e, to see how each independent variable contribute to the final prediction)?

1

1 Answers

1
votes
  1. As far as I know, it is impossible to calculate r from multiple regression as the formulas are different. If you want r, just calculate the correlation. If you want a correlation that is corrected for other independent variables (the way that regression also corrects), you want the partial r that you requested in your next question.
  2. There are multiple functions for partial correlations. For example, the pcor() function from the ggm package, or the pcor() function from the ppcor package.