##Load packages. Package 'MASS' contains robust regression function
library(foreign)
library(stats)
library(zStat)
library(zUtil)
library(MASS)
##Open data for Telo 2 paper (race-stratified analyses)
Telo <- read.spss("/Users/dleibel1/Documents/Telo1.sav", use.value.labels = TRUE, to.data.frame = TRUE)
##Only include AAs
TeloAA <- Telo[which(Telo$Race==1),]
Racism x Sex & Racism x SES were significant when all values were included.
OLS <- lm(tLength ~ TotDisc4*Sex + TotDisc4*SES + Sex*SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
summary(OLS)
##
## Call:
## lm(formula = tLength ~ TotDisc4 * Sex + TotDisc4 * SES + Sex *
## SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.75531 -0.41386 0.02086 0.38021 2.79074
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.9507957 0.4620543 12.879 < 2e-16 ***
## TotDisc4 -0.2115871 0.0633301 -3.341 0.00103 **
## Sex 0.5974890 0.2104320 2.839 0.00509 **
## SES -0.1281121 0.1826504 -0.701 0.48404
## Age0 -0.0057243 0.0059460 -0.963 0.33711
## CESimp 0.0014409 0.0057945 0.249 0.80393
## Waistimp -0.0002732 0.0034511 -0.079 0.93699
## SubCount -0.0814498 0.0468732 -1.738 0.08415 .
## TotDisc4:Sex 0.1359989 0.0580033 2.345 0.02024 *
## TotDisc4:SES 0.1745220 0.0609347 2.864 0.00473 **
## Sex:SES -0.3955949 0.2319102 -1.706 0.08994 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6969 on 164 degrees of freedom
## (7 observations deleted due to missingness)
## Multiple R-squared: 0.1885, Adjusted R-squared: 0.1391
## F-statistic: 3.81 on 10 and 164 DF, p-value: 0.0001211
However, after excluding the most extreme value (tLength = 2.60, < 4 sds below mean), interactions attenuated to p > .05
TeloAA <- Telo[which(Telo$Race==1&Telo$tLength>2.60),]
OLS <- lm(tLength ~ TotDisc4*Sex + TotDisc4*SES + Sex*SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
summary(OLS)
##
## Call:
## lm(formula = tLength ~ TotDisc4 * Sex + TotDisc4 * SES + Sex *
## SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.76461 -0.35541 0.01758 0.34678 2.72094
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.9454688 0.4550748 13.065 <2e-16 ***
## TotDisc4 -0.1330301 0.0700467 -1.899 0.0593 .
## Sex 0.5131220 0.2100596 2.443 0.0156 *
## SES -0.1561907 0.1802499 -0.867 0.3875
## Age0 -0.0065908 0.0058666 -1.123 0.2629
## CESimp 0.0011389 0.0057083 0.200 0.8421
## Waistimp -0.0001443 0.0033994 -0.042 0.9662
## SubCount -0.0587015 0.0470785 -1.247 0.2142
## TotDisc4:Sex 0.0887583 0.0602570 1.473 0.1427
## TotDisc4:SES 0.1210814 0.0638114 1.897 0.0595 .
## Sex:SES -0.2440694 0.2365361 -1.032 0.3037
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.6864 on 163 degrees of freedom
## (7 observations deleted due to missingness)
## Multiple R-squared: 0.137, Adjusted R-squared: 0.084
## F-statistic: 2.587 on 10 and 163 DF, p-value: 0.006189
To reduce the influence of the outlier(s) without excluding them, I’ll re-run the same analysis with all participants using robust regression (Huber M-estimator method)
TeloAA <- Telo[which(Telo$Race==1),]
Huber <- rlm(tLength ~ TotDisc4*Sex + TotDisc4*SES + Sex*SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
summary(Huber)
##
## Call: rlm(formula = tLength ~ TotDisc4 * Sex + TotDisc4 * SES + Sex *
## SES + Age0 + CESimp + Waistimp + SubCount, data = TeloAA)
## Residuals:
## Min 1Q Median 3Q Max
## -1.75603 -0.37920 0.03212 0.36399 2.95689
##
## Coefficients:
## Value Std. Error t value
## (Intercept) 6.1215 0.4494 13.6217
## TotDisc4 -0.2127 0.0616 -3.4529
## Sex 0.5618 0.2047 2.7447
## SES -0.1657 0.1776 -0.9329
## Age0 -0.0060 0.0058 -1.0413
## CESimp 0.0010 0.0056 0.1765
## Waistimp -0.0014 0.0034 -0.4225
## SubCount -0.0858 0.0456 -1.8829
## TotDisc4:Sex 0.1028 0.0564 1.8219
## TotDisc4:SES 0.1880 0.0593 3.1718
## Sex:SES -0.3284 0.2256 -1.4561
##
## Residual standard error: 0.56 on 164 degrees of freedom
## (7 observations deleted due to missingness)
To test significance, calculate p’s from above t-scores using the formula 2 * pt(-(|t|), df).
2 * pt(-(1.8219), 164) ##Racism x Sex was nonsignificant
## [1] 0.07029201
2 * pt(-(3.1718), 164) ##Racism x SES was significant
## [1] 0.001808668
Robust regression allowed us to retain all participants, and found that all but one of the previously significant interactions remained significant.