# read in part 1 data
Part1 <- read.csv("../../data/one_shot_trust_long.csv")
# read in part 2 data
Part2 <- read.csv("../../data/reputation_study_part2.csv")
#Exclude pilot data from Part 2
N <- dim(Part2)[1]
Part2 <- Part2[39:N,] #Take out what we know are test trials##Resolve pID/WelcomeCode discrepancies discovered in the Random Trial Bonus script (in same folder)
#Convert emails and welcome code to character in order to perform operation below
Part2$Email <- as.character(Part2$Email)
Part2$WelcomeCode <- as.character(Part2$WelcomeCode)
#Manually replace Part 2 Welcome Code with correct code from Part 1 pID
Part2$WelcomeCode[Part2$Email == "theresaslater@gmail.com"] <- as.character(Part1$pID[Part1$email == "theresaslater@gmail.com"])## Warning in Part2$WelcomeCode[Part2$Email == "theresaslater@gmail.com"] <-
## as.character(Part1$pID[Part1$email == : number of items to replace is not a
## multiple of replacement length
Part2$WelcomeCode[Part2$Email == "tammrafoster@gmail.com"] <- as.character(Part1$pID[Part1$email == "tammrafoster@gmail.com"])## Warning in Part2$WelcomeCode[Part2$Email == "tammrafoster@gmail.com"] <-
## as.character(Part1$pID[Part1$email == : number of items to replace is not a
## multiple of replacement length
Part2$WelcomeCode[Part2$Email == "jrtravagline@gmail.com"] <- as.character(Part1$pID[Part1$email == "jrtravagline@gmail.com"])## Warning in Part2$WelcomeCode[Part2$Email == "jrtravagline@gmail.com"] <-
## as.character(Part1$pID[Part1$email == : number of items to replace is not a
## multiple of replacement length
Part2$WelcomeCode[Part2$Email == "mollyki@stanford.edu"] <- as.character(Part1$pID[Part1$email == "mollyki@stanford.edu"])## Warning in Part2$WelcomeCode[Part2$Email == "mollyki@stanford.edu"] <-
## as.character(Part1$pID[Part1$email == : number of items to replace is not a
## multiple of replacement length
# keep relevant columns from Part 2
Part2 <- Part2 %>%
dplyr::select("WelcomeCode",
"Age",
"Gender",
"Education",
contains("SES"),
contains("Trust"),
contains("Image"),
contains("RepStability"),
contains("SchwartzValues"),
# select actual and ideal affect variables using regex
# first character is "a" or "i", number 1-4 as second character, and underscore
matches("^[a1-4\\_\\]{2}"), matches("^[i1-4\\_\\]{2}"))# turn pID into characters (WelcomeCode from Part 2 has already been done above)
Part1$pID <- as.character(Part1$pID)
Data <- left_join(Part1, Part2, by = c("pID" = "WelcomeCode")) # combine part 1 and part 2 by pID/WelcomeCodecols.num <- c("Age",
"Trust1","Trust2", "Trust3", "Trust4", "Trust5",
"Trust6",
"SelfImage1", "SelfImage2", "SelfImage3", "SelfImage4", "SelfImage5", "SelfImage6",
"OtherImage1", "OtherImage2", "OtherImage3", "OtherImage4", "OtherImage5", "OtherImage6",
"RepStability1", "RepStability2", "RepStability3", "RepStability4", "RepStability5",
"SchwartzValues_1", "SchwartzValues_2", "SchwartzValues_3", "SchwartzValues_4", "SchwartzValues_5", "SchwartzValues_6", "SchwartzValues_7", "SchwartzValues_8", "SchwartzValues_9", "SchwartzValues_10")
Data[cols.num] <- sapply(Data[cols.num],as.character)
Data[cols.num] <- sapply(Data[cols.num],as.numeric)## Warning in lapply(X = X, FUN = FUN, ...): NAs introduced by coercion
Data <- Data %>%
# select participants 30 years old and younger
filter(Age <= 30 & Age >= 18) %>%
# create factors
mutate(Gender = factor(Gender,
levels = c(1, 2),
labels = c("Male", "Female")),
Education = factor(Education,
levels = c(1:9),
labels = c("Less than high school",
"High School/GED",
"Some college (not currently enrolled)",
"Some college (currently enrolled)",
"Associates degree",
"BA/BS degree",
"Master's Degree",
"Doctoral Degree",
"Professional Degree")),
FamSES2 = factor(FamSES2,
levels = c(1:8),
labels = c("<10K",
"10-20K",
"20-30K",
"30-40K",
"40-50K",
"50-75K",
"75-100K",
">100K")),
reputation = factor(reputation,
levels = c("low", "mod", "high")),
expression = factor(expression,
levels = c("neut", "calm", "exci")),
race = factor(race,
levels = c("asian", "white")),
sex = factor(sex,
levels = c("female", "male")))
Data <- Data %>%
group_by(pID) %>%
# calculate SD in amount given
mutate(responseSD = sd(response, na.rm = T)) %>%
# if SD = 0, make responseNoVar equal to 1 else 0
mutate(responseNoVar = ifelse(responseSD == 0, 1, 0)) #if SD for all trials was 0, make the responseNoVar equal to 1. If not 0, then make it equal to 0 # i1_1 enthusiastic
# i1_7 excited
# i1_9 elated
# i2_9 euphoric
# i1_6 relaxed
# i3_3 calm
# i3_9 peaceful
# i3_10 serene
# Compute actual and ideal affect scores
Data <- Data %>%
mutate_at(vars(a1_1:i4_9), list(~ as.numeric(as.character(.)))) %>% #Turn affect variables from factor to numeric
group_by(pID) %>%
rowwise() %>%
mutate(aHAP = mean(c(a1_1, a1_7, a1_9, a2_9), na.rm = T),
aLAP = mean(c(a1_6, a3_3, a3_9, a3_10), na.rm = T),
iHAP = mean(c(i1_1, i1_7, i1_9, i2_9), na.rm = T),
iLAP = mean(c(i1_6, i3_3, i3_9, i3_10), na.rm = T))
#Ipsatize actual and ideal (separately)
Ipsatized_Actual <- Data %>%
dplyr::select(pID, a1_1:a4_9) %>% #Only select actual affect variables
ungroup() %>%
mutate(aSD = apply(.[,2:ncol(.)], na.rm = T, 1, sd)) %>% #Compute rowwise SD
mutate(aMean = rowMeans(dplyr::select(., contains("_")), na.rm = T)) %>% #Compute rowwise means
mutate(a_enthus_i = (a1_1 - aMean)/aSD, #Ipsatize enthusiastic
a_excited_i = (a1_7 - aMean)/aSD, #Ipsatize excited
a_elated_i = (a1_9 - aMean)/aSD, #Ipsatize elated
a_euphoric_i = (a2_9 - aMean)/aSD, #Ipsatize euphoric
a_relaxed_i = (a1_6 - aMean)/aSD, #Ipsatize relaxed
a_calm_i = (a3_3 - aMean)/aSD, #Ipsatize calm
a_peaceful_i = (a3_9 - aMean)/aSD, #Ipsatize peaceful
a_serene_i = (a3_10 - aMean)/aSD) %>% #Ipsatize serene
rowwise %>%
mutate(aHAP_i = mean(c(a_enthus_i, a_excited_i, a_elated_i, a_euphoric_i), na.rm = T), #Compute ipsatized HAP
aLAP_i = mean(c(a_relaxed_i, a_calm_i, a_peaceful_i, a_serene_i), na.rm = T)) %>% #Compute ipsatized LAP
dplyr::select(pID, aHAP_i, aLAP_i) %>% #Keep only the ipsatized HAP and LAP scores
distinct()
Ipsatized_Ideal <- Data %>%
dplyr::select(pID, i1_1:i4_9) %>% #Only select ideal affect variables
ungroup() %>%
mutate(iSD = apply(.[,2:ncol(.)], na.rm = T, 1, sd)) %>% #Compute rowwise SD
mutate(iMean = rowMeans(dplyr::select(., contains("_")), na.rm = T)) %>% #Compute rowwise means
mutate(i_enthus_i = (i1_1 - iMean)/iSD, #Ipsatize enthusiastic
i_excited_i = (i1_7 - iMean)/iSD, #Ipsatize excited
i_elated_i = (i1_9 - iMean)/iSD, #Ipsatize elated
i_euphoric_i = (i2_9 - iMean)/iSD, #Ipsatize euphoric
i_relaxed_i = (i1_6 - iMean)/iSD, #Ipsatize relaxed
i_calm_i = (i3_3 - iMean)/iSD, #Ipsatize calm
i_peaceful_i = (i3_9 - iMean)/iSD, #Ipsatize peaceful
i_serene_i = (i3_10 - iMean)/iSD) %>% #Ipsatize serene
rowwise %>%
mutate(iHAP_i = mean(c(i_enthus_i, i_excited_i, i_elated_i, i_euphoric_i), na.rm = T), #Compute ipsatized HAP
iLAP_i = mean(c(i_relaxed_i, i_calm_i, i_peaceful_i, i_serene_i), na.rm = T)) %>% #Compute ipsatized LAP
dplyr::select(pID, iHAP_i, iLAP_i) %>% #Keep only the ipsatized HAP and LAP scores
distinct()
Data <- left_join(Data, Ipsatized_Actual, by = "pID") #Add ipsatized actual affect scores to original dataframe
Data <- left_join(Data, Ipsatized_Ideal, by = "pID") #Add ipsatized ideal affect scores to original dataframe#General Trust Scale
Data <- Data %>%
ungroup() %>%
mutate(GeneralTrust = rowMeans(dplyr::select(., starts_with("Trust")), na.rm = T)) #Compute mean
#Importance of Social Image - Self
Data <- Data %>%
ungroup() %>%
mutate(SelfImage = rowMeans(dplyr::select(., starts_with("SelfImage")), na.rm = T)) #Compute mean
#Importance of Social Image - Other
Data <- Data %>%
ungroup() %>%
mutate(OtherImage = rowMeans(dplyr::select(., starts_with("OtherImage")), na.rm = T)) #Compute mean
#Reputation Stability Mindset
Data <- Data %>%
ungroup() %>%
mutate(RepStability = rowMeans(dplyr::select(., starts_with("RepStability")), na.rm = T)) #Compute mean| responseNoVar | n |
|---|---|
| 0 | 106 |
| 1 | 6 |
| pID | response |
|---|---|
| 0m6kq8tbb8mp | 10 |
| 1sv9s4ko8o9i | 5 |
| 2mivlx9sx17 | 10 |
| 9tpuiq3jo39 | 10 |
| m0ce8ox9id | 3 |
| ql9isp4x0hl | 10 |
Total sample size (before excluding no variation) = 112.
Total sample size (after excluding no variation) = 106.
| Age_Mean | Age_SD |
|---|---|
| 25.28 | 3.595 |
| Gender | n |
|---|---|
| Male | 43 |
| Female | 64 |
| NA | 5 |
| Education | n |
|---|---|
| High School/GED | 2 |
| Some college (not currently enrolled) | 9 |
| Some college (currently enrolled) | 21 |
| Associates degree | 3 |
| BA/BS degree | 56 |
| Master’s Degree | 21 |
| FamSES2 | n |
|---|---|
| <10K | 1 |
| 20-30K | 18 |
| 30-40K | 6 |
| 40-50K | 10 |
| 50-75K | 19 |
| 75-100K | 21 |
| >100K | 36 |
| NA | 1 |
| iHAP_Mean | iHAP_SD | iLAP_Mean | iLAP_SD | iHAPi_Mean | iHAPi_SD | iLAPi_Mean |
|---|---|---|---|---|---|---|
| 3.42 | 0.7647 | 3.92 | 0.743 | 0.6492 | 0.3682 | 1.018 |
| iLAPi_SD |
|---|
| 0.4154 |
| aHAP_Mean | aHAP_SD | aLAP_Mean | aLAP_SD | aHAPi_Mean | aHAPi_SD | aLAPi_Mean |
|---|---|---|---|---|---|---|
| 2.71 | 0.7722 | 2.975 | 0.7934 | 0.1138 | 0.5882 | 0.3607 |
| aLAPi_SD |
|---|
| 0.6639 |
| trust_mean | trust_sd |
|---|---|
| 3.614 | 0.6806 |
| repStability_mean | repStability_sd |
|---|---|
| 3.394 | 1.012 |
Ideal HAP: 0.76
Ideal LAP: 0.8
Actual HAP: 0.85
Actual LAP: 0.84
| give_Mean | give_SD |
|---|---|
| 4.279 | 2.122 |
| expression | give_Mean | give_SD |
|---|---|---|
| neut | 4.042 | 2.129 |
| calm | 4.113 | 2.06 |
| exci | 4.049 | 2.04 |
| reputation | give_Mean | give_SD |
|---|---|---|
| low | 2.021 | 0.02726 |
| mod | 4.012 | 0.1274 |
| high | 6.171 | 0.06332 |
| expression | reputation | mean | stdv |
|---|---|---|---|
| neut | low | 1.989 | 0.6827 |
| neut | mod | 3.896 | 0.8138 |
| neut | high | 6.241 | 0.6913 |
| calm | low | 2.035 | 0.7117 |
| calm | mod | 4.149 | 0.6803 |
| calm | high | 6.156 | 0.6094 |
| exci | low | 2.038 | 0.667 |
| exci | mod | 3.992 | 0.7104 |
| exci | high | 6.117 | 0.7236 |
Across all reference groups:
High repuation > Moderate reputation > Low reputation (all p < .001)
Higher SES predicted more giving (all p < .001)
Low vs. Mod Reputation:
The difference between low and moderate reputation is higher for calm than for excited targets. (p = .02)
The difference between low and moderate reputation is higher for asian than for white targets. (p = .01)
Three-factor interaction: The effect modReputation:expressionExcited is different for white compared to asian recipients. (p = .03)
Mod vs. High Reputation:
The difference between moderate and high reputation is higher for excited than for calm targets. (p = .008)
Three-factor interaction: The effect highReputation:expressionExcited is different for white compared to asian recipients. (p = .004)
Within high reputation:
The difference between excited and calm recipients is higher for asian than for white targets. (p = .007)
# subset data to just expression levels "calm" vs. "excited" (without "neutral")
Data_noNeut <- Data_noVar %>%
filter(expression != "neut") %>%
# refactor to exclude neutral
mutate(expression = factor(expression, levels = c("calm", "exci")))
# check levels
contrasts(Data_noNeut$expression)## exci
## calm 0
## exci 1
# convert SES from factor into numeric
Data_noNeut$FamSES2num <- as.numeric(Data_noNeut$FamSES2)#Just the intercept
model1 <- lmer(data = Data_noNeut, response ~ 1 + (1|pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 23193.4 23213.0 -11593.7 23187.4 5085
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.2452 -0.5599 -0.0419 0.6286 2.9512
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.383 1.839
## Residual 5.191 2.278
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 4.0810 0.1815 106.0000 22.49 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Global effect of reputation
model2 <- lmer(data = Data_noNeut, response ~ 1 + reputation + (1|pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + reputation + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19207.4 19240.1 -9598.7 19197.4 5083
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6803 -0.6089 -0.0365 0.5811 4.5554
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.331 1.527
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 2.037e+00 1.840e-01 1.120e+02 11.07 <2e-16 ***
## reputationmod 2.034e+00 5.242e-02 4.982e+03 38.79 <2e-16 ***
## reputationhigh 4.100e+00 5.242e-02 4.982e+03 78.20 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm
## reputatinmd -0.142
## reputatnhgh -0.142 0.500
#Model comparison for gloabl effect of reputation
anova(model1, model2)## Data: Data_noNeut
## Models:
## model1: response ~ 1 + (1 | pID)
## model2: response ~ 1 + reputation + (1 | pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model1 3 23193 23213 -11593.7 23187
## model2 5 19207 19240 -9598.7 19197 3990 2 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Adding effect of expression
model3 <- lmer(data = Data_noNeut, response ~ 1 + reputation + expression + (1|pID), REML=FALSE)
summary(model3)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + reputation + expression + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19207.2 19246.4 -9597.6 19195.2 5082
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.7025 -0.6147 -0.0421 0.5813 4.5353
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.330 1.526
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 2.06879 0.18524 115.02053 11.168 <2e-16 ***
## reputationmod 2.03361 0.05241 4982.00000 38.800 <2e-16 ***
## reputationhigh 4.09965 0.05241 4982.00000 78.218 <2e-16 ***
## expressionexci -0.06447 0.04279 4982.00000 -1.506 0.132
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnh
## reputatinmd -0.141
## reputatnhgh -0.141 0.500
## expressinxc -0.116 0.000 0.000
#Model comparison for global effect of expression
anova(model2, model3)## Data: Data_noNeut
## Models:
## model2: response ~ 1 + reputation + (1 | pID)
## model3: response ~ 1 + reputation + expression + (1 | pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model2 5 19207 19240 -9598.7 19197
## model3 6 19207 19246 -9597.6 19195 2.2687 1 0.132
#Adding interaction between reputation & expression
model4 <- lmer(data = Data_noNeut, response ~ 1 + reputation*expression + (1|pID), REML=FALSE)
summary(model4)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + reputation * expression + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19208.7 19261.0 -9596.3 19192.7 5080
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6953 -0.6084 -0.0365 0.5902 4.5584
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.328 1.526
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 2.035e+00 1.877e-01 1.212e+02 10.844
## reputationmod 2.113e+00 7.411e-02 4.982e+03 28.517
## reputationhigh 4.120e+00 7.411e-02 4.982e+03 55.601
## expressionexci 2.358e-03 7.411e-02 4.982e+03 0.032
## reputationmod:expressionexci -1.592e-01 1.048e-01 4.982e+03 -1.519
## reputationhigh:expressionexci -4.127e-02 1.048e-01 4.982e+03 -0.394
## Pr(>|t|)
## (Intercept) <2e-16 ***
## reputationmod <2e-16 ***
## reputationhigh <2e-16 ***
## expressionexci 0.975
## reputationmod:expressionexci 0.129
## reputationhigh:expressionexci 0.694
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnh exprss rpttnm:
## reputatinmd -0.197
## reputatnhgh -0.197 0.500
## expressinxc -0.197 0.500 0.500
## rpttnmd:xpr 0.140 -0.707 -0.354 -0.707
## rpttnhgh:xp 0.140 -0.354 -0.707 -0.707 0.500
#Model comparison for interaction between reputation & expression
anova(model3, model4)## Data: Data_noNeut
## Models:
## model3: response ~ 1 + reputation + expression + (1 | pID)
## model4: response ~ 1 + reputation * expression + (1 | pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model3 6 19207 19246 -9597.6 19195
## model4 8 19209 19261 -9596.3 19193 2.4853 2 0.2886
#Just the intercept
model1 <- lmer(data = Data_noNeut, response ~ 1 + (1|pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 23193.4 23213.0 -11593.7 23187.4 5085
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.2452 -0.5599 -0.0419 0.6286 2.9512
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.383 1.839
## Residual 5.191 2.278
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 4.0810 0.1815 106.0000 22.49 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Main effect of expression
model2 <- lmer(data = Data_noNeut, response ~ 1 + expression + (1|pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + expression + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 23194.4 23220.5 -11593.2 23186.4 5084
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.2597 -0.5599 -0.0460 0.6322 2.9657
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.383 1.839
## Residual 5.190 2.278
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 4.11321 0.18428 112.66507 22.320 <2e-16 ***
## expressionexci -0.06447 0.06388 4982.00000 -1.009 0.313
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr)
## expressinxc -0.173
#Model comparison for main effect of expression
anova(model1, model2)## Data: Data_noNeut
## Models:
## model1: response ~ 1 + (1 | pID)
## model2: response ~ 1 + expression + (1 | pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model1 3 23193 23213 -11594 23187
## model2 4 23194 23220 -11593 23186 1.0183 1 0.3129
#Adding effect of reputation
model3 <- lmer(data = Data_noNeut, response ~ 1 + reputation + expression + (1|pID), REML=FALSE)
summary(model3)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ 1 + reputation + expression + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19207.2 19246.4 -9597.6 19195.2 5082
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.7025 -0.6147 -0.0421 0.5813 4.5353
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.330 1.526
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 2.06879 0.18524 115.02053 11.168 <2e-16 ***
## reputationmod 2.03361 0.05241 4982.00000 38.800 <2e-16 ***
## reputationhigh 4.09965 0.05241 4982.00000 78.218 <2e-16 ***
## expressionexci -0.06447 0.04279 4982.00000 -1.506 0.132
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnh
## reputatinmd -0.141
## reputatnhgh -0.141 0.500
## expressinxc -0.116 0.000 0.000
#Model comparison for main effect of reputation
anova(model2, model3)## Data: Data_noNeut
## Models:
## model2: response ~ 1 + expression + (1 | pID)
## model3: response ~ 1 + reputation + expression + (1 | pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model2 4 23194 23220 -11593.2 23186
## model3 6 19207 19246 -9597.6 19195 3991.2 2 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# reputation only
# participant gender and ses are included as covariates
model1 <- lmer(data = Data_noNeut, response ~ reputation + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + Gender + FamSES2num + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.7 18523.2 -9231.9 18463.7 4889
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6429 -0.6330 -0.0508 0.5732 4.5275
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.342 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) -1.05482 0.55439 102.63765 -1.903 0.0599 .
## reputationmod 2.00858 0.05357 4794.00010 37.493 < 2e-16 ***
## reputationhigh 4.03370 0.05357 4794.00010 75.295 < 2e-16 ***
## GenderFemale 0.55005 0.38192 101.99973 1.440 0.1529
## FamSES2num 0.45376 0.10109 101.99972 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnh GndrFm
## reputatinmd -0.048
## reputatnhgh -0.048 0.500
## GenderFemal 0.173 0.000 0.000
## FamSES2num -0.889 0.000 0.000 -0.533
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model1 <- lmer(data = Data_noNeut, response ~ reputation + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + Gender + FamSES2num + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.7 18523.2 -9231.9 18463.7 4889
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6429 -0.6330 -0.0508 0.5732 4.5275
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.342 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.95376 0.55439 102.63765 1.720 0.0884 .
## reputationlow -2.00858 0.05357 4794.00010 -37.493 < 2e-16 ***
## reputationhigh 2.02512 0.05357 4794.00010 37.802 < 2e-16 ***
## GenderFemale 0.55005 0.38192 101.99972 1.440 0.1529
## FamSES2num 0.45376 0.10109 101.99972 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnh GndrFm
## reputatinlw -0.048
## reputatnhgh -0.048 0.500
## GenderFemal 0.173 0.000 0.000
## FamSES2num -0.889 0.000 0.000 -0.533
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model1 <- lmer(data = Data_noNeut, response ~ reputation + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + Gender + FamSES2num + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.7 18523.2 -9231.9 18463.7 4889
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6429 -0.6330 -0.0508 0.5732 4.5275
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.342 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 2.97888 0.55439 102.63765 5.373 4.86e-07 ***
## reputationmod -2.02512 0.05357 4794.00009 -37.802 < 2e-16 ***
## reputationlow -4.03370 0.05357 4794.00009 -75.295 < 2e-16 ***
## GenderFemale 0.55005 0.38192 101.99973 1.440 0.153
## FamSES2num 0.45376 0.10109 101.99972 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnl GndrFm
## reputatinmd -0.048
## reputatinlw -0.048 0.500
## GenderFemal 0.173 0.000 0.000
## FamSES2num -0.889 0.000 0.000 -0.533
# reputation and expression (additive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model2 <- lmer(data = Data_noNeut, response ~ reputation + expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.4 18529.4 -9230.7 18461.4 4888
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6655 -0.6216 -0.0457 0.5803 4.5071
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.341 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) -1.02193 0.55482 102.95689 -1.842 0.0684 .
## reputationhigh 4.03370 0.05356 4794.00010 75.313 < 2e-16 ***
## reputationmod 2.00858 0.05356 4794.00010 37.502 < 2e-16 ***
## expressionexci -0.06577 0.04373 4794.00009 -1.504 0.1327
## GenderFemale 0.55005 0.38192 101.99972 1.440 0.1529
## FamSES2num 0.45376 0.10109 101.99971 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnh rpttnm exprss GndrFm
## reputatnhgh -0.048
## reputatinmd -0.048 0.500
## expressinxc -0.039 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.888 0.000 0.000 0.000 -0.533
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model2 <- lmer(data = Data_noNeut, response ~ reputation + expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.4 18529.4 -9230.7 18461.4 4888
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6655 -0.6216 -0.0457 0.5803 4.5071
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.341 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.98665 0.55482 102.95691 1.778 0.0783 .
## reputationlow -2.00858 0.05356 4794.00009 -37.502 < 2e-16 ***
## reputationhigh 2.02512 0.05356 4794.00009 37.811 < 2e-16 ***
## expressionexci -0.06577 0.04373 4794.00009 -1.504 0.1327
## GenderFemale 0.55005 0.38192 101.99972 1.440 0.1529
## FamSES2num 0.45376 0.10109 101.99973 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnh exprss GndrFm
## reputatinlw -0.048
## reputatnhgh -0.048 0.500
## expressinxc -0.039 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.888 0.000 0.000 0.000 -0.533
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model2 <- lmer(data = Data_noNeut, response ~ reputation + expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18477.4 18529.4 -9230.7 18461.4 4888
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6655 -0.6216 -0.0457 0.5803 4.5071
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.341 1.530
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 3.01177 0.55482 102.95691 5.428 3.80e-07 ***
## reputationmod -2.02512 0.05356 4794.00010 -37.811 < 2e-16 ***
## reputationlow -4.03370 0.05356 4794.00010 -75.313 < 2e-16 ***
## expressionexci -0.06577 0.04373 4794.00009 -1.504 0.133
## GenderFemale 0.55005 0.38192 101.99972 1.440 0.153
## FamSES2num 0.45376 0.10109 101.99973 4.489 1.89e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnl exprss GndrFm
## reputatinmd -0.048
## reputatinlw -0.048 0.500
## expressinxc -0.039 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.888 0.000 0.000 0.000 -0.533
# model comparison
anova(model1, model2)## Data: Data_noNeut
## Models:
## model1: response ~ reputation + Gender + FamSES2num + (1 | pID)
## model2: response ~ reputation + expression + Gender + FamSES2num + (1 |
## model2: pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model1 7 18478 18523 -9231.9 18464
## model2 8 18477 18529 -9230.7 18461 2.2612 1 0.1326
# reputation and expression (interactive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model3 <- lmer(data = Data_noNeut, response ~ reputation * expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model3)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18478.4 18543.3 -9229.2 18458.4 4886
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6595 -0.6017 -0.0431 0.5755 4.5348
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) -1.06217 0.55568 103.59642 -1.911
## reputationhigh 4.06250 0.07572 4794.00009 53.652
## reputationmod 2.10049 0.07572 4794.00009 27.740
## expressionexci 0.01471 0.07572 4794.00010 0.194
## GenderFemale 0.55005 0.38192 101.99972 1.440
## FamSES2num 0.45376 0.10109 101.99973 4.489
## reputationhigh:expressionexci -0.05760 0.10708 4794.00010 -0.538
## reputationmod:expressionexci -0.18382 0.10708 4794.00010 -1.717
## Pr(>|t|)
## (Intercept) 0.0587 .
## reputationhigh < 2e-16 ***
## reputationmod < 2e-16 ***
## expressionexci 0.8460
## GenderFemale 0.1529
## FamSES2num 1.89e-05 ***
## reputationhigh:expressionexci 0.5907
## reputationmod:expressionexci 0.0861 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnh rpttnm exprss GndrFm FmSES2 rpttnh:
## reputatnhgh -0.068
## reputatinmd -0.068 0.500
## expressinxc -0.068 0.500 0.500
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.887 0.000 0.000 0.000 -0.533
## rpttnhgh:xp 0.048 -0.707 -0.354 -0.707 0.000 0.000
## rpttnmd:xpr 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.500
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model3 <- lmer(data = Data_noNeut, response ~ reputation * expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model3)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18478.4 18543.3 -9229.2 18458.4 4886
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6595 -0.6017 -0.0431 0.5755 4.5348
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.03832 0.55568 103.59641 1.869
## reputationlow -2.10049 0.07572 4794.00010 -27.740
## reputationhigh 1.96201 0.07572 4794.00010 25.911
## expressionexci -0.16912 0.07572 4794.00010 -2.233
## GenderFemale 0.55005 0.38192 101.99972 1.440
## FamSES2num 0.45376 0.10109 101.99972 4.489
## reputationlow:expressionexci 0.18382 0.10708 4794.00010 1.717
## reputationhigh:expressionexci 0.12623 0.10708 4794.00010 1.179
## Pr(>|t|)
## (Intercept) 0.0645 .
## reputationlow < 2e-16 ***
## reputationhigh < 2e-16 ***
## expressionexci 0.0256 *
## GenderFemale 0.1529
## FamSES2num 1.89e-05 ***
## reputationlow:expressionexci 0.0861 .
## reputationhigh:expressionexci 0.2386
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnh exprss GndrFm FmSES2 rpttnl:
## reputatinlw -0.068
## reputatnhgh -0.068 0.500
## expressinxc -0.068 0.500 0.500
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.887 0.000 0.000 0.000 -0.533
## rpttnlw:xpr 0.048 -0.707 -0.354 -0.707 0.000 0.000
## rpttnhgh:xp 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.500
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model3 <- lmer(data = Data_noNeut, response ~ reputation * expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model3)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18478.4 18543.3 -9229.2 18458.4 4886
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6595 -0.6017 -0.0431 0.5755 4.5348
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 3.00033 0.55568 103.59641 5.399
## reputationmod -1.96201 0.07572 4794.00009 -25.911
## reputationlow -4.06250 0.07572 4794.00009 -53.652
## expressionexci -0.04289 0.07572 4794.00009 -0.566
## GenderFemale 0.55005 0.38192 101.99972 1.440
## FamSES2num 0.45376 0.10109 101.99972 4.489
## reputationmod:expressionexci -0.12623 0.10708 4794.00009 -1.179
## reputationlow:expressionexci 0.05760 0.10708 4794.00009 0.538
## Pr(>|t|)
## (Intercept) 4.27e-07 ***
## reputationmod < 2e-16 ***
## reputationlow < 2e-16 ***
## expressionexci 0.571
## GenderFemale 0.153
## FamSES2num 1.89e-05 ***
## reputationmod:expressionexci 0.239
## reputationlow:expressionexci 0.591
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnl exprss GndrFm FmSES2 rpttnm:
## reputatinmd -0.068
## reputatinlw -0.068 0.500
## expressinxc -0.068 0.500 0.500
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.887 0.000 0.000 0.000 -0.533
## rpttnmd:xpr 0.048 -0.707 -0.354 -0.707 0.000 0.000
## rpttnlw:xpr 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.500
# model comparison
anova(model2, model3)## Data: Data_noNeut
## Models:
## model2: response ~ reputation + expression + Gender + FamSES2num + (1 |
## model2: pID)
## model3: response ~ reputation * expression + Gender + FamSES2num + (1 |
## model3: pID)
## Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
## model2 8 18477 18529 -9230.7 18461
## model3 10 18478 18543 -9229.2 18458 3.0827 2 0.2141
# reputation, expression, and race (additive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model4 <- lmer(data = Data_noNeut, response ~ reputation * expression + race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model4)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression + race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18480.3 18551.8 -9229.2 18458.3 4885
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6616 -0.6035 -0.0438 0.5763 4.5368
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) -1.059e+00 5.561e-01 1.039e+02 -1.904
## reputationhigh 4.062e+00 7.572e-02 4.794e+03 53.652
## reputationmod 2.100e+00 7.572e-02 4.794e+03 27.740
## expressionexci 1.471e-02 7.572e-02 4.794e+03 0.194
## racewhite -6.127e-03 4.372e-02 4.794e+03 -0.140
## GenderFemale 5.500e-01 3.819e-01 1.020e+02 1.440
## FamSES2num 4.538e-01 1.011e-01 1.020e+02 4.489
## reputationhigh:expressionexci -5.760e-02 1.071e-01 4.794e+03 -0.538
## reputationmod:expressionexci -1.838e-01 1.071e-01 4.794e+03 -1.717
## Pr(>|t|)
## (Intercept) 0.0596 .
## reputationhigh < 2e-16 ***
## reputationmod < 2e-16 ***
## expressionexci 0.8460
## racewhite 0.8885
## GenderFemale 0.1529
## FamSES2num 1.89e-05 ***
## reputationhigh:expressionexci 0.5907
## reputationmod:expressionexci 0.0861 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnh rpttnm exprss racwht GndrFm FmSES2 rpttnh:
## reputatnhgh -0.068
## reputatinmd -0.068 0.500
## expressinxc -0.068 0.500 0.500
## racewhite -0.039 0.000 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000 0.000
## FamSES2num -0.886 0.000 0.000 0.000 0.000 -0.533
## rpttnhgh:xp 0.048 -0.707 -0.354 -0.707 0.000 0.000 0.000
## rpttnmd:xpr 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.000 0.500
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model4 <- lmer(data = Data_noNeut, response ~ reputation * expression + race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model4)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression + race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18480.3 18551.8 -9229.2 18458.3 4885
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6616 -0.6035 -0.0438 0.5763 4.5368
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.041e+00 5.561e-01 1.039e+02 1.873
## reputationlow -2.100e+00 7.572e-02 4.794e+03 -27.740
## reputationhigh 1.962e+00 7.572e-02 4.794e+03 25.911
## expressionexci -1.691e-01 7.572e-02 4.794e+03 -2.233
## racewhite -6.127e-03 4.372e-02 4.794e+03 -0.140
## GenderFemale 5.500e-01 3.819e-01 1.020e+02 1.440
## FamSES2num 4.538e-01 1.011e-01 1.020e+02 4.489
## reputationlow:expressionexci 1.838e-01 1.071e-01 4.794e+03 1.717
## reputationhigh:expressionexci 1.262e-01 1.071e-01 4.794e+03 1.179
## Pr(>|t|)
## (Intercept) 0.0639 .
## reputationlow < 2e-16 ***
## reputationhigh < 2e-16 ***
## expressionexci 0.0256 *
## racewhite 0.8885
## GenderFemale 0.1529
## FamSES2num 1.89e-05 ***
## reputationlow:expressionexci 0.0861 .
## reputationhigh:expressionexci 0.2386
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnh exprss racwht GndrFm FmSES2 rpttnl:
## reputatinlw -0.068
## reputatnhgh -0.068 0.500
## expressinxc -0.068 0.500 0.500
## racewhite -0.039 0.000 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000 0.000
## FamSES2num -0.886 0.000 0.000 0.000 0.000 -0.533
## rpttnlw:xpr 0.048 -0.707 -0.354 -0.707 0.000 0.000 0.000
## rpttnhgh:xp 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.000 0.500
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model4 <- lmer(data = Data_noNeut, response ~ reputation * expression + race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model4)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression + race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18480.3 18551.8 -9229.2 18458.3 4885
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6616 -0.6035 -0.0438 0.5763 4.5368
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.339 1.529
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 3.003e+00 5.561e-01 1.039e+02 5.401
## reputationmod -1.962e+00 7.572e-02 4.794e+03 -25.911
## reputationlow -4.062e+00 7.572e-02 4.794e+03 -53.652
## expressionexci -4.289e-02 7.572e-02 4.794e+03 -0.566
## racewhite -6.127e-03 4.372e-02 4.794e+03 -0.140
## GenderFemale 5.500e-01 3.819e-01 1.020e+02 1.440
## FamSES2num 4.538e-01 1.011e-01 1.020e+02 4.489
## reputationmod:expressionexci -1.262e-01 1.071e-01 4.794e+03 -1.179
## reputationlow:expressionexci 5.760e-02 1.071e-01 4.794e+03 0.538
## Pr(>|t|)
## (Intercept) 4.23e-07 ***
## reputationmod < 2e-16 ***
## reputationlow < 2e-16 ***
## expressionexci 0.571
## racewhite 0.889
## GenderFemale 0.153
## FamSES2num 1.89e-05 ***
## reputationmod:expressionexci 0.239
## reputationlow:expressionexci 0.591
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnm rpttnl exprss racwht GndrFm FmSES2 rpttnm:
## reputatinmd -0.068
## reputatinlw -0.068 0.500
## expressinxc -0.068 0.500 0.500
## racewhite -0.039 0.000 0.000 0.000
## GenderFemal 0.173 0.000 0.000 0.000 0.000
## FamSES2num -0.886 0.000 0.000 0.000 0.000 -0.533
## rpttnmd:xpr 0.048 -0.707 -0.354 -0.707 0.000 0.000 0.000
## rpttnlw:xpr 0.048 -0.354 -0.707 -0.707 0.000 0.000 0.000 0.500
# reputation, expression, and race (interactive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model5 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model5)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18464.2 18568.2 -9216.1 18432.2 4880
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6121 -0.6041 -0.0336 0.5876 4.4812
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.327 1.525
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -1.16266 0.55823 105.50940
## reputationhigh 4.07108 0.10679 4794.00000
## reputationmod 2.31618 0.10679 4794.00000
## expressionexci 0.13971 0.10679 4794.00000
## racewhite 0.20098 0.10679 4794.00000
## GenderFemale 0.55005 0.38192 101.99999
## FamSES2num 0.45376 0.10109 101.99999
## reputationhigh:expressionexci 0.08578 0.15103 4794.00000
## reputationmod:expressionexci -0.52941 0.15103 4794.00000
## reputationhigh:racewhite -0.01716 0.15103 4794.00000
## reputationmod:racewhite -0.43137 0.15103 4794.00000
## expressionexci:racewhite -0.25000 0.15103 4794.00000
## reputationhigh:expressionexci:racewhite -0.28676 0.21359 4794.00000
## reputationmod:expressionexci:racewhite 0.69118 0.21359 4794.00000
## t value Pr(>|t|)
## (Intercept) -2.083 0.03969 *
## reputationhigh 38.121 < 2e-16 ***
## reputationmod 21.688 < 2e-16 ***
## expressionexci 1.308 0.19087
## racewhite 1.882 0.05990 .
## GenderFemale 1.440 0.15287
## FamSES2num 4.489 1.89e-05 ***
## reputationhigh:expressionexci 0.568 0.57006
## reputationmod:expressionexci -3.505 0.00046 ***
## reputationhigh:racewhite -0.114 0.90956
## reputationmod:racewhite -2.856 0.00431 **
## expressionexci:racewhite -1.655 0.09793 .
## reputationhigh:expressionexci:racewhite -1.343 0.17946
## reputationmod:expressionexci:racewhite 3.236 0.00122 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 14 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model5 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model5)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18464.2 18568.2 -9216.1 18432.2 4880
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6121 -0.6041 -0.0336 0.5876 4.4812
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.327 1.525
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 1.1535 0.5582 105.5094
## reputationlow -2.3162 0.1068 4794.0000
## reputationhigh 1.7549 0.1068 4794.0000
## expressionexci -0.3897 0.1068 4794.0000
## racewhite -0.2304 0.1068 4794.0000
## GenderFemale 0.5500 0.3819 102.0000
## FamSES2num 0.4538 0.1011 102.0000
## reputationlow:expressionexci 0.5294 0.1510 4794.0000
## reputationhigh:expressionexci 0.6152 0.1510 4794.0000
## reputationlow:racewhite 0.4314 0.1510 4794.0000
## reputationhigh:racewhite 0.4142 0.1510 4794.0000
## expressionexci:racewhite 0.4412 0.1510 4794.0000
## reputationlow:expressionexci:racewhite -0.6912 0.2136 4794.0000
## reputationhigh:expressionexci:racewhite -0.9779 0.2136 4794.0000
## t value Pr(>|t|)
## (Intercept) 2.066 0.041239 *
## reputationlow -21.688 < 2e-16 ***
## reputationhigh 16.433 < 2e-16 ***
## expressionexci -3.649 0.000266 ***
## racewhite -2.157 0.031026 *
## GenderFemale 1.440 0.152867
## FamSES2num 4.489 1.89e-05 ***
## reputationlow:expressionexci 3.505 0.000460 ***
## reputationhigh:expressionexci 4.073 4.71e-05 ***
## reputationlow:racewhite 2.856 0.004305 **
## reputationhigh:racewhite 2.743 0.006117 **
## expressionexci:racewhite 2.921 0.003504 **
## reputationlow:expressionexci:racewhite -3.236 0.001220 **
## reputationhigh:expressionexci:racewhite -4.579 4.80e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 14 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model5 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model5)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18464.2 18568.2 -9216.1 18432.2 4880
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6121 -0.6041 -0.0336 0.5876 4.4812
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.327 1.525
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 2.90842 0.55823 105.50941
## reputationmod -1.75490 0.10679 4794.00000
## reputationlow -4.07108 0.10679 4794.00000
## expressionexci 0.22549 0.10679 4794.00000
## racewhite 0.18382 0.10679 4794.00000
## GenderFemale 0.55005 0.38192 102.00000
## FamSES2num 0.45376 0.10109 102.00000
## reputationmod:expressionexci -0.61520 0.15103 4794.00000
## reputationlow:expressionexci -0.08578 0.15103 4794.00000
## reputationmod:racewhite -0.41422 0.15103 4794.00000
## reputationlow:racewhite 0.01716 0.15103 4794.00000
## expressionexci:racewhite -0.53676 0.15103 4794.00000
## reputationmod:expressionexci:racewhite 0.97794 0.21359 4794.00000
## reputationlow:expressionexci:racewhite 0.28676 0.21359 4794.00000
## t value Pr(>|t|)
## (Intercept) 5.210 9.41e-07 ***
## reputationmod -16.433 < 2e-16 ***
## reputationlow -38.121 < 2e-16 ***
## expressionexci 2.111 0.034784 *
## racewhite 1.721 0.085260 .
## GenderFemale 1.440 0.152867
## FamSES2num 4.489 1.89e-05 ***
## reputationmod:expressionexci -4.073 4.71e-05 ***
## reputationlow:expressionexci -0.568 0.570060
## reputationmod:racewhite -2.743 0.006117 **
## reputationlow:racewhite 0.114 0.909559
## expressionexci:racewhite -3.554 0.000383 ***
## reputationmod:expressionexci:racewhite 4.579 4.80e-06 ***
## reputationlow:expressionexci:racewhite 1.343 0.179459
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 14 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# (adding sex)
# reputation, expression, race, and sex (additive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model6 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model6)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18459.9 18570.3 -9212.9 18425.9 4879
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6512 -0.5932 -0.0318 0.5846 4.4481
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.323 1.524
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) -1.21760 0.55864 105.82619
## reputationhigh 4.07108 0.10672 4793.99999
## reputationmod 2.31618 0.10672 4793.99999
## expressionexci 0.13971 0.10672 4793.99998
## racewhite 0.20098 0.10672 4793.99998
## sexmale 0.10989 0.04357 4794.00000
## GenderFemale 0.55005 0.38192 101.99999
## FamSES2num 0.45376 0.10109 101.99999
## reputationhigh:expressionexci 0.08578 0.15093 4793.99999
## reputationmod:expressionexci -0.52941 0.15093 4793.99999
## reputationhigh:racewhite -0.01716 0.15093 4793.99999
## reputationmod:racewhite -0.43137 0.15093 4793.99999
## expressionexci:racewhite -0.25000 0.15093 4793.99999
## reputationhigh:expressionexci:racewhite -0.28676 0.21344 4794.00000
## reputationmod:expressionexci:racewhite 0.69118 0.21344 4794.00000
## t value Pr(>|t|)
## (Intercept) -2.180 0.031506 *
## reputationhigh 38.146 < 2e-16 ***
## reputationmod 21.703 < 2e-16 ***
## expressionexci 1.309 0.190577
## racewhite 1.883 0.059733 .
## sexmale 2.522 0.011698 *
## GenderFemale 1.440 0.152867
## FamSES2num 4.489 1.89e-05 ***
## reputationhigh:expressionexci 0.568 0.569805
## reputationmod:expressionexci -3.508 0.000456 ***
## reputationhigh:racewhite -0.114 0.909500
## reputationmod:racewhite -2.858 0.004280 **
## expressionexci:racewhite -1.656 0.097703 .
## reputationhigh:expressionexci:racewhite -1.344 0.179171
## reputationmod:expressionexci:racewhite 3.238 0.001211 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 15 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model6 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model6)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18459.9 18570.3 -9212.9 18425.9 4879
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6512 -0.5932 -0.0318 0.5846 4.4481
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.323 1.524
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 1.09857 0.55864 105.82615
## reputationlow -2.31618 0.10672 4794.00002
## reputationhigh 1.75490 0.10672 4794.00002
## expressionexci -0.38971 0.10672 4794.00002
## racewhite -0.23039 0.10672 4794.00002
## sexmale 0.10989 0.04357 4794.00002
## GenderFemale 0.55005 0.38192 101.99995
## FamSES2num 0.45376 0.10109 101.99995
## reputationlow:expressionexci 0.52941 0.15093 4794.00002
## reputationhigh:expressionexci 0.61520 0.15093 4794.00002
## reputationlow:racewhite 0.43137 0.15093 4794.00002
## reputationhigh:racewhite 0.41422 0.15093 4794.00002
## expressionexci:racewhite 0.44118 0.15093 4794.00002
## reputationlow:expressionexci:racewhite -0.69118 0.21344 4794.00002
## reputationhigh:expressionexci:racewhite -0.97794 0.21344 4794.00002
## t value Pr(>|t|)
## (Intercept) 1.967 0.051859 .
## reputationlow -21.703 < 2e-16 ***
## reputationhigh 16.444 < 2e-16 ***
## expressionexci -3.652 0.000263 ***
## racewhite -2.159 0.030915 *
## sexmale 2.522 0.011698 *
## GenderFemale 1.440 0.152867
## FamSES2num 4.489 1.89e-05 ***
## reputationlow:expressionexci 3.508 0.000456 ***
## reputationhigh:expressionexci 4.076 4.65e-05 ***
## reputationlow:racewhite 2.858 0.004280 **
## reputationhigh:racewhite 2.744 0.006084 **
## expressionexci:racewhite 2.923 0.003482 **
## reputationlow:expressionexci:racewhite -3.238 0.001211 **
## reputationhigh:expressionexci:racewhite -4.582 4.73e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 15 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model6 <- lmer(data = Data_noNeut, response ~ reputation * expression * race + sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model6)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race + sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18459.9 18570.3 -9212.9 18425.9 4879
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6512 -0.5932 -0.0318 0.5846 4.4481
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.323 1.524
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 2.85348 0.55864 105.82615
## reputationmod -1.75490 0.10672 4794.00002
## reputationlow -4.07108 0.10672 4794.00002
## expressionexci 0.22549 0.10672 4794.00002
## racewhite 0.18382 0.10672 4794.00002
## sexmale 0.10989 0.04357 4794.00002
## GenderFemale 0.55005 0.38192 101.99995
## FamSES2num 0.45376 0.10109 101.99995
## reputationmod:expressionexci -0.61520 0.15093 4794.00002
## reputationlow:expressionexci -0.08578 0.15093 4794.00002
## reputationmod:racewhite -0.41422 0.15093 4794.00002
## reputationlow:racewhite 0.01716 0.15093 4794.00002
## expressionexci:racewhite -0.53676 0.15093 4794.00002
## reputationmod:expressionexci:racewhite 0.97794 0.21344 4794.00002
## reputationlow:expressionexci:racewhite 0.28676 0.21344 4794.00002
## t value Pr(>|t|)
## (Intercept) 5.108 1.45e-06 ***
## reputationmod -16.444 < 2e-16 ***
## reputationlow -38.146 < 2e-16 ***
## expressionexci 2.113 0.03466 *
## racewhite 1.722 0.08505 .
## sexmale 2.522 0.01170 *
## GenderFemale 1.440 0.15287
## FamSES2num 4.489 1.89e-05 ***
## reputationmod:expressionexci -4.076 4.65e-05 ***
## reputationlow:expressionexci -0.568 0.56980
## reputationmod:racewhite -2.744 0.00608 **
## reputationlow:racewhite 0.114 0.90950
## expressionexci:racewhite -3.556 0.00038 ***
## reputationmod:expressionexci:racewhite 4.582 4.73e-06 ***
## reputationlow:expressionexci:racewhite 1.344 0.17917
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 15 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# reputation, expression, race, and sex (interactive)
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "low")
model7 <- lmer(data = Data_noNeut, response ~ reputation * expression * race * sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model7)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race * sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18468.8 18650.7 -9206.4 18412.8 4868
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6601 -0.5946 -0.0273 0.5822 4.4661
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.317 1.522
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) -1.26315 0.56327
## reputationhigh 4.11275 0.15072
## reputationmod 2.47549 0.15072
## expressionexci 0.12255 0.15072
## racewhite 0.26471 0.15072
## sexmale 0.20098 0.15072
## GenderFemale 0.55005 0.38192
## FamSES2num 0.45376 0.10109
## reputationhigh:expressionexci 0.19118 0.21315
## reputationmod:expressionexci -0.50980 0.21315
## reputationhigh:racewhite -0.17157 0.21315
## reputationmod:racewhite -0.51961 0.21315
## expressionexci:racewhite -0.35784 0.21315
## reputationhigh:sexmale -0.08333 0.21315
## reputationmod:sexmale -0.31863 0.21315
## expressionexci:sexmale 0.03431 0.21315
## racewhite:sexmale -0.12745 0.21315
## reputationhigh:expressionexci:racewhite -0.21078 0.30144
## reputationmod:expressionexci:racewhite 0.63725 0.30144
## reputationhigh:expressionexci:sexmale -0.21078 0.30144
## reputationmod:expressionexci:sexmale -0.03922 0.30144
## reputationhigh:racewhite:sexmale 0.30882 0.30144
## reputationmod:racewhite:sexmale 0.17647 0.30144
## expressionexci:racewhite:sexmale 0.21569 0.30144
## reputationhigh:expressionexci:racewhite:sexmale -0.15196 0.42631
## reputationmod:expressionexci:racewhite:sexmale 0.10784 0.42631
## df t value
## (Intercept) 109.37344 -2.243
## reputationhigh 4794.00001 27.287
## reputationmod 4794.00001 16.424
## expressionexci 4794.00001 0.813
## racewhite 4794.00001 1.756
## sexmale 4794.00001 1.333
## GenderFemale 101.99999 1.440
## FamSES2num 101.99999 4.489
## reputationhigh:expressionexci 4794.00001 0.897
## reputationmod:expressionexci 4794.00001 -2.392
## reputationhigh:racewhite 4794.00001 -0.805
## reputationmod:racewhite 4794.00001 -2.438
## expressionexci:racewhite 4794.00001 -1.679
## reputationhigh:sexmale 4794.00001 -0.391
## reputationmod:sexmale 4794.00001 -1.495
## expressionexci:sexmale 4794.00001 0.161
## racewhite:sexmale 4794.00001 -0.598
## reputationhigh:expressionexci:racewhite 4794.00000 -0.699
## reputationmod:expressionexci:racewhite 4794.00000 2.114
## reputationhigh:expressionexci:sexmale 4794.00000 -0.699
## reputationmod:expressionexci:sexmale 4794.00001 -0.130
## reputationhigh:racewhite:sexmale 4794.00000 1.024
## reputationmod:racewhite:sexmale 4794.00001 0.585
## expressionexci:racewhite:sexmale 4794.00000 0.716
## reputationhigh:expressionexci:racewhite:sexmale 4794.00000 -0.356
## reputationmod:expressionexci:racewhite:sexmale 4794.00000 0.253
## Pr(>|t|)
## (Intercept) 0.0269 *
## reputationhigh < 2e-16 ***
## reputationmod < 2e-16 ***
## expressionexci 0.4162
## racewhite 0.0791 .
## sexmale 0.1824
## GenderFemale 0.1529
## FamSES2num 1.89e-05 ***
## reputationhigh:expressionexci 0.3698
## reputationmod:expressionexci 0.0168 *
## reputationhigh:racewhite 0.4209
## reputationmod:racewhite 0.0148 *
## expressionexci:racewhite 0.0933 .
## reputationhigh:sexmale 0.6958
## reputationmod:sexmale 0.1350
## expressionexci:sexmale 0.8721
## racewhite:sexmale 0.5499
## reputationhigh:expressionexci:racewhite 0.4844
## reputationmod:expressionexci:racewhite 0.0346 *
## reputationhigh:expressionexci:sexmale 0.4844
## reputationmod:expressionexci:sexmale 0.8965
## reputationhigh:racewhite:sexmale 0.3057
## reputationmod:racewhite:sexmale 0.5583
## expressionexci:racewhite:sexmale 0.4743
## reputationhigh:expressionexci:racewhite:sexmale 0.7215
## reputationmod:expressionexci:racewhite:sexmale 0.8003
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 26 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "mod")
model7 <- lmer(data = Data_noNeut, response ~ reputation * expression * race * sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model7)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race * sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18468.8 18650.7 -9206.4 18412.8 4868
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6601 -0.5946 -0.0273 0.5822 4.4661
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.317 1.522
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) 1.212e+00 5.633e-01
## reputationlow -2.475e+00 1.507e-01
## reputationhigh 1.637e+00 1.507e-01
## expressionexci -3.873e-01 1.507e-01
## racewhite -2.549e-01 1.507e-01
## sexmale -1.176e-01 1.507e-01
## GenderFemale 5.500e-01 3.819e-01
## FamSES2num 4.538e-01 1.011e-01
## reputationlow:expressionexci 5.098e-01 2.132e-01
## reputationhigh:expressionexci 7.010e-01 2.132e-01
## reputationlow:racewhite 5.196e-01 2.132e-01
## reputationhigh:racewhite 3.480e-01 2.132e-01
## expressionexci:racewhite 2.794e-01 2.132e-01
## reputationlow:sexmale 3.186e-01 2.132e-01
## reputationhigh:sexmale 2.353e-01 2.132e-01
## expressionexci:sexmale -4.902e-03 2.132e-01
## racewhite:sexmale 4.902e-02 2.132e-01
## reputationlow:expressionexci:racewhite -6.373e-01 3.014e-01
## reputationhigh:expressionexci:racewhite -8.480e-01 3.014e-01
## reputationlow:expressionexci:sexmale 3.922e-02 3.014e-01
## reputationhigh:expressionexci:sexmale -1.716e-01 3.014e-01
## reputationlow:racewhite:sexmale -1.765e-01 3.014e-01
## reputationhigh:racewhite:sexmale 1.324e-01 3.014e-01
## expressionexci:racewhite:sexmale 3.235e-01 3.014e-01
## reputationlow:expressionexci:racewhite:sexmale -1.078e-01 4.263e-01
## reputationhigh:expressionexci:racewhite:sexmale -2.598e-01 4.263e-01
## df t value
## (Intercept) 1.094e+02 2.152
## reputationlow 4.794e+03 -16.424
## reputationhigh 4.794e+03 10.863
## expressionexci 4.794e+03 -2.569
## racewhite 4.794e+03 -1.691
## sexmale 4.794e+03 -0.781
## GenderFemale 1.020e+02 1.440
## FamSES2num 1.020e+02 4.489
## reputationlow:expressionexci 4.794e+03 2.392
## reputationhigh:expressionexci 4.794e+03 3.289
## reputationlow:racewhite 4.794e+03 2.438
## reputationhigh:racewhite 4.794e+03 1.633
## expressionexci:racewhite 4.794e+03 1.311
## reputationlow:sexmale 4.794e+03 1.495
## reputationhigh:sexmale 4.794e+03 1.104
## expressionexci:sexmale 4.794e+03 -0.023
## racewhite:sexmale 4.794e+03 0.230
## reputationlow:expressionexci:racewhite 4.794e+03 -2.114
## reputationhigh:expressionexci:racewhite 4.794e+03 -2.813
## reputationlow:expressionexci:sexmale 4.794e+03 0.130
## reputationhigh:expressionexci:sexmale 4.794e+03 -0.569
## reputationlow:racewhite:sexmale 4.794e+03 -0.585
## reputationhigh:racewhite:sexmale 4.794e+03 0.439
## expressionexci:racewhite:sexmale 4.794e+03 1.073
## reputationlow:expressionexci:racewhite:sexmale 4.794e+03 -0.253
## reputationhigh:expressionexci:racewhite:sexmale 4.794e+03 -0.609
## Pr(>|t|)
## (Intercept) 0.03357 *
## reputationlow < 2e-16 ***
## reputationhigh < 2e-16 ***
## expressionexci 0.01022 *
## racewhite 0.09086 .
## sexmale 0.43510
## GenderFemale 0.15287
## FamSES2num 1.89e-05 ***
## reputationlow:expressionexci 0.01681 *
## reputationhigh:expressionexci 0.00101 **
## reputationlow:racewhite 0.01482 *
## reputationhigh:racewhite 0.10257
## expressionexci:racewhite 0.18997
## reputationlow:sexmale 0.13502
## reputationhigh:sexmale 0.26970
## expressionexci:sexmale 0.98165
## racewhite:sexmale 0.81812
## reputationlow:expressionexci:racewhite 0.03457 *
## reputationhigh:expressionexci:racewhite 0.00492 **
## reputationlow:expressionexci:sexmale 0.89650
## reputationhigh:expressionexci:sexmale 0.56928
## reputationlow:racewhite:sexmale 0.55829
## reputationhigh:racewhite:sexmale 0.66064
## expressionexci:racewhite:sexmale 0.28321
## reputationlow:expressionexci:racewhite:sexmale 0.80030
## reputationhigh:expressionexci:racewhite:sexmale 0.54227
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 26 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# to see all contrasts, re-level reputation and run again
Data_noNeut$reputation <- relevel(Data_noNeut$reputation, ref = "high")
model7 <- lmer(data = Data_noNeut, response ~ reputation * expression * race * sex +
Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model7)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression * race * sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18468.8 18650.7 -9206.4 18412.8 4868
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6601 -0.5946 -0.0273 0.5822 4.4661
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.317 1.522
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) 2.84960 0.56327
## reputationmod -1.63725 0.15072
## reputationlow -4.11275 0.15072
## expressionexci 0.31373 0.15072
## racewhite 0.09314 0.15072
## sexmale 0.11765 0.15072
## GenderFemale 0.55005 0.38192
## FamSES2num 0.45376 0.10109
## reputationmod:expressionexci -0.70098 0.21315
## reputationlow:expressionexci -0.19118 0.21315
## reputationmod:racewhite -0.34804 0.21315
## reputationlow:racewhite 0.17157 0.21315
## expressionexci:racewhite -0.56863 0.21315
## reputationmod:sexmale -0.23529 0.21315
## reputationlow:sexmale 0.08333 0.21315
## expressionexci:sexmale -0.17647 0.21315
## racewhite:sexmale 0.18137 0.21315
## reputationmod:expressionexci:racewhite 0.84804 0.30144
## reputationlow:expressionexci:racewhite 0.21078 0.30144
## reputationmod:expressionexci:sexmale 0.17157 0.30144
## reputationlow:expressionexci:sexmale 0.21078 0.30144
## reputationmod:racewhite:sexmale -0.13235 0.30144
## reputationlow:racewhite:sexmale -0.30882 0.30144
## expressionexci:racewhite:sexmale 0.06373 0.30144
## reputationmod:expressionexci:racewhite:sexmale 0.25980 0.42631
## reputationlow:expressionexci:racewhite:sexmale 0.15196 0.42631
## df t value Pr(>|t|)
## (Intercept) 109.37344 5.059 1.71e-06
## reputationmod 4793.99997 -10.863 < 2e-16
## reputationlow 4793.99997 -27.287 < 2e-16
## expressionexci 4793.99995 2.081 0.03744
## racewhite 4793.99995 0.618 0.53664
## sexmale 4793.99995 0.781 0.43510
## GenderFemale 101.99999 1.440 0.15287
## FamSES2num 101.99999 4.489 1.89e-05
## reputationmod:expressionexci 4793.99997 -3.289 0.00101
## reputationlow:expressionexci 4793.99997 -0.897 0.36982
## reputationmod:racewhite 4793.99997 -1.633 0.10257
## reputationlow:racewhite 4793.99997 0.805 0.42091
## expressionexci:racewhite 4793.99995 -2.668 0.00766
## reputationmod:sexmale 4793.99997 -1.104 0.26970
## reputationlow:sexmale 4793.99997 0.391 0.69585
## expressionexci:sexmale 4793.99995 -0.828 0.40776
## racewhite:sexmale 4793.99995 0.851 0.39487
## reputationmod:expressionexci:racewhite 4793.99998 2.813 0.00492
## reputationlow:expressionexci:racewhite 4793.99998 0.699 0.48443
## reputationmod:expressionexci:sexmale 4793.99998 0.569 0.56928
## reputationlow:expressionexci:sexmale 4793.99997 0.699 0.48443
## reputationmod:racewhite:sexmale 4793.99998 -0.439 0.66064
## reputationlow:racewhite:sexmale 4793.99997 -1.024 0.30566
## expressionexci:racewhite:sexmale 4793.99996 0.211 0.83258
## reputationmod:expressionexci:racewhite:sexmale 4793.99998 0.609 0.54227
## reputationlow:expressionexci:racewhite:sexmale 4793.99998 0.356 0.72151
##
## (Intercept) ***
## reputationmod ***
## reputationlow ***
## expressionexci *
## racewhite
## sexmale
## GenderFemale
## FamSES2num ***
## reputationmod:expressionexci **
## reputationlow:expressionexci
## reputationmod:racewhite
## reputationlow:racewhite
## expressionexci:racewhite **
## reputationmod:sexmale
## reputationlow:sexmale
## expressionexci:sexmale
## racewhite:sexmale
## reputationmod:expressionexci:racewhite **
## reputationlow:expressionexci:racewhite
## reputationmod:expressionexci:sexmale
## reputationlow:expressionexci:sexmale
## reputationmod:racewhite:sexmale
## reputationlow:racewhite:sexmale
## expressionexci:racewhite:sexmale
## reputationmod:expressionexci:racewhite:sexmale
## reputationlow:expressionexci:racewhite:sexmale
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 26 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# look only at moderate reputation to see whether there is a significant interaction
Data_noNeut_mod <- Data_noNeut %>%
filter(reputation == "mod")
# expression only
model1_mod <- lmer(data = Data_noNeut_mod, response ~ expression + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model1_mod)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ expression + Gender + FamSES2num + (1 | pID)
## Data: Data_noNeut_mod
##
## AIC BIC logLik deviance df.resid
## 4889.5 4921.9 -2438.7 4877.5 1626
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.6769 -0.3676 -0.0067 0.3857 9.3964
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.951 1.9877
## Residual 0.890 0.9434
## Number of obs: 1632, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.11075 0.69552 102.23034 1.597 0.113353
## expressionexci -0.16912 0.04671 1530.00001 -3.621 0.000303 ***
## GenderFemale 0.52893 0.47962 101.99998 1.103 0.272704
## FamSES2num 0.44399 0.12695 101.99999 3.497 0.000698 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) exprss GndrFm
## expressinxc -0.034
## GenderFemal 0.174 0.000
## FamSES2num -0.890 0.000 -0.533
# full model
model2_mod <- lmer(data = Data_noNeut_mod, response ~ expression * race * sex + Gender + FamSES2num + (1 | pID), REML=FALSE)
summary(model2_mod)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ expression * race * sex + Gender + FamSES2num + (1 |
## pID)
## Data: Data_noNeut_mod
##
## AIC BIC logLik deviance df.resid
## 4867.8 4932.5 -2421.9 4843.8 1620
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.6651 -0.4023 0.0012 0.3882 9.3153
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.9521 1.9880
## Residual 0.8706 0.9331
## Number of obs: 1632, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 1.285e+00 6.978e-01 1.036e+02 1.841
## expressionexci -3.873e-01 9.239e-02 1.530e+03 -4.192
## racewhite -2.549e-01 9.239e-02 1.530e+03 -2.759
## sexmale -1.176e-01 9.239e-02 1.530e+03 -1.273
## GenderFemale 5.289e-01 4.796e-01 1.020e+02 1.103
## FamSES2num 4.440e-01 1.270e-01 1.020e+02 3.497
## expressionexci:racewhite 2.794e-01 1.307e-01 1.530e+03 2.139
## expressionexci:sexmale -4.902e-03 1.307e-01 1.530e+03 -0.038
## racewhite:sexmale 4.902e-02 1.307e-01 1.530e+03 0.375
## expressionexci:racewhite:sexmale 3.235e-01 1.848e-01 1.530e+03 1.751
## Pr(>|t|)
## (Intercept) 0.068464 .
## expressionexci 2.93e-05 ***
## racewhite 0.005865 **
## sexmale 0.203062
## GenderFemale 0.272705
## FamSES2num 0.000698 ***
## expressionexci:racewhite 0.032629 *
## expressionexci:sexmale 0.970076
## racewhite:sexmale 0.707574
## expressionexci:racewhite:sexmale 0.080154 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) exprss racwht sexmal GndrFm FmSES2 exprssnxc:r
## expressinxc -0.066
## racewhite -0.066 0.500
## sexmale -0.066 0.500 0.500
## GenderFemal 0.173 0.000 0.000 0.000
## FamSES2num -0.887 0.000 0.000 0.000 -0.533
## exprssnxc:r 0.047 -0.707 -0.707 -0.354 0.000 0.000
## exprssnxc:s 0.047 -0.707 -0.354 -0.707 0.000 0.000 0.500
## racwht:sxml 0.047 -0.354 -0.707 -0.707 0.000 0.000 0.500
## exprssnxc:: -0.033 0.500 0.500 0.500 0.000 0.000 -0.707
## exprssnxc:s rcwht:
## expressinxc
## racewhite
## sexmale
## GenderFemal
## FamSES2num
## exprssnxc:r
## exprssnxc:s
## racwht:sxml 0.500
## exprssnxc:: -0.707 -0.707
##For now, we only have European American data, so we will test whether there are individual differences in ideal affect:
#Again, only look within moderate reputation ("mod") because that's where it seems ideal affect matters
#Model 1: Player 2 expression, race, and ideal HAP as predictors for amount given by participants, controlling for actual HAP
model1 <- lmer(data = Data_noNeut_mod, response ~ expression * race * scale(iHAP, scale = F) + scale(aHAP, scale = F) + (1|pID), REML=FALSE)
summary(model1)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ expression * race * scale(iHAP, scale = F) + scale(aHAP,
## scale = F) + (1 | pID)
## Data: Data_noNeut_mod
##
## AIC BIC logLik deviance df.resid
## 5108.1 5167.9 -2543.1 5086.1 1685
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.5876 -0.4063 0.0032 0.4020 9.2432
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 4.5984 2.1444
## Residual 0.8908 0.9438
## Number of obs: 1696, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) 4.26651 0.21327
## expressionexci -0.36557 0.06482
## racewhite -0.23585 0.06482
## scale(iHAP, scale = F) 0.35605 0.33388
## scale(aHAP, scale = F) -0.63323 0.31457
## expressionexci:racewhite 0.41745 0.09167
## expressionexci:scale(iHAP, scale = F) -0.06058 0.09291
## racewhite:scale(iHAP, scale = F) -0.10238 0.09291
## expressionexci:racewhite:scale(iHAP, scale = F) 0.04653 0.13139
## df t value
## (Intercept) 113.73511 20.006
## expressionexci 1590.00000 -5.639
## racewhite 1590.00000 -3.638
## scale(iHAP, scale = F) 112.42813 1.066
## scale(aHAP, scale = F) 106.00000 -2.013
## expressionexci:racewhite 1590.00000 4.554
## expressionexci:scale(iHAP, scale = F) 1590.00000 -0.652
## racewhite:scale(iHAP, scale = F) 1590.00000 -1.102
## expressionexci:racewhite:scale(iHAP, scale = F) 1590.00000 0.354
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## expressionexci 2.02e-08 ***
## racewhite 0.000283 ***
## scale(iHAP, scale = F) 0.288528
## scale(aHAP, scale = F) 0.046652 *
## expressionexci:racewhite 5.67e-06 ***
## expressionexci:scale(iHAP, scale = F) 0.514442
## racewhite:scale(iHAP, scale = F) 0.270640
## expressionexci:racewhite:scale(iHAP, scale = F) 0.723293
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) exprss racwht scale(iHAP,scl=F) scale(aHAP,scl=F)
## expressinxc -0.152
## racewhite -0.152 0.500
## scale(iHAP,scl=F) 0.000 0.000 0.000
## scale(aHAP,scl=F) 0.000 0.000 0.000 -0.402
## exprssnxc:r 0.107 -0.707 -0.707 0.000 0.000
## e:(HAP,s=F) 0.000 0.000 0.000 -0.139 0.000
## r:(HAP,s=F) 0.000 0.000 0.000 -0.139 0.000
## e::(HAP,s=F 0.000 0.000 0.000 0.098 0.000
## exprs: e:(s=F r:(s=F
## expressinxc
## racewhite
## scale(iHAP,scl=F)
## scale(aHAP,scl=F)
## exprssnxc:r
## e:(HAP,s=F) 0.000
## r:(HAP,s=F) 0.000 0.500
## e::(HAP,s=F 0.000 -0.707 -0.707
#Model 2: Player 2 expression, race, and ideal LAP as predictors for amount given by participants, controlling for actual LAP
model2 <- lmer(data = Data_noNeut_mod, response ~ expression * race * scale(iLAP, scale = F) + scale(aLAP, scale = F) + (1|pID), REML=FALSE)
summary(model2)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ expression * race * scale(iLAP, scale = F) + scale(aLAP,
## scale = F) + (1 | pID)
## Data: Data_noNeut_mod
##
## AIC BIC logLik deviance df.resid
## 5110.7 5170.5 -2544.3 5088.7 1685
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -6.6637 -0.4146 0.0196 0.4086 9.3228
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 4.7640 2.1827
## Residual 0.8902 0.9435
## Number of obs: 1696, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) 4.26651 0.21689
## expressionexci -0.36557 0.06480
## racewhite -0.23585 0.06480
## scale(iLAP, scale = F) 0.11418 0.31713
## scale(aLAP, scale = F) -0.06162 0.27220
## expressionexci:racewhite 0.41745 0.09164
## expressionexci:scale(iLAP, scale = F) 0.11659 0.09465
## racewhite:scale(iLAP, scale = F) 0.06418 0.09465
## expressionexci:racewhite:scale(iLAP, scale = F) -0.21630 0.13385
## df t value
## (Intercept) 113.45971 19.671
## expressionexci 1590.00000 -5.642
## racewhite 1590.00000 -3.640
## scale(iLAP, scale = F) 113.44372 0.360
## scale(aLAP, scale = F) 105.99999 -0.226
## expressionexci:racewhite 1590.00000 4.555
## expressionexci:scale(iLAP, scale = F) 1590.00000 1.232
## racewhite:scale(iLAP, scale = F) 1590.00000 0.678
## expressionexci:racewhite:scale(iLAP, scale = F) 1590.00000 -1.616
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## expressionexci 1.99e-08 ***
## racewhite 0.000282 ***
## scale(iLAP, scale = F) 0.719487
## scale(aLAP, scale = F) 0.821356
## expressionexci:racewhite 5.63e-06 ***
## expressionexci:scale(iLAP, scale = F) 0.218215
## racewhite:scale(iLAP, scale = F) 0.497820
## expressionexci:racewhite:scale(iLAP, scale = F) 0.106310
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) exprss racwht scale(iLAP,scl=F) scale(aLAP,scl=F)
## expressinxc -0.149
## racewhite -0.149 0.500
## scale(iLAP,scl=F) 0.000 0.000 0.000
## scale(aLAP,scl=F) 0.000 0.000 0.000 -0.045
## exprssnxc:r 0.106 -0.707 -0.707 0.000 0.000
## e:(LAP,s=F) 0.000 0.000 0.000 -0.149 0.000
## r:(LAP,s=F) 0.000 0.000 0.000 -0.149 0.000
## e::(LAP,s=F 0.000 0.000 0.000 0.106 0.000
## exprs: e:(s=F r:(s=F
## expressinxc
## racewhite
## scale(iLAP,scl=F)
## scale(aLAP,scl=F)
## exprssnxc:r
## e:(LAP,s=F) 0.000
## r:(LAP,s=F) 0.000 0.500
## e::(LAP,s=F 0.000 -0.707 -0.707
#Plot
expr_colors=c("#94B3D7","#D99594") #Set correct colors for "expression" variable for the jittered points in the graphs below
#iHAP
Data_noNeut_mod %>%
ggplot(aes(x = iHAP, y = response, fill = expression)) +
facet_grid(~race) +
geom_jitter(aes(colour = expression, alpha=0.01), width = 0.2, height = 0.4) +
geom_smooth(method=lm, color='#2C3E50') +
guides(fill=guide_legend(title="Player 2 Expression")) +
scale_fill_manual(values=c("#94B3D7", "#D99594")) + #Set correct ribbon colors
scale_color_manual(values = expr_colors) + #Set correct jitter (point) colors
xlab("Participant ideal HAP") +
ylab("Amount Given ($)") +
ylim(c(0,10))## Warning: Removed 71 rows containing missing values (geom_point).
#iLAP
Data_noNeut_mod %>%
ggplot(aes(x = iLAP, y = response, fill = expression)) +
facet_grid(~race) +
geom_jitter(aes(colour = expression, alpha=0.01), width = 0.2, height = 0.4) +
geom_smooth(method=lm, color='#2C3E50') +
guides(fill=guide_legend(title="Player 2 Expression")) +
scale_fill_manual(values=c("#94B3D7", "#D99594")) + #Set correct ribbon colors
scale_color_manual(values = expr_colors) + #Set correct jitter (point) colors
xlab("Participant ideal LAP") +
ylab("Amount Given ($)") +
ylim(c(0,10))## Warning: Removed 62 rows containing missing values (geom_point).
# purpose: to check for main effect of reputation
# check default coding
contrasts(Data_noNeut$reputation)## mod low
## high 0 0
## mod 1 0
## low 0 1
# use effect coding
contrasts(Data_noNeut$reputation) <- cbind(Linear = c(1, 0, -1),
Quad = c(-1, 2, -1))
contrasts(Data_noNeut$reputation)## Linear Quad
## high 1 -1
## mod 0 2
## low -1 -1
# when using effect coding, intercept is grand mean
model1_effect <- lmer(data = Data_noNeut, response ~ reputation + (1 | pID), REML=FALSE)
summary(model1_effect)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19207.4 19240.1 -9598.7 19197.4 5083
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.6803 -0.6089 -0.0365 0.5811 4.5554
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.331 1.527
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 4.081e+00 1.815e-01 1.060e+02 22.486 <2e-16 ***
## reputationLinear 2.050e+00 2.621e-02 4.982e+03 78.200 <2e-16 ***
## reputationQuad -5.405e-03 1.513e-02 4.982e+03 -0.357 0.721
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnL
## reputatnLnr 0.000
## reputatinQd 0.000 0.000
# check grand mean
grandmean <- Data_noNeut %>%
group_by(pID) %>%
summarise(mean = mean(response)) %>%
summarise(mean = mean(mean))
grandmean## # A tibble: 1 x 1
## mean
## <dbl>
## 1 4.08
# check means for each reputation condition mean
means <- Data_noNeut %>%
group_by(pID, reputation) %>%
summarise(mean = mean(response)) %>%
group_by(reputation) %>%
summarise(mean = mean(mean))
means## # A tibble: 3 x 2
## reputation mean
## <fct> <dbl>
## 1 high 6.14
## 2 mod 4.07
## 3 low 2.04
### Reincorporate below
# use effect coding
contrasts(Data$reputation) <- cbind(Linear = c(-1, 0, 1),
Quad = c(-1, 2, -1))
contrasts(Data$expression) <- cbind(ExcitVsOther = c(-1, -1, 2),
NeutVsCalm = c(-1, 1, 0))
contrasts(Data$expression)## ExcitVsOther NeutVsCalm
## neut -1 -1
## calm -1 1
## exci 2 0
model1_effect <- lmer(data = Data, response ~ reputation*expression + (1 | pID), REML=FALSE)
summary(model1_effect)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + (1 | pID)
## Data: Data
##
## AIC BIC logLik deviance df.resid
## 30591.8 30668.7 -15284.9 30569.8 8053
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.0157 -0.6319 -0.0227 0.5960 4.9927
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 4.428 2.104
## Residual 2.423 1.557
## Number of obs: 8064, groups: pID, 112
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 4.279e+00 1.996e-01 1.120e+02
## reputationLinear 1.964e+00 2.123e-02 7.952e+03
## reputationQuad -2.641e-02 1.226e-02 7.952e+03
## expressionExcitVsOther -9.115e-03 1.226e-02 7.952e+03
## expressionNeutVsCalm 3.367e-02 2.123e-02 7.952e+03
## reputationLinear:expressionExcitVsOther -1.683e-02 1.501e-02 7.952e+03
## reputationQuad:expressionExcitVsOther -2.790e-04 8.668e-03 7.952e+03
## reputationLinear:expressionNeutVsCalm -3.097e-02 2.600e-02 7.952e+03
## reputationQuad:expressionNeutVsCalm 4.288e-02 1.501e-02 7.952e+03
## t value Pr(>|t|)
## (Intercept) 21.438 <2e-16 ***
## reputationLinear 92.501 <2e-16 ***
## reputationQuad -2.155 0.0312 *
## expressionExcitVsOther -0.744 0.4572
## expressionNeutVsCalm 1.586 0.1128
## reputationLinear:expressionExcitVsOther -1.121 0.2622
## reputationQuad:expressionExcitVsOther -0.032 0.9743
## reputationLinear:expressionNeutVsCalm -1.191 0.2337
## reputationQuad:expressionNeutVsCalm 2.856 0.0043 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnL rpttnQ expEVO expNVC rL:EVO rQ:EVO rL:NVC
## reputatnLnr 0.000
## reputatinQd 0.000 0.000
## exprssnExVO 0.000 0.000 0.000
## exprssnNtVC 0.000 0.000 0.000 0.000
## rpttnLn:EVO 0.000 0.000 0.000 0.000 0.000
## rpttnQd:EVO 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnLn:NVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnQd:NVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
# separate dataframe into males and females only
Data_Males <- Data_noNeut %>%
filter(Gender == "Male")
Data_Females <- Data_noNeut %>%
filter(Gender == "Female")
# plot descriptives
summary <- Data_noVar %>%
# calculate for each subject
ungroup() %>%
group_by(pID, expression, reputation, Gender, race, sex) %>%
summarize(n = n(),
mean = mean(response, na.rm = T),
stdv = sd(response),
sem = stdv / sqrt(n)) %>%
# calculate across subjects
group_by(expression, reputation, Gender, race, sex) %>%
summarize(n = n(),
mean = mean(mean, na.rm = T),
stdv = mean(stdv, na.rm = T),
sem = mean(sem, na.rm = T))## Warning: Factor `Gender` contains implicit NA, consider using
## `forcats::fct_explicit_na`
## Warning: Factor `Gender` contains implicit NA, consider using
## `forcats::fct_explicit_na`
genderSummary <- summary %>%
filter(expression != "neut") %>%
filter(Gender == "Male" | Gender == "Female")
ggplot(genderSummary, aes(x = reputation, y = mean, fill = expression)) +
geom_bar(stat = "identity", position="dodge") +
geom_errorbar(width = .33, position = position_dodge(.9), aes(ymin = (mean-sem), ymax = (mean+sem))) +
scale_fill_manual(values=c("#94b3d7", "#d99594")) +
facet_grid(~ Gender * race * sex) +
xlab("Target Reputation") +
ylab("Mean Offer ($)") +
scale_y_continuous(limits = c(0, 10))# males only
# full model
Data_Males$reputation <- relevel(Data_Males$reputation, ref = "low")
model_males <- lmer(data = Data_Males, response ~ reputation * expression * race * sex +
FamSES2num + (1|pID), REML=FALSE)
summary(model_males)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression * race * sex + FamSES2num +
## (1 | pID)
## Data: Data_Males
##
## AIC BIC logLik deviance df.resid
## 7263.2 7413.4 -3604.6 7209.2 1893
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.1010 -0.6709 -0.0355 0.6717 3.9634
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 1.871 1.368
## Residual 2.317 1.522
## Number of obs: 1920, groups: pID, 40
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) -1.240e+00 6.031e-01
## reputationhigh 2.662e+00 2.407e-01
## reputationmod 1.587e+00 2.407e-01
## expressionexci 1.500e-01 2.407e-01
## racewhite 6.250e-02 2.407e-01
## sexmale 5.000e-02 2.407e-01
## FamSES2num 6.185e-01 1.101e-01
## reputationhigh:expressionexci -1.250e-02 3.404e-01
## reputationmod:expressionexci -3.875e-01 3.404e-01
## reputationhigh:racewhite -1.000e-01 3.404e-01
## reputationmod:racewhite -2.250e-01 3.404e-01
## expressionexci:racewhite -2.875e-01 3.404e-01
## reputationhigh:sexmale -1.625e-01 3.404e-01
## reputationmod:sexmale -2.500e-02 3.404e-01
## expressionexci:sexmale 4.626e-14 3.404e-01
## racewhite:sexmale 1.625e-01 3.404e-01
## reputationhigh:expressionexci:racewhite -2.500e-02 4.813e-01
## reputationmod:expressionexci:racewhite 3.875e-01 4.813e-01
## reputationhigh:expressionexci:sexmale 7.500e-02 4.813e-01
## reputationmod:expressionexci:sexmale -3.000e-01 4.813e-01
## reputationhigh:racewhite:sexmale 2.375e-01 4.813e-01
## reputationmod:racewhite:sexmale -2.375e-01 4.813e-01
## expressionexci:racewhite:sexmale 1.000e-01 4.813e-01
## reputationhigh:expressionexci:racewhite:sexmale -3.875e-01 6.807e-01
## reputationmod:expressionexci:racewhite:sexmale 5.750e-01 6.807e-01
## df t value
## (Intercept) 4.688e+01 -2.057
## reputationhigh 1.880e+03 11.063
## reputationmod 1.880e+03 6.596
## expressionexci 1.880e+03 0.623
## racewhite 1.880e+03 0.260
## sexmale 1.880e+03 0.208
## FamSES2num 4.000e+01 5.619
## reputationhigh:expressionexci 1.880e+03 -0.037
## reputationmod:expressionexci 1.880e+03 -1.139
## reputationhigh:racewhite 1.880e+03 -0.294
## reputationmod:racewhite 1.880e+03 -0.661
## expressionexci:racewhite 1.880e+03 -0.845
## reputationhigh:sexmale 1.880e+03 -0.477
## reputationmod:sexmale 1.880e+03 -0.073
## expressionexci:sexmale 1.880e+03 0.000
## racewhite:sexmale 1.880e+03 0.477
## reputationhigh:expressionexci:racewhite 1.880e+03 -0.052
## reputationmod:expressionexci:racewhite 1.880e+03 0.805
## reputationhigh:expressionexci:sexmale 1.880e+03 0.156
## reputationmod:expressionexci:sexmale 1.880e+03 -0.623
## reputationhigh:racewhite:sexmale 1.880e+03 0.493
## reputationmod:racewhite:sexmale 1.880e+03 -0.493
## expressionexci:racewhite:sexmale 1.880e+03 0.208
## reputationhigh:expressionexci:racewhite:sexmale 1.880e+03 -0.569
## reputationmod:expressionexci:racewhite:sexmale 1.880e+03 0.845
## Pr(>|t|)
## (Intercept) 0.0453 *
## reputationhigh < 2e-16 ***
## reputationmod 5.47e-11 ***
## expressionexci 0.5332
## racewhite 0.7951
## sexmale 0.8354
## FamSES2num 1.62e-06 ***
## reputationhigh:expressionexci 0.9707
## reputationmod:expressionexci 0.2551
## reputationhigh:racewhite 0.7689
## reputationmod:racewhite 0.5086
## expressionexci:racewhite 0.3984
## reputationhigh:sexmale 0.6331
## reputationmod:sexmale 0.9415
## expressionexci:sexmale 1.0000
## racewhite:sexmale 0.6331
## reputationhigh:expressionexci:racewhite 0.9586
## reputationmod:expressionexci:racewhite 0.4209
## reputationhigh:expressionexci:sexmale 0.8762
## reputationmod:expressionexci:sexmale 0.5332
## reputationhigh:racewhite:sexmale 0.6218
## reputationmod:racewhite:sexmale 0.6218
## expressionexci:racewhite:sexmale 0.8354
## reputationhigh:expressionexci:racewhite:sexmale 0.5693
## reputationmod:expressionexci:racewhite:sexmale 0.3984
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 25 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# females only
# full model
Data_Females$reputation <- relevel(Data_Females$reputation, ref = "low")
model_females <- lmer(data = Data_Females, response ~ reputation * expression * race * sex +
FamSES2num + (1|pID), REML=FALSE)
summary(model_females)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression * race * sex + FamSES2num +
## (1 | pID)
## Data: Data_Females
##
## AIC BIC logLik deviance df.resid
## 10693.4 10855.3 -5319.7 10639.4 2949
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -5.0477 -0.5425 -0.0331 0.5330 4.7713
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.710 1.646
## Residual 1.914 1.383
## Number of obs: 2976, groups: pID, 62
##
## Fixed effects:
## Estimate Std. Error
## (Intercept) 7.463e-01 1.227e+00
## reputationhigh 5.048e+00 1.757e-01
## reputationmod 3.048e+00 1.757e-01
## expressionexci 1.048e-01 1.757e-01
## racewhite 3.952e-01 1.757e-01
## sexmale 2.984e-01 1.757e-01
## FamSES2num 1.645e-01 1.746e-01
## reputationhigh:expressionexci 3.226e-01 2.485e-01
## reputationmod:expressionexci -5.887e-01 2.485e-01
## reputationhigh:racewhite -2.177e-01 2.485e-01
## reputationmod:racewhite -7.097e-01 2.485e-01
## expressionexci:racewhite -4.032e-01 2.485e-01
## reputationhigh:sexmale -3.226e-02 2.485e-01
## reputationmod:sexmale -5.081e-01 2.485e-01
## expressionexci:sexmale 5.645e-02 2.485e-01
## racewhite:sexmale -3.145e-01 2.485e-01
## reputationhigh:expressionexci:racewhite -3.306e-01 3.514e-01
## reputationmod:expressionexci:racewhite 7.984e-01 3.514e-01
## reputationhigh:expressionexci:sexmale -3.952e-01 3.514e-01
## reputationmod:expressionexci:sexmale 1.290e-01 3.514e-01
## reputationhigh:racewhite:sexmale 3.548e-01 3.514e-01
## reputationmod:racewhite:sexmale 4.435e-01 3.514e-01
## expressionexci:racewhite:sexmale 2.903e-01 3.514e-01
## reputationhigh:expressionexci:racewhite:sexmale 7.322e-14 4.969e-01
## reputationmod:expressionexci:racewhite:sexmale -1.935e-01 4.969e-01
## df t value
## (Intercept) 6.324e+01 0.608
## reputationhigh 2.914e+03 28.736
## reputationmod 2.914e+03 17.352
## expressionexci 2.914e+03 0.597
## racewhite 2.914e+03 2.249
## sexmale 2.914e+03 1.698
## FamSES2num 6.200e+01 0.942
## reputationhigh:expressionexci 2.914e+03 1.298
## reputationmod:expressionexci 2.914e+03 -2.370
## reputationhigh:racewhite 2.914e+03 -0.876
## reputationmod:racewhite 2.914e+03 -2.856
## expressionexci:racewhite 2.914e+03 -1.623
## reputationhigh:sexmale 2.914e+03 -0.130
## reputationmod:sexmale 2.914e+03 -2.045
## expressionexci:sexmale 2.914e+03 0.227
## racewhite:sexmale 2.914e+03 -1.266
## reputationhigh:expressionexci:racewhite 2.914e+03 -0.941
## reputationmod:expressionexci:racewhite 2.914e+03 2.272
## reputationhigh:expressionexci:sexmale 2.914e+03 -1.125
## reputationmod:expressionexci:sexmale 2.914e+03 0.367
## reputationhigh:racewhite:sexmale 2.914e+03 1.010
## reputationmod:racewhite:sexmale 2.914e+03 1.262
## expressionexci:racewhite:sexmale 2.914e+03 0.826
## reputationhigh:expressionexci:racewhite:sexmale 2.914e+03 0.000
## reputationmod:expressionexci:racewhite:sexmale 2.914e+03 -0.390
## Pr(>|t|)
## (Intercept) 0.54517
## reputationhigh < 2e-16 ***
## reputationmod < 2e-16 ***
## expressionexci 0.55072
## racewhite 0.02457 *
## sexmale 0.08953 .
## FamSES2num 0.34989
## reputationhigh:expressionexci 0.19427
## reputationmod:expressionexci 0.01788 *
## reputationhigh:racewhite 0.38089
## reputationmod:racewhite 0.00432 **
## expressionexci:racewhite 0.10471
## reputationhigh:sexmale 0.89670
## reputationmod:sexmale 0.04095 *
## expressionexci:sexmale 0.82027
## racewhite:sexmale 0.20565
## reputationhigh:expressionexci:racewhite 0.34677
## reputationmod:expressionexci:racewhite 0.02314 *
## reputationhigh:expressionexci:sexmale 0.26083
## reputationmod:expressionexci:sexmale 0.71347
## reputationhigh:racewhite:sexmale 0.31263
## reputationmod:racewhite:sexmale 0.20692
## expressionexci:racewhite:sexmale 0.40872
## reputationhigh:expressionexci:racewhite:sexmale 1.00000
## reputationmod:expressionexci:racewhite:sexmale 0.69693
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 25 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
# check default coding
contrasts(Data_noVar$reputation)## mod high
## low 0 0
## mod 1 0
## high 0 1
contrasts(Data_noVar$expression)## calm exci
## neut 0 0
## calm 1 0
## exci 0 1
contrasts(Data_noVar$sex)## male
## female 0
## male 1
contrasts(Data_noVar$race)## white
## asian 0
## white 1
#recode
contrasts(Data_noVar$reputation) <- cbind(line = c(-1, 0, 1),
quad = c(-1, 2, -1))
contrasts(Data_noVar$expression) <- cbind(NeutVOther = c(2, -1, -1),
ExciVCalm = c(0, -1, 1))
contrasts(Data_noVar$sex) <- cbind(MaleVFemale = c(-1, 1))
contrasts(Data_noVar$race) <- cbind(WhiteVAsian = c(-1, 1))
#when using effect coding, intercept is grand mean
model <- lmer(data = Data_noVar, response ~ reputation * expression + race + sex + (1|pID), REML = FALSE)
summary(model)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + race + sex + (1 | pID)
## Data: Data_noVar
##
## AIC BIC logLik deviance df.resid
## 28865.4 28955.7 -14419.7 28839.4 7619
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.1414 -0.6070 -0.0268 0.5977 5.0525
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.381 1.839
## Residual 2.403 1.550
## Number of obs: 7632, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 4.068e+00 1.795e-01 1.060e+02
## reputationline 2.075e+00 2.173e-02 7.526e+03
## reputationquad -2.791e-02 1.255e-02 7.526e+03
## expressionNeutVOther -1.297e-02 1.255e-02 7.526e+03
## expressionExciVCalm -3.223e-02 2.173e-02 7.526e+03
## raceWhiteVAsian 2.267e-02 1.774e-02 7.526e+03
## sexMaleVFemale 3.105e-02 1.774e-02 7.526e+03
## reputationline:expressionNeutVOther 2.526e-02 1.537e-02 7.526e+03
## reputationquad:expressionNeutVOther -2.250e-02 8.872e-03 7.526e+03
## reputationline:expressionExciVCalm -1.032e-02 2.661e-02 7.526e+03
## reputationquad:expressionExciVCalm -2.309e-02 1.537e-02 7.526e+03
## t value Pr(>|t|)
## (Intercept) 22.668 <2e-16 ***
## reputationline 95.490 <2e-16 ***
## reputationquad -2.224 0.0261 *
## expressionNeutVOther -1.034 0.3012
## expressionExciVCalm -1.483 0.1380
## raceWhiteVAsian 1.278 0.2014
## sexMaleVFemale 1.750 0.0801 .
## reputationline:expressionNeutVOther 1.644 0.1003
## reputationquad:expressionNeutVOther -2.537 0.0112 *
## reputationline:expressionExciVCalm -0.388 0.6983
## reputationquad:expressionExciVCalm -1.503 0.1329
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnq expNVO expEVC rcWhVA sxMlVF rpttnl:NVO
## reputatinln 0.000
## reputatinqd 0.000 0.000
## exprssnNtVO 0.000 0.000 0.000
## exprssnExVC 0.000 0.000 0.000 0.000
## raceWhtVAsn 0.000 0.000 0.000 0.000 0.000
## sexMaleVFml 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnln:NVO 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnqd:NVO 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnln:EVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnqd:EVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnq:NVO rpttnl:EVC
## reputatinln
## reputatinqd
## exprssnNtVO
## exprssnExVC
## raceWhtVAsn
## sexMaleVFml
## rpttnln:NVO
## rpttnqd:NVO
## rpttnln:EVC 0.000
## rpttnqd:EVC 0.000 0.000
#use Data_noNeut instead of Data_noVar
#recode
contrasts(Data_noNeut$reputation) <- cbind(line = c(-1, 0, 1),
quad = c(-1, 2, -1))
contrasts(Data_noNeut$expression) <- cbind(ExciVCalm = c(-1, 1))
contrasts(Data_noNeut$sex) <- cbind(MaleVFemale = c(-1, 1))
contrasts(Data_noNeut$race) <- cbind(WhiteVAsian = c(-1, 1))
#when using effect coding, intercept is grand mean
model <- lmer(data = Data_noNeut, response ~ reputation * expression + race + sex + (1|pID), REML = FALSE)
summary(model)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula: response ~ reputation * expression + race + sex + (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 19206.9 19272.2 -9593.4 19186.9 5078
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.7360 -0.6062 -0.0421 0.5863 4.5319
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 3.443 1.856
## Residual 2.326 1.525
## Number of obs: 5088, groups: pID, 106
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 4.081e+00 1.815e-01 1.060e+02
## reputationline -2.050e+00 2.618e-02 4.982e+03
## reputationquad -5.405e-03 1.512e-02 4.982e+03
## expressionExciVCalm -3.223e-02 2.138e-02 4.982e+03
## raceWhiteVAsian -6.682e-03 2.138e-02 4.982e+03
## sexMaleVFemale 5.110e-02 2.138e-02 4.982e+03
## reputationline:expressionExciVCalm 1.032e-02 2.618e-02 4.982e+03
## reputationquad:expressionExciVCalm -2.309e-02 1.512e-02 4.982e+03
## t value Pr(>|t|)
## (Intercept) 22.486 <2e-16 ***
## reputationline -78.283 <2e-16 ***
## reputationquad -0.358 0.7207
## expressionExciVCalm -1.508 0.1317
## raceWhiteVAsian -0.313 0.7546
## sexMaleVFemale 2.390 0.0169 *
## reputationline:expressionExciVCalm 0.394 0.6936
## reputationquad:expressionExciVCalm -1.528 0.1267
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnq expEVC rcWhVA sxMlVF rpttnl:EVC
## reputatinln 0.000
## reputatinqd 0.000 0.000
## exprssnExVC 0.000 0.000 0.000
## raceWhtVAsn 0.000 0.000 0.000 0.000
## sexMaleVFml 0.000 0.000 0.000 0.000 0.000
## rpttnln:EVC 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnqd:EVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000
# check default coding
contrasts(Data_noNeut$Gender)## Female
## Male 0
## Female 1
#recode
contrasts(Data_noNeut$Gender) <- cbind(FemaleVMale = c(-1,1))
#when using effect coding, intercept is grand mean
model <- lmer(data = Data_noNeut, response ~ reputation * expression + race + sex + Gender + FamSES2num + (1|pID), REML = FALSE)
summary(model)## Linear mixed model fit by maximum likelihood . t-tests use
## Satterthwaite's method [lmerModLmerTest]
## Formula:
## response ~ reputation * expression + race + sex + Gender + FamSES2num +
## (1 | pID)
## Data: Data_noNeut
##
## AIC BIC logLik deviance df.resid
## 18476 18554 -9226 18452 4884
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.7006 -0.6123 -0.0433 0.5801 4.5039
##
## Random effects:
## Groups Name Variance Std.Dev.
## pID (Intercept) 2.492 1.579
## Residual 2.336 1.528
## Number of obs: 4896, groups: pID, 102
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 1.234e+00 6.161e-01 1.020e+02
## reputationline -2.017e+00 2.675e-02 4.794e+03
## reputationquad -2.757e-03 1.545e-02 4.794e+03
## expressionExciVCalm -3.288e-02 2.184e-02 4.794e+03
## raceWhiteVAsian -3.064e-03 2.184e-02 4.794e+03
## sexMaleVFemale 5.494e-02 2.184e-02 4.794e+03
## GenderFemaleVMale 2.750e-01 1.910e-01 1.020e+02
## FamSES2num 4.538e-01 1.011e-01 1.020e+02
## reputationline:expressionExciVCalm 1.440e-02 2.675e-02 4.794e+03
## reputationquad:expressionExciVCalm -2.584e-02 1.545e-02 4.794e+03
## t value Pr(>|t|)
## (Intercept) 2.003 0.0478 *
## reputationline -75.387 < 2e-16 ***
## reputationquad -0.179 0.8583
## expressionExciVCalm -1.505 0.1323
## raceWhiteVAsian -0.140 0.8885
## sexMaleVFemale 2.515 0.0119 *
## GenderFemaleVMale 1.440 0.1529
## FamSES2num 4.489 1.89e-05 ***
## reputationline:expressionExciVCalm 0.538 0.5904
## reputationquad:expressionExciVCalm -1.673 0.0944 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) rpttnl rpttnq expEVC rcWhVA sxMlVF GndFVM FmSES2
## reputatinln 0.000
## reputatinqd 0.000 0.000
## exprssnExVC 0.000 0.000 0.000
## raceWhtVAsn 0.000 0.000 0.000 0.000
## sexMaleVFml 0.000 0.000 0.000 0.000 0.000
## GendrFmlVMl 0.466 0.000 0.000 0.000 0.000 0.000
## FamSES2num -0.965 0.000 0.000 0.000 0.000 0.000 -0.533
## rpttnln:EVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnqd:EVC 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
## rpttnl:EVC
## reputatinln
## reputatinqd
## exprssnExVC
## raceWhtVAsn
## sexMaleVFml
## GendrFmlVMl
## FamSES2num
## rpttnln:EVC
## rpttnqd:EVC 0.000