partial_and_semipartial_correlation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
partial_and_semipartial_correlation [2019/05/26 22:54] – [Semipartial cor] hkimscil | partial_and_semipartial_correlation [2019/05/26 23:05] – [Semipartial cor] hkimscil | ||
---|---|---|---|
Line 323: | Line 323: | ||
====== Semipartial cor ====== | ====== Semipartial cor ====== | ||
- | < | ||
- | > spcor.gpa.sat.clep | ||
- | | ||
- | 1 -0.09948786 0.7989893 -0.2645326 10 1 pearson | ||
- | > spcor.gpa.sat.clep$estimate^2 | ||
- | [1] 0.009897835 | ||
- | > </ | ||
- | |||
< | < | ||
> colnames(tests) <- c(" | > colnames(tests) <- c(" | ||
Line 365: | Line 357: | ||
> | > | ||
> install.packages(" | > install.packages(" | ||
- | WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: | ||
- | |||
- | https:// | ||
- | Installing package into ‘C:/ | ||
- | (as ‘lib’ is unspecified) | ||
- | trying URL ' | ||
- | Content type ' | ||
- | downloaded 29 KB | ||
- | |||
- | package ‘ppcor’ successfully unpacked and MD5 sums checked | ||
- | |||
- | The downloaded binary packages are in | ||
- | C: | ||
> library(ppcor) | > library(ppcor) | ||
Loading required package: MASS | Loading required package: MASS | ||
+ | |||
+ | > # regression test for semipartial correlation (holding clep constant) | ||
> spcor.gpa.sat.clep <- lm(gpa ~ res.lm.sat.clep) | > spcor.gpa.sat.clep <- lm(gpa ~ res.lm.sat.clep) | ||
> summary(spcor.gpa.sat.clep) | > summary(spcor.gpa.sat.clep) | ||
Line 400: | Line 381: | ||
Multiple R-squared: | Multiple R-squared: | ||
F-statistic: | F-statistic: | ||
- | |||
</ | </ | ||
+ | |||
+ | From the above: Multiple R-squared: 0.009898 | ||
+ | From the below: spcor.gpa.sat.clep%%$%%estimate^2: | ||
+ | |||
+ | < | ||
+ | > spcor.gpa.sat.clep | ||
+ | | ||
+ | 1 -0.09948786 0.7989893 -0.2645326 10 1 pearson | ||
+ | > spcor.gpa.sat.clep$estimate^2 | ||
+ | [1] 0.009897835 | ||
+ | > </ | ||
+ | |||
+ | |||
+ | |||
====== e.g., ====== | ====== e.g., ====== | ||
In this example, the two IVs are orthogonal to each other (not correlated with each other). Hence, regress res.y.x2 against x1 would not result in any problem. | In this example, the two IVs are orthogonal to each other (not correlated with each other). Hence, regress res.y.x2 against x1 would not result in any problem. |
partial_and_semipartial_correlation.txt · Last modified: 2023/05/31 08:56 by hkimscil