Load libraries and data
HW Problem #1–Multiple Regression
##
## Call:
## lm(formula = JobPerformance ~ MathAbility + VerbalAbility, data = dat_jobmthvrb)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.25855 -0.44115 0.00281 0.46804 2.09224
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.053962 0.121837 25.07 <2e-16 ***
## MathAbility 0.086854 0.002785 31.19 <2e-16 ***
## VerbalAbility -0.048959 0.002811 -17.42 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6824 on 997 degrees of freedom
## Multiple R-squared: 0.4956, Adjusted R-squared: 0.4946
## F-statistic: 489.8 on 2 and 997 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = scale(JobPerformance) ~ scale(MathAbility) + scale(VerbalAbility),
## data = dat_jobmthvrb)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.35295 -0.45959 0.00292 0.48761 2.17969
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -4.776e-16 2.248e-02 0.00 1
## scale(MathAbility) 8.977e-01 2.878e-02 31.19 <2e-16 ***
## scale(VerbalAbility) -5.013e-01 2.878e-02 -17.42 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7109 on 997 degrees of freedom
## Multiple R-squared: 0.4956, Adjusted R-squared: 0.4946
## F-statistic: 489.8 on 2 and 997 DF, p-value: < 2.2e-16
## JobPerformance MathAbility VerbalAbility
## JobPerformance 1.000 0.585 0.059
## MathAbility 0.585 1.000 0.624
## VerbalAbility 0.059 0.624 1.000
Answer: The overall model (with scaled variables) R-square is .4956, and the overall model fit is significant (p < .01). Standardized regression coefficients for scaled math ability (\(\beta\) = .8977) and for scaled verbal ability (\(\beta\) = -.5013) mean that for every unit of change in math ability, job performance increases by .8977 units. For every unit of change in verbal ability, job performance decreases by .5013 units.
The correlation between verbal ability and job performance is positive and weak (r = .059), while the math ability to job performance relationship is moderate and positive (r = .585). The math ability to job performance correlation is of the same direction, positive, as the scaled math ability regression coefficient. However, the regression coefficient of scaled verbal ability is negative, a change in direction from the non-standardized correlation. This is an example of suppression. To formally test for suppression effects, I find that the overall model R2, .4956, is greater than .3964, the sum of the \(\beta\) coefficients of scaled math ability and verbal ability, .8977 and -.5013 respectively. This confirms that suppression is in effect.
HW Problem #2–Continuous x Continuous Moderation
In a sample of middle aged and older adults (N = 10,000), I tested whether the variable of difficulties in instrumental activities (iadla) moderates the association between the predictor of age and the outcome, quality of life (casp). I centered age and iadla before running the model with interaction effects. Little variability was explained with this model: R2 = .0826; F(3,9996) = 299.8; though the overall model was significant (p < .001). Considering the very large sample size, this result is understandable. In this model, the interaction between age and iadla (both centered) was significant (\(\beta\)agexiadla = 0.037; p < .01), as were the conditional effects (\(\beta\)age = -0.078 and \(\beta\)iadla = -3.686; for both, p < .001). Overall in this model, iadla moderated the effect of age on casp such that for every one-unit increase in age and iadla (both centered), the quality of life was predicted to decrease 3.727 units from its mean of 36.982. I then probed the interaction with Johnson-Neyman significance region testing to find the region of the moderator over which the age -> casp association is significant or non-significant. The association was significant only when the centered iadla value was at or below 1.05 (p < .01). Additionally, the direction of the effect of age on casp decreased in strength up to the iadla value of 2.10, at which point the effect also changed from negative to positive. This indicates that difficulty in instrumental activities significantly amplifies the effect of age on quality of life only at its lower levels (< 1.05). However, at levels of 2.10 or higher, iadla appears to lessen the effect of age on quality of life, but not to a significant degree. Overall, the model indicate that most of the variation in quality of life is due to the effects of higher age and greater difficulties in instrumental activities.
Steps:
dat_SHARE$age_ctr = scale(dat_SHARE$age, scale=FALSE)
dat_SHARE$iadla_ctr = scale(dat_SHARE$iadla, scale=FALSE)
##
## Call:
## lm(formula = casp ~ age_ctr * iadla_ctr, data = dat_SHARE)
##
## Residuals:
## Min 1Q Median 3Q Max
## -22.9620 -4.0995 0.5738 4.6220 17.1308
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 36.982495 0.062518 591.547 < 2e-16 ***
## age_ctr -0.077885 0.006161 -12.641 < 2e-16 ***
## iadla_ctr -3.686338 0.209129 -17.627 < 2e-16 ***
## age_ctr:iadla_ctr 0.036999 0.013127 2.818 0.00484 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.075 on 9996 degrees of freedom
## Multiple R-squared: 0.08255, Adjusted R-squared: 0.08227
## F-statistic: 299.8 on 3 and 9996 DF, p-value: < 2.2e-16
## JOHNSON-NEYMAN INTERVAL
##
## When iadla_ctr is OUTSIDE the interval [1.05, 24.49], the slope of age_ctr
## is p < .01.
##
## Note: The range of observed values of iadla_ctr is [-0.10, 2.90]
## iadla_ctr Slope of age_ctr Lower Upper Significance
## 1 -0.545 -0.098 -0.123 -0.074 Significant
## 11 -0.506 -0.097 -0.120 -0.073 Significant
## 21 -0.467 -0.095 -0.118 -0.073 Significant
## 31 -0.428 -0.094 -0.115 -0.072 Significant
## 41 -0.389 -0.092 -0.113 -0.072 Significant
## 51 -0.350 -0.091 -0.111 -0.071 Significant
## 61 -0.311 -0.089 -0.109 -0.070 Significant
## 71 -0.272 -0.088 -0.106 -0.070 Significant
## 81 -0.233 -0.087 -0.104 -0.069 Significant
## 91 -0.194 -0.085 -0.102 -0.068 Significant
## 101 -0.155 -0.084 -0.100 -0.067 Significant
## 111 -0.117 -0.082 -0.099 -0.066 Significant
## 121 -0.078 -0.081 -0.097 -0.065 Significant
## 131 -0.039 -0.079 -0.095 -0.063 Significant
## 141 0.000 -0.078 -0.094 -0.062 Significant
## 151 0.039 -0.076 -0.092 -0.061 Significant
## 161 0.078 -0.075 -0.091 -0.059 Significant
## 171 0.117 -0.074 -0.090 -0.057 Significant
## 181 0.156 -0.072 -0.089 -0.055 Significant
## 191 0.195 -0.071 -0.088 -0.054 Significant
## 201 0.234 -0.069 -0.087 -0.052 Significant
## 211 0.273 -0.068 -0.086 -0.050 Significant
## 221 0.312 -0.066 -0.085 -0.047 Significant
## 231 0.351 -0.065 -0.085 -0.045 Significant
## 241 0.390 -0.063 -0.084 -0.043 Significant
## 251 0.429 -0.062 -0.083 -0.041 Significant
## 261 0.468 -0.061 -0.083 -0.038 Significant
## 271 0.507 -0.059 -0.082 -0.036 Significant
## 281 0.546 -0.058 -0.082 -0.034 Significant
## 291 0.585 -0.056 -0.081 -0.031 Significant
## 301 0.624 -0.055 -0.081 -0.029 Significant
## 311 0.662 -0.053 -0.081 -0.026 Significant
## 321 0.701 -0.052 -0.080 -0.024 Significant
## 331 0.740 -0.050 -0.080 -0.021 Significant
## 341 0.779 -0.049 -0.080 -0.018 Significant
## 351 0.818 -0.048 -0.079 -0.016 Significant
## 361 0.857 -0.046 -0.079 -0.013 Significant
## 371 0.896 -0.045 -0.079 -0.011 Significant
## 381 0.935 -0.043 -0.078 -0.008 Significant
## 391 0.974 -0.042 -0.078 -0.005 Significant
## 401 1.013 -0.040 -0.078 -0.003 Significant
## 411 1.052 -0.039 -0.078 0.000 Significant
## 421 1.091 -0.038 -0.077 0.002 Insignificant
## 431 1.130 -0.036 -0.077 0.005 Insignificant
## 441 1.169 -0.035 -0.077 0.008 Insignificant
## 451 1.208 -0.033 -0.077 0.010 Insignificant
## 461 1.247 -0.032 -0.077 0.013 Insignificant
## 471 1.286 -0.030 -0.076 0.016 Insignificant
## 481 1.325 -0.029 -0.076 0.018 Insignificant
## 491 1.364 -0.027 -0.076 0.021 Insignificant
## 501 1.403 -0.026 -0.076 0.024 Insignificant
## 511 1.441 -0.025 -0.076 0.027 Insignificant
## 521 1.480 -0.023 -0.075 0.029 Insignificant
## 531 1.519 -0.022 -0.075 0.032 Insignificant
## 541 1.558 -0.020 -0.075 0.035 Insignificant
## 551 1.597 -0.019 -0.075 0.037 Insignificant
## 561 1.636 -0.017 -0.075 0.040 Insignificant
## 571 1.675 -0.016 -0.075 0.043 Insignificant
## 581 1.714 -0.014 -0.074 0.045 Insignificant
## 591 1.753 -0.013 -0.074 0.048 Insignificant
## 601 1.792 -0.012 -0.074 0.051 Insignificant
## 611 1.831 -0.010 -0.074 0.054 Insignificant
## 621 1.870 -0.009 -0.074 0.056 Insignificant
## 631 1.909 -0.007 -0.074 0.059 Insignificant
## 641 1.948 -0.006 -0.073 0.062 Insignificant
## 651 1.987 -0.004 -0.073 0.064 Insignificant
## 661 2.026 -0.003 -0.073 0.067 Insignificant
## 671 2.065 -0.001 -0.073 0.070 Insignificant
## 681 2.104 0.000 -0.073 0.073 Insignificant
## 691 2.143 0.001 -0.073 0.075 Insignificant
## 701 2.182 0.003 -0.072 0.078 Insignificant
## 711 2.221 0.004 -0.072 0.081 Insignificant
## 721 2.259 0.006 -0.072 0.084 Insignificant
## 731 2.298 0.007 -0.072 0.086 Insignificant
## 741 2.337 0.009 -0.072 0.089 Insignificant
## 751 2.376 0.010 -0.072 0.092 Insignificant
## 761 2.415 0.011 -0.072 0.094 Insignificant
## 771 2.454 0.013 -0.071 0.097 Insignificant
## 781 2.493 0.014 -0.071 0.100 Insignificant
## 791 2.532 0.016 -0.071 0.103 Insignificant
## 801 2.571 0.017 -0.071 0.105 Insignificant
## 811 2.610 0.019 -0.071 0.108 Insignificant
## 821 2.649 0.020 -0.071 0.111 Insignificant
## 831 2.688 0.022 -0.071 0.114 Insignificant
## 841 2.727 0.023 -0.070 0.116 Insignificant
## 851 2.766 0.024 -0.070 0.119 Insignificant
## 861 2.805 0.026 -0.070 0.122 Insignificant
## 871 2.844 0.027 -0.070 0.125 Insignificant
## 881 2.883 0.029 -0.070 0.127 Insignificant
## 891 2.922 0.030 -0.070 0.130 Insignificant
## 901 2.961 0.032 -0.070 0.133 Insignificant
## 911 3.000 0.033 -0.069 0.136 Insignificant
## 921 3.038 0.035 -0.069 0.138 Insignificant
## 931 3.077 0.036 -0.069 0.141 Insignificant
## 941 3.116 0.037 -0.069 0.144 Insignificant
## 951 3.155 0.039 -0.069 0.147 Insignificant
## 961 3.194 0.040 -0.069 0.149 Insignificant
## 971 3.233 0.042 -0.069 0.152 Insignificant
## 981 3.272 0.043 -0.068 0.155 Insignificant
## 991 3.311 0.045 -0.068 0.158 Insignificant
HW Problem #3
In multiple regression with moderation, “unique” effects are out of the picture when an interaction term is added. The linear regression equation Y = b0 + b1X1 + b2X2 + e contains two unique effects, b1 and b2. Adding an interaction term, b3X1X2, means that b1 is no longer unique, but is now the effect of X1 on Y, conditional (dependent) on X2 being zero. The reverse is also true. And if X2 ≠ 0 (and b3 is also not zero), the effect of X1 is conditional upon the value of X2, whatever that is.
Y = β0 + β1X1 – β2X2 – β3X1X2
β0 = 0.01, intercept, predicted standardized Y value when all predictors are zero
β1 = 0.70, the effect of X1 on Y, conditional upon X2
β2 = 1.50, the effect of X2 on Y, conditional upon X1
β3 = 0.10, interaction effect, multiplicative effect of X2 and X1 on Y
Y =0.01+0-0-0; Y=0.01 (intercept) when X1 and X2 are zero
Y = 0.01 + 0.70X1 –1.50X2 – 0.10X1X2
Y = 0.01 + 0.70(1) –1.50(1) – 0.10(1)(1)
Y = -0.89 if both X1 and X2 increase by 1 SD, meaning we expect a 0.9 decrease in our outcome Y.
Y = 0.01 + 0.70(2.5) –1.50(-0.5) – 0.10(2.5)(-0.5)
Y = 0.01 + 1.75 + 0.75 + 0.125
Y = 2.635 if X1 increases by 2.5 SD and X2 decreases by 0.5 SD, meaning we expect a 2.625 increase in our outcome Y.