Page 8 - MEDIATION & MODERATION
P. 8

fita <- lm(M ~ X, data=Meddata)

summary(fita)

##

## Call:

## lm(formula = M ~ X, data = Meddata)

##

## Residuals:

## Min         1Q Median         3Q Max

## -9.5367 -3.4175 -0.4375 2.9032 16.4520

##

## Coefficients:

## Estimate Std. Error t value Pr(>|t|)

## (Intercept) 6.04494 13.41692 0.451 0.653

## X           0.66252 0.07634 8.678 8.87e-14 ***

## ---

## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

##

## Residual standard error: 4.854 on 98 degrees of freedom

## Multiple R-squared: 0.4346, Adjusted R-squared: 0.4288

## F-statistic: 75.31 on 1 and 98 DF, p-value: 8.872e-14

#3. Path B (M on Y, controlling for X)

fitb <- lm(Y ~ M + X, data=Meddata)

summary(fitb)

##

## Call:

## lm(formula = Y ~ M + X, data = Meddata)

##

## Residuals:

## Min         1Q Median         3Q Max

                                     8
   3   4   5   6   7   8   9   10   11   12   13