Load Packages

library(dplyr)
library(sandwich)
library(haven)
library(car)
library(effectsize)
library(interactions)
library(MASS)
library(AER)
library(ggeffects)
library(ggplot2)
library(interactions)
library(lme4)
library(lmtest)
library(lmerTest)
library(lavaan)
library(pscl)
library(RMediation)
library(multilevel)
library(stargazer)

options(scipen = 999)

Load Data (Pilot Study)

df_lab <- read.csv("df_lab.csv")

cat(
  "Number of participants:", nrow(df_lab), "\n",
  "Number of groups:", length(unique(df_lab$GroupID)), "\n",
  "Average group size:", mean(df_lab$GroupSize), "\n",
  "Min and max group size:", range(df_lab$GroupSize), "\n"
)
## Number of participants: 219 
##  Number of groups: 62 
##  Average group size: 4.821918 
##  Min and max group size: 3 6
df_lab$Ingratiation <- factor(df_lab$Ingratiation)
df_lab$Promotion <- factor(df_lab$Promotion)


df_lab$NewcomerRace <- factor(df_lab$NewcomerRace)
df_lab$NewcomerGender <- factor(df_lab$NewcomerGender)

Pilot Study: Ingratiation and Perceived Likeability

model <- lm(Liked ~ Ingratiation * NewcomerRace + Promotion + NewcomerGender, data = df_lab)

# View ANOVA table
Anova(model, type = 3)
## Anova Table (Type III tests)
## 
## Response: Liked
##                           Sum Sq  Df   F value               Pr(>F)    
## (Intercept)               563.10   1 1074.5100 < 0.0000000000000002 ***
## Ingratiation                0.11   1    0.2127              0.64512    
## NewcomerRace                0.28   1    0.5367              0.46462    
## Promotion                   0.33   1    0.6349              0.42645    
## NewcomerGender              0.51   1    0.9747              0.32463    
## Ingratiation:NewcomerRace   2.96   1    5.6514              0.01833 *  
## Residuals                 111.62 213                                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
###### Predicted values by race and condition
predicted_data <- ggpredict(model, terms = c("Ingratiation", "NewcomerRace"))
predicted_data
## # Predicted values of Liked
## 
## NewcomerRace: Black
## 
## Ingratiation | Predicted |     95% CI
## -------------------------------------
## High         |      6.09 | 5.73, 6.46
## Low          |      6.17 | 5.94, 6.39
## 
## NewcomerRace: White
## 
## Ingratiation | Predicted |     95% CI
## -------------------------------------
## High         |      6.22 | 5.85, 6.58
## Low          |      5.80 | 5.56, 6.04
## 
## Adjusted for:
## *      Promotion =   High
## * NewcomerGender = Female
# Simple slopes estimates
slope_results <- sim_slopes(model, pred = "Ingratiation", modx = "NewcomerRace", confint = TRUE)
print(slope_results)
## SIMPLE SLOPES ANALYSIS
## 
## Slope of Ingratiation when NewcomerRace = Black: 
## 
##   Est.   S.E.    2.5%   97.5%   t val.      p
## ------ ------ ------- ------- -------- ------
##   0.08   0.16   -0.25    0.40     0.46   0.65
## 
## Slope of Ingratiation when NewcomerRace = White: 
## 
##    Est.   S.E.    2.5%   97.5%   t val.      p
## ------- ------ ------- ------- -------- ------
##   -0.42   0.16   -0.74   -0.10    -2.60   0.01

Pilot Study: Self-Promotion and Perceived Competence

model <- lm(Respected ~ Promotion * NewcomerRace + Ingratiation + NewcomerGender, data = df_lab)

# View ANOVA table
Anova(model, type = 3)
## Anova Table (Type III tests)
## 
## Response: Respected
##                        Sum Sq  Df   F value               Pr(>F)    
## (Intercept)            686.86   1 2187.3584 < 0.0000000000000002 ***
## Promotion                1.88   1    5.9767              0.01531 *  
## NewcomerRace             1.42   1    4.5174              0.03471 *  
## Ingratiation             0.09   1    0.2838              0.59479    
## NewcomerGender           0.10   1    0.3027              0.58274    
## Promotion:NewcomerRace   0.90   1    2.8705              0.09168 .  
## Residuals               66.57 212                                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predicted values by race and condition
predicted_data <- ggpredict(model, terms = c("Promotion", "NewcomerRace"))
predicted_data
## # Predicted values of Respected
## 
## NewcomerRace: Black
## 
## Promotion | Predicted |     95% CI
## ----------------------------------
## High      |      6.51 | 6.23, 6.78
## Low       |      6.22 | 6.03, 6.40
## 
## NewcomerRace: White
## 
## Promotion | Predicted |     95% CI
## ----------------------------------
## High      |      6.24 | 5.95, 6.53
## Low       |      6.22 | 6.03, 6.40
## 
## Adjusted for:
## *   Ingratiation =   High
## * NewcomerGender = Female
# Simple slopes estimates
slope_results <- sim_slopes(model, pred = "Promotion", modx = "NewcomerRace", confint = TRUE)
print(slope_results)
## SIMPLE SLOPES ANALYSIS
## 
## Slope of Promotion when NewcomerRace = Black: 
## 
##    Est.   S.E.    2.5%   97.5%   t val.      p
## ------- ------ ------- ------- -------- ------
##   -0.29   0.12   -0.53   -0.06    -2.44   0.02
## 
## Slope of Promotion when NewcomerRace = White: 
## 
##    Est.   S.E.    2.5%   97.5%   t val.      p
## ------- ------ ------- ------- -------- ------
##   -0.03   0.13   -0.27    0.22    -0.21   0.84

Pilot Study: Ingratiation and Coworker Support

videoData <- read.csv("videoData.csv")

videoData$NewcomerRace <- factor(videoData$NewcomerRace,
                                  levels = c(0, 1),
                                  labels = c("White", "Racial Minority"))
videoData$Promotion <- factor(videoData$Promotion,
                                 levels = c(0, 1),
                                 labels = c("Low Self-Promotion", "High Self-Promotion"))  
videoData$Ingratiation <- factor(videoData$Ingratiation,
                                 levels = c(0, 1),
                                 labels = c("Low Ingratiation", " High Ingratiation"))  


# Poisson Regression
poisson_model <- glm(
  Support ~ Promotion + Ingratiation*NewcomerRace,
  family = "poisson",
  data = videoData)
coeftest(poisson_model, vcov = sandwich)
## 
## z test of coefficients:
## 
##                                                             Estimate Std. Error
## (Intercept)                                                  0.22661    0.48381
## PromotionHigh Self-Promotion                                -0.23157    0.57538
## Ingratiation High Ingratiation                               0.56185    0.79836
## NewcomerRaceRacial Minority                                  0.12660    0.54784
## Ingratiation High Ingratiation:NewcomerRaceRacial Minority -18.21764    0.95049
##                                                             z value
## (Intercept)                                                  0.4684
## PromotionHigh Self-Promotion                                -0.4025
## Ingratiation High Ingratiation                               0.7038
## NewcomerRaceRacial Minority                                  0.2311
## Ingratiation High Ingratiation:NewcomerRaceRacial Minority -19.1665
##                                                                       Pr(>|z|)
## (Intercept)                                                             0.6395
## PromotionHigh Self-Promotion                                            0.6873
## Ingratiation High Ingratiation                                          0.4816
## NewcomerRaceRacial Minority                                             0.8173
## Ingratiation High Ingratiation:NewcomerRaceRacial Minority <0.0000000000000002
##                                                               
## (Intercept)                                                   
## PromotionHigh Self-Promotion                                  
## Ingratiation High Ingratiation                                
## NewcomerRaceRacial Minority                                   
## Ingratiation High Ingratiation:NewcomerRaceRacial Minority ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Tests for Overdispersion
dispersiontest(poisson_model)
## 
##  Overdispersion test
## 
## data:  poisson_model
## z = 2.1173, p-value = 0.01712
## alternative hypothesis: true dispersion is greater than 1
## sample estimates:
## dispersion 
##   2.932338
# Negative Binomial Regression
zinb_model <- zeroinfl(
  Support ~ Promotion + Ingratiation * NewcomerRace | Promotion + Ingratiation + NewcomerRace,
  data = videoData,
  dist = "negbin"
)

# Compare Fit of Poisson and NB Models
lrtest(poisson_model, zinb_model)
## Likelihood ratio test
## 
## Model 1: Support ~ Promotion + Ingratiation * NewcomerRace
## Model 2: Support ~ Promotion + Ingratiation * NewcomerRace | Promotion + 
##     Ingratiation + NewcomerRace
##   #Df  LogLik Df  Chisq  Pr(>Chisq)    
## 1   5 -69.890                          
## 2  10 -52.538  5 34.705 0.000001723 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Summary of Zero-Inflated NB Model Results with Robust Standard Errors
coeftest(zinb_model, vcov = sandwich) 
## 
## t test of coefficients:
## 
##                                                                   Estimate
## count_(Intercept)                                                  0.63595
## count_PromotionHigh Self-Promotion                                 0.22256
## count_Ingratiation High Ingratiation                               0.92780
## count_NewcomerRaceRacial Minority                                 -0.35172
## count_Ingratiation High Ingratiation:NewcomerRaceRacial Minority -18.21764
## zero_(Intercept)                                                  -0.97757
## zero_PromotionHigh Self-Promotion                                  1.45765
## zero_Ingratiation High Ingratiation                                1.13562
## zero_NewcomerRaceRacial Minority                                  -1.64505
##                                                                  Std. Error
## count_(Intercept)                                                   0.56275
## count_PromotionHigh Self-Promotion                                  0.73777
## count_Ingratiation High Ingratiation                                0.54133
## count_NewcomerRaceRacial Minority                                   0.55920
## count_Ingratiation High Ingratiation:NewcomerRaceRacial Minority    0.80467
## zero_(Intercept)                                                    2.49255
## zero_PromotionHigh Self-Promotion                                   1.99516
## zero_Ingratiation High Ingratiation                                 2.16766
## zero_NewcomerRaceRacial Minority                                    2.79846
##                                                                   t value
## count_(Intercept)                                                  1.1301
## count_PromotionHigh Self-Promotion                                 0.3017
## count_Ingratiation High Ingratiation                               1.7139
## count_NewcomerRaceRacial Minority                                 -0.6290
## count_Ingratiation High Ingratiation:NewcomerRaceRacial Minority -22.6400
## zero_(Intercept)                                                  -0.3922
## zero_PromotionHigh Self-Promotion                                  0.7306
## zero_Ingratiation High Ingratiation                                0.5239
## zero_NewcomerRaceRacial Minority                                  -0.5878
##                                                                              Pr(>|t|)
## count_(Intercept)                                                             0.26740
## count_PromotionHigh Self-Promotion                                            0.76499
## count_Ingratiation High Ingratiation                                          0.09686
## count_NewcomerRaceRacial Minority                                             0.53413
## count_Ingratiation High Ingratiation:NewcomerRaceRacial Minority < 0.0000000000000002
## zero_(Intercept)                                                              0.69768
## zero_PromotionHigh Self-Promotion                                             0.47070
## zero_Ingratiation High Ingratiation                                           0.60420
## zero_NewcomerRaceRacial Minority                                              0.56104
##                                                                     
## count_(Intercept)                                                   
## count_PromotionHigh Self-Promotion                                  
## count_Ingratiation High Ingratiation                             .  
## count_NewcomerRaceRacial Minority                                   
## count_Ingratiation High Ingratiation:NewcomerRaceRacial Minority ***
## zero_(Intercept)                                                    
## zero_PromotionHigh Self-Promotion                                   
## zero_Ingratiation High Ingratiation                                 
## zero_NewcomerRaceRacial Minority                                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predicted values by race and condition
predicted_data <- ggpredict(zinb_model, terms = c("Promotion", "NewcomerRace"))
predicted_data
## # Predicted (conditional) counts of Support
## 
## NewcomerRace: White
## 
## Promotion           | Predicted |      95% CI
## ---------------------------------------------
## Low Self-Promotion  |      1.89 | 0.62,  5.79
## High Self-Promotion |      2.36 | 0.53, 10.44
## 
## NewcomerRace: Racial Minority
## 
## Promotion           | Predicted |      95% CI
## ---------------------------------------------
## Low Self-Promotion  |      1.33 | 0.45,  3.92
## High Self-Promotion |      1.66 | 0.52,  5.26
## 
## Adjusted for:
## * Ingratiation = Low Ingratiation

Pilot Study: Self-Promotion and Coworker Support

# Negative Binomial Regression
zinb_model <- zeroinfl(
  Support ~ Promotion + Ingratiation + Promotion* NewcomerRace | Promotion + Ingratiation + NewcomerRace,
  data = videoData,
  dist = "negbin"
)
coeftest(zinb_model, vcov = sandwich) 
## 
## t test of coefficients:
## 
##                                                                 Estimate
## count_(Intercept)                                                0.48551
## count_PromotionHigh Self-Promotion                              -1.04513
## count_Ingratiation High Ingratiation                             0.93993
## count_NewcomerRaceRacial Minority                               -0.48548
## count_PromotionHigh Self-Promotion:NewcomerRaceRacial Minority   1.63583
## zero_(Intercept)                                               -20.50672
## zero_PromotionHigh Self-Promotion                                8.36395
## zero_Ingratiation High Ingratiation                             20.39109
## zero_NewcomerRaceRacial Minority                                10.55091
##                                                                Std. Error
## count_(Intercept)                                                 0.42045
## count_PromotionHigh Self-Promotion                                0.81174
## count_Ingratiation High Ingratiation                              0.61755
## count_NewcomerRaceRacial Minority                                 0.64936
## count_PromotionHigh Self-Promotion:NewcomerRaceRacial Minority    1.29443
## zero_(Intercept)                                                  2.27076
## zero_PromotionHigh Self-Promotion                                 3.56941
## zero_Ingratiation High Ingratiation                               1.64757
## zero_NewcomerRaceRacial Minority                                  1.42228
##                                                                t value
## count_(Intercept)                                               1.1547
## count_PromotionHigh Self-Promotion                             -1.2875
## count_Ingratiation High Ingratiation                            1.5220
## count_NewcomerRaceRacial Minority                              -0.7476
## count_PromotionHigh Self-Promotion:NewcomerRaceRacial Minority  1.2637
## zero_(Intercept)                                               -9.0308
## zero_PromotionHigh Self-Promotion                               2.3432
## zero_Ingratiation High Ingratiation                            12.3764
## zero_NewcomerRaceRacial Minority                                7.4183
##                                                                          Pr(>|t|)
## count_(Intercept)                                                         0.25731
## count_PromotionHigh Self-Promotion                                        0.20776
## count_Ingratiation High Ingratiation                                      0.13847
## count_NewcomerRaceRacial Minority                                         0.46051
## count_PromotionHigh Self-Promotion:NewcomerRaceRacial Minority            0.21605
## zero_(Intercept)                                               0.0000000004649311
## zero_PromotionHigh Self-Promotion                                         0.02594
## zero_Ingratiation High Ingratiation                            0.0000000000002569
## zero_NewcomerRaceRacial Minority                               0.0000000288583999
##                                                                   
## count_(Intercept)                                                 
## count_PromotionHigh Self-Promotion                                
## count_Ingratiation High Ingratiation                              
## count_NewcomerRaceRacial Minority                                 
## count_PromotionHigh Self-Promotion:NewcomerRaceRacial Minority    
## zero_(Intercept)                                               ***
## zero_PromotionHigh Self-Promotion                              *  
## zero_Ingratiation High Ingratiation                            ***
## zero_NewcomerRaceRacial Minority                               ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Predicted values by race and condition
predicted_data <- ggpredict(zinb_model, terms = c("Promotion", "NewcomerRace"))
predicted_data
## # Predicted (conditional) counts of Support
## 
## NewcomerRace: White
## 
## Promotion           | Predicted |     95% CI
## --------------------------------------------
## Low Self-Promotion  |      1.63 | 0.62, 4.27
## High Self-Promotion |      0.57 | 0.16, 2.10
## 
## NewcomerRace: Racial Minority
## 
## Promotion           | Predicted |     95% CI
## --------------------------------------------
## Low Self-Promotion  |      1.00 | 0.32, 3.10
## High Self-Promotion |      1.81 | 0.45, 7.26
## 
## Adjusted for:
## * Ingratiation = Low Ingratiation

Load Data (Main Study)

MainStudy <- read.csv("MainStudy2.csv")
names(MainStudy)
##  [1] "unit"         "Gender"       "Minority"     "BLACK"        "WHITE"       
##  [6] "ASIAN"        "LATINO"       "Token"        "racialRep"    "G_Social"    
## [11] "PosFrame"     "IN_Seek"      "ING"          "SP"           "Support"     
## [16] "PJFit"        "PWFit"        "Mastery"      "Integrated"   "Role_Clarity"

Within-Group Correlations (CorrW)

for(pair in names(waba_results)) {
  cat("=== WABA for", pair, "===\n")
  print(waba_results[[pair]])
  cat("\n")
}
## === WABA for Minority_vs_IN_Seek ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 0.1183094 0.4899655 0.2687974 0.3863039 0.8717418 0.9631967 0.08030956
## 
## 
## === WABA for Minority_vs_G_Social ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx    EtaWy      CorrW
## 1 0.1853341 0.4899655 0.3608626 0.6404253 0.8717418 0.932619 0.08868402
## 
## 
## === WABA for Minority_vs_PosFrame ===
## $Cov.Theorem
##      RawCorr    EtaBx     EtaBy     CorrB     EtaWx     EtaWy       CorrW
## 1 0.02090969 0.490469 0.3968167 0.2218557 0.8714586 0.9178979 -0.02783971
## 
## 
## === WABA for Minority_vs_ING ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy        CorrW
## 1 -0.1029728 0.4876467 0.4821928 -0.4249487 0.8730411 0.8760651 -0.003988331
## 
## 
## === WABA for Minority_vs_SP ===
## $Cov.Theorem
##       RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.003224715 0.4876467 0.4053295 -0.2202956 0.8730411 0.9141707 0.0585983
## 
## 
## === WABA for Minority_vs_Support ===
## $Cov.Theorem
##       RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 0.003181644 0.4915178 0.3839424 0.5774331 0.8708675 0.9233571 -0.1315577
## 
## 
## === WABA for Minority_vs_PJFit ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 0.07411587 0.4915178 0.3966235 0.3279404 0.8708675 0.9179814 0.01273979
## 
## 
## === WABA for Minority_vs_PWFit ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy       CorrW
## 1 0.07175515 0.4943948 0.3742953 0.5909658 0.8692375 0.9273096 -0.04665065
## 
## 
## === WABA for IN_Seek_vs_G_Social ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx    EtaWy     CorrW
## 1 0.3279083 0.2687974 0.3608626 0.1607608 0.9631967 0.932619 0.3476747
## 
## 
## === WABA for IN_Seek_vs_PosFrame ===
## $Cov.Theorem
##     RawCorr     EtaBx   EtaBy      CorrB     EtaWx     EtaWy    CorrW
## 1 0.2252061 0.2684313 0.39575 0.02916205 0.9632988 0.9183583 0.251068
## 
## 
## === WABA for IN_Seek_vs_ING ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.1352324 0.2699224 0.4821928 -0.3767367 0.9628821 0.8760651 0.2184423
## 
## 
## === WABA for IN_Seek_vs_SP ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.1631707 0.2699224 0.4053295 -0.1123651 0.9628821 0.9141707 0.1993372
## 
## 
## === WABA for IN_Seek_vs_Support ===
## $Cov.Theorem
##   RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.14255 0.2687974 0.3943402 0.3037811 0.9631967 0.9189645 0.1246689
## 
## 
## === WABA for IN_Seek_vs_PJFit ===
## $Cov.Theorem
##        RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy      CorrW
## 1 -0.008764775 0.2687974 0.4086265 -0.1269159 0.9631967 0.9127017 0.00588706
## 
## 
## === WABA for IN_Seek_vs_PWFit ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 0.09131582 0.2573188 0.3771952 0.0686909 0.9663266 0.9261338 0.09458511
## 
## 
## === WABA for G_Social_vs_PosFrame ===
## $Cov.Theorem
##     RawCorr    EtaBx   EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 0.0993928 0.362898 0.39575 0.2890029 0.9318289 0.9183583 0.06764467
## 
## 
## === WABA for G_Social_vs_ING ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy       CorrB   EtaWx     EtaWy     CorrW
## 1 0.1430472 0.3661649 0.4821928 -0.02999257 0.93055 0.8760651 0.1819659
## 
## 
## === WABA for G_Social_vs_SP ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB   EtaWx     EtaWy     CorrW
## 1 0.2704614 0.3661649 0.4053295 0.1501254 0.93055 0.9141707 0.2917427
## 
## 
## === WABA for G_Social_vs_Support ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB    EtaWx     EtaWy     CorrW
## 1 0.1987818 0.3608626 0.3943402 0.2295173 0.932619 0.9189645 0.1938301
## 
## 
## === WABA for G_Social_vs_PJFit ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB    EtaWx     EtaWy     CorrW
## 1 0.1077937 0.3608626 0.4086265 0.1016332 0.932619 0.9127017 0.1090305
## 
## 
## === WABA for G_Social_vs_PWFit ===
## $Cov.Theorem
##     RawCorr    EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.2018943 0.362866 0.3771952 0.4156117 0.9318414 0.9261338 0.1680271
## 
## 
## === WABA for PosFrame_vs_ING ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.1118259 0.4024005 0.4820522 -0.1006987 0.9154637 0.8761425 0.1637739
## 
## 
## === WABA for PosFrame_vs_SP ===
## $Cov.Theorem
##       RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy      CorrW
## 1 -0.03407953 0.4024005 0.4051059 -0.397543 0.9154637 0.9142698 0.03671036
## 
## 
## === WABA for PosFrame_vs_Support ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx    EtaWy     CorrW
## 1 0.1299478 0.3968167 0.3814535 0.0771435 0.9178979 0.924388 0.1393892
## 
## 
## === WABA for PosFrame_vs_PJFit ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.1206872 0.3968167 0.3974754 -0.1520487 0.9178979 0.9176128 0.1717599
## 
## 
## === WABA for PosFrame_vs_PWFit ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.09573009 0.3946134 0.3750326 -0.1129854 0.9188472 0.9270116 0.1320187
## 
## 
## === WABA for ING_vs_SP ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy    CorrW
## 1 0.3397806 0.4821928 0.4053295 0.5171511 0.8760651 0.9141707 0.298056
## 
## 
## === WABA for ING_vs_Support ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy     CorrW
## 1 0.09675911 0.4821928 0.3944668 -0.4645389 0.8760651 0.9189102 0.2299538
## 
## 
## === WABA for ING_vs_PJFit ===
## $Cov.Theorem
##      RawCorr     EtaBx    EtaBy       CorrB     EtaWx     EtaWy      CorrW
## 1 0.06384844 0.4821928 0.408302 0.009708617 0.8760651 0.9128469 0.07744901
## 
## 
## === WABA for ING_vs_PWFit ===
## $Cov.Theorem
##      RawCorr     EtaBx     EtaBy      CorrB     EtaWx     EtaWy      CorrW
## 1 0.05058146 0.4801115 0.3751101 0.01086103 0.8772075 0.9269803 0.05979857
## 
## 
## === WABA for SP_vs_Support ===
## $Cov.Theorem
##        RawCorr     EtaBx     EtaBy       CorrB     EtaWx     EtaWy      CorrW
## 1 -0.002119489 0.4053295 0.3944668 -0.09281414 0.9141707 0.9189102 0.01514269
## 
## 
## === WABA for SP_vs_PJFit ===
## $Cov.Theorem
##     RawCorr     EtaBx    EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.1739955 0.4053295 0.408302 0.2066537 0.9141707 0.9128469 0.1675198
## 
## 
## === WABA for SP_vs_PWFit ===
## $Cov.Theorem
##    RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.153602 0.3985719 0.3751101 0.4484205 0.9171371 0.9269803 0.1018144
## 
## 
## === WABA for Support_vs_PJFit ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.1855998 0.3839424 0.3966235 0.4654507 0.9233571 0.9179814 0.1353437
## 
## 
## === WABA for Support_vs_PWFit ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.4368345 0.3825286 0.3742953 0.5919943 0.9239436 0.9273096 0.4109255
## 
## 
## === WABA for PJFit_vs_PWFit ===
## $Cov.Theorem
##     RawCorr     EtaBx     EtaBy     CorrB     EtaWx     EtaWy     CorrW
## 1 0.4497998 0.4208094 0.3742953 0.5178491 0.9071491 0.9273096 0.4377454

Group-Mean Center Impression Management Variables

# Create group means
MainStudy <- MainStudy %>%
  group_by(unit) %>%
  mutate(
    ING.G = mean(ING, na.rm = TRUE),
    SP.G = mean(SP, na.rm = TRUE)
  ) %>%
  ungroup()

# Center variables
MainStudy <- MainStudy %>%
  group_by(unit) %>%
  mutate(
    ING_c = ING - ING.G,
    SP_c = SP - SP.G
  ) %>%
  ungroup()

# Create interaction variables
MainStudy <- MainStudy %>%
  mutate(
    Minority_ING = Minority * ING_c,
    Minority_SP = Minority * SP_c
  )

Null Model: ICC(1)

null_model <- '
  level: 1
    PWFit ~ 1
    PJFit ~ 1
    Support ~ 1

  level: 2
    PWFit ~~ PJFit + Support
    PJFit ~~ Support
'

results <- sem(null_model, data = MainStudy, cluster = "unit")

# Compute ICC(1)
lavInspect(results, "icc")
##   PWFit   PJFit Support 
##   0.048   0.079   0.062
model <- '
  level: 1
    PWFit ~ a*Minority + a1*ING_c + a2*SP_c + a3*Minority_ING + a4*Minority_SP

    PJFit ~ b*Minority + b1*ING_c + b2*SP_c + b3*Minority_ING + b4*Minority_SP

  level: 2
    PWFit ~~ PWFit
    PJFit ~~ PJFit
    PWFit ~~ PJFit
    
    # Define Moderator Values
  White := 0
  NonWhite := 1
  
  LOW_ING := -.69
  HIGH_ING := .69

  # Conditional Effects for Ingratiation: PWFit
  SS_White_ING := a1 + a3*White
  SS_NonWhite_ING := a1 + a3*NonWhite
  
  # Conditional Effects for Ingratiation: PJFit
  SS_White_SP := b1 + b3*White
  SS_NonWhite_SP := b1 + b3*NonWhite
'
results <- sem(model, data = MainStudy, cluster = "unit", bootstrap = 5000, fixed.x = FALSE)
estimates <- parameterEstimates(results)[ parameterEstimates(results)[,'op'] == '~', c(1:3, 7:12)]
stargazer(estimates, summary=FALSE, type='text', rownames=FALSE, initial.zero=FALSE, digits=3, title='Model 2',out = "model2_table.html")
## 
## Model 2
## ================================================================
## lhs   op     rhs       est   se    z    pvalue ci.lower ci.upper
## ----------------------------------------------------------------
## PWFit ~    Minority   .034  .224  .153   .878   -.405     .474  
## PWFit ~     ING_c     .355  .207 1.716   .086   -.050     .760  
## PWFit ~      SP_c     .137  .152  .901   .368   -.161     .435  
## PWFit ~  Minority_ING -.595 .300 -1.981  .048   -1.183   -.006  
## PWFit ~  Minority_SP  -.002 .250 -.008   .994   -.493     .489  
## PJFit ~    Minority   .021  .188  .112   .911   -.347     .390  
## PJFit ~     ING_c     .113  .173  .656   .512   -.225     .452  
## PJFit ~      SP_c     .211  .127 1.670   .095   -.037     .460  
## PJFit ~  Minority_ING -.146 .252 -.580   .562   -.641     .348  
## PJFit ~  Minority_SP  -.042 .209 -.199   .842   -.451     .368  
## ----------------------------------------------------------------

Model 1: Main Effects and Mediation

model.1 <- '
  level: 1
    PWFit ~ IN_Seek + G_Social + PosFrame + Minority + ING_c + SP_c + b2*Support

    PJFit ~ IN_Seek + G_Social + PosFrame + Minority + ING_c + SP_c + b1*Support

    Support ~ IN_Seek + G_Social + PosFrame + Minority + a1*ING_c + a2*SP_c 
    
  level: 2
    PWFit ~~ PWFit
    PJFit ~~ PJFit
    PWFit ~~ PJFit
'

results.1 <- sem(model.1, data = MainStudy, cluster = "unit", bootstrap = 5000, fixed.x = FALSE)
estimates <- parameterEstimates(results.1)[ parameterEstimates(results.1)[,'op'] == '~', c(1:3, 7:12)]
stargazer(estimates, summary=FALSE, type='text', rownames=FALSE, initial.zero=FALSE, digits=3, title='Model 1',out = "model1_table.html")
## 
## Model 1
## ==============================================================
## lhs     op   rhs     est   se    z    pvalue ci.lower ci.upper
## --------------------------------------------------------------
## PWFit   ~  IN_Seek  -.015 .059 -.260   .795   -.132     .101  
## PWFit   ~  G_Social .074  .072 1.025   .305   -.068     .216  
## PWFit   ~  PosFrame .154  .144 1.066   .286   -.129     .436  
## PWFit   ~  Minority .034  .195  .175   .861   -.348     .417  
## PWFit   ~   ING_c   -.172 .136 -1.267  .205   -.439     .094  
## PWFit   ~    SP_c   .141  .111 1.275   .202   -.076     .358  
## PWFit   ~  Support  .408  .063 6.504    0      .285     .531  
## PJFit   ~  IN_Seek  -.085 .054 -1.588  .112   -.191     .020  
## PJFit   ~  G_Social .031  .066  .471   .638   -.098     .160  
## PJFit   ~  PosFrame .279  .133 2.094   .036    .018     .540  
## PJFit   ~  Minority .055  .179  .306   .760   -.296     .406  
## PJFit   ~   ING_c   -.048 .122 -.391   .696   -.287     .192  
## PJFit   ~    SP_c   .220  .099 2.214   .027    .025     .415  
## PJFit   ~  Support  .149  .058 2.568   .010    .035     .263  
## Support ~  IN_Seek  .047  .076  .617   .537   -.101     .195  
## Support ~  G_Social .185  .089 2.079   .038    .011     .360  
## Support ~  PosFrame .173  .179  .968   .333   -.177     .523  
## Support ~  Minority -.046 .242 -.191   .849   -.520     .427  
## Support ~   ING_c   .413  .172 2.398   .016    .076     .751  
## Support ~    SP_c   -.184 .142 -1.294  .196   -.462     .094  
## --------------------------------------------------------------
lavInspect(results.1, "r2")
## $within
##   PWFit   PJFit Support 
##   0.257   0.112   0.091 
## 
## $unit
## numeric(0)

Test Mediation: Ingratiation (X) –> Support (M) –> Person-Job Fit (Y)

estimates <- parameterEstimates(results.1, ci = TRUE, boot.ci.type = "bca.simple")

a_path <- estimates[estimates$label == "a1", "est"]
a_path_se <- estimates[estimates$label == "a1", "se"]

b_path <- estimates[estimates$label == "b1", "est"]
b_path_se <- estimates[estimates$label == "b1", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: 0.0615696
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ 0.004725333 , 0.1453984 ]

Test Mediation: Ingratiation (X) –> Support (M) –> Person-Group Fit (Y)

a_path <- estimates[estimates$label == "a1", "est"]
a_path_se <- estimates[estimates$label == "a1", "se"]

b_path <- estimates[estimates$label == "b2", "est"]
b_path_se <- estimates[estimates$label == "b2", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: 0.1687003
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ 0.02968993 , 0.3273829 ]

Model 2: Interaction Effects and Moderated Mediation

model.2 <- '
  level: 1
    PWFit ~ IN_Seek + G_Social + PosFrame + Minority + ING_c + SP_c + b2*Support

    PJFit ~ IN_Seek + G_Social + PosFrame + Minority + ING_c + SP_c + b1*Support

    Support ~ IN_Seek + G_Social + PosFrame + a*Minority + a1*ING_c + a2*SP_c + a3*Minority_ING + a4*Minority_SP

  level: 2
    PWFit ~~ PWFit
    PJFit ~~ PJFit
    PWFit ~~ PJFit
    
  
  # Define Moderator Values
  White := 0
  NonWhite := 1
  
  LOW_ING := -.69
  HIGH_ING := .69

  # Conditional Effects for Ingratiation
  SS_White_ING := a1 + a3*White
  SS_NonWhite_ING := a1 + a3*NonWhite
  
  # Conditional Effects for Self-Promotion
  SS_White_SP := a2 + a4*White
  SS_NonWhite_SP := a2 + a4*NonWhite
  
  # Compute predicted values for plotting (Ingratiation)
  WHITE_LOW_ING := (a1 + a3*White)*LOW_ING + (3.344 + a*White) 
  WHITE_HIGH_ING := (a1 + a3*White)*HIGH_ING + (3.344 + a*White) 
  NONWHITE_LOW_ING := (a1 + a3*NonWhite)*LOW_ING + (3.344 + a*NonWhite) 
  NONWHITE_HIGH_ING := (a1 + a3*NonWhite)*HIGH_ING + (3.344 + a*NonWhite)
  
  # Compute predicted values for plotting (Self-Promotion)
  WHITE_LOW_SP := (a2 + a4*White)*LOW_ING + (3.344 + a*White) 
  WHITE_HIGH_SP := (a2 + a4*White)*HIGH_ING + (3.344 + a*White) 
  NONWHITE_LOW_SP := (a2 + a4*NonWhite)*LOW_ING + (3.344 + a*NonWhite) 
  NONWHITE_HIGH_SP := (a2 + a4*NonWhite)*HIGH_ING + (3.344 + a*NonWhite)
'
results.2 <- sem(model.2, data = MainStudy, cluster = "unit", bootstrap = 5000, fixed.x = FALSE)
estimates <- parameterEstimates(results.2)[ parameterEstimates(results.2)[,'op'] == '~', c(1:3, 7:12)]
stargazer(estimates, summary=FALSE, type='text', rownames=FALSE, initial.zero=FALSE, digits=3, title='Model 2',out = "model2_table.html")
## 
## Model 2
## ==================================================================
## lhs     op     rhs       est   se    z    pvalue ci.lower ci.upper
## ------------------------------------------------------------------
## PWFit   ~    IN_Seek    -.015 .059 -.260   .795   -.132     .101  
## PWFit   ~    G_Social   .074  .072 1.025   .305   -.068     .216  
## PWFit   ~    PosFrame   .154  .144 1.066   .286   -.129     .436  
## PWFit   ~    Minority   .034  .195  .176   .861   -.348     .417  
## PWFit   ~     ING_c     -.172 .136 -1.267  .205   -.439     .094  
## PWFit   ~      SP_c     .141  .111 1.275   .202   -.076     .358  
## PWFit   ~    Support    .408  .063 6.504    0      .285     .531  
## PJFit   ~    IN_Seek    -.085 .054 -1.588  .112   -.191     .020  
## PJFit   ~    G_Social   .031  .066  .471   .638   -.098     .160  
## PJFit   ~    PosFrame   .279  .133 2.094   .036    .018     .540  
## PJFit   ~    Minority   .055  .179  .306   .760   -.296     .406  
## PJFit   ~     ING_c     -.048 .122 -.391   .696   -.287     .192  
## PJFit   ~      SP_c     .220  .099 2.214   .027    .025     .415  
## PJFit   ~    Support    .149  .058 2.568   .010    .035     .263  
## Support ~    IN_Seek    .040  .074  .539   .590   -.106     .186  
## Support ~    G_Social   .181  .088 2.050   .040    .008     .354  
## Support ~    PosFrame   .163  .176  .929   .353   -.181     .507  
## Support ~    Minority   -.056 .238 -.236   .813   -.522     .410  
## Support ~     ING_c     .782  .236 3.311   .001    .319    1.245  
## Support ~      SP_c     -.290 .177 -1.641  .101   -.636     .056  
## Support ~  Minority_ING -.776 .335 -2.317  .020   -1.433   -.120  
## Support ~  Minority_SP  .327  .281 1.164   .244   -.224     .879  
## ------------------------------------------------------------------
lavInspect(results.2, "r2")
## $within
##   PWFit   PJFit Support 
##   0.257   0.112   0.121 
## 
## $unit
## numeric(0)

Interaction Plot: Impression Management and Coworker Support by Race

estimates <- parameterEstimates(results.2, ci = TRUE, boot.ci.type = "bca.simple")

White <- 0
NonWhite <- 1

LOW <- -0.69
HIGH <- 0.69

# Coefficients for Ingratiation
a1 <- estimates$est[estimates$label == "a1"]
a3 <- estimates$est[estimates$label == "a3"]
a <- estimates$est[estimates$label == "a"]

# Coefficients for Self-Promotion
a2 <- estimates$est[estimates$label == "a2"]
a4 <- estimates$est[estimates$label == "a4"]

# Predicted Support for Ingratiation
WHITE_LOW_ING <- (a1 + a3*White)*LOW + (3.344 + a*White)
WHITE_HIGH_ING <- (a1 + a3*White)*HIGH + (3.344 + a*White)

NONWHITE_LOW_ING <- (a1 + a3*NonWhite)*LOW + (3.344 + a*NonWhite)
NONWHITE_HIGH_ING <- (a1 + a3*NonWhite)*HIGH + (3.344 + a*NonWhite)

# Predicted Support for Self-Promotion
WHITE_LOW_SP <- (a2 + a4*White)*LOW + (3.344 + a*White)
WHITE_HIGH_SP <- (a2 + a4*White)*HIGH + (3.344 + a*White)

NONWHITE_LOW_SP <- (a2 + a4*NonWhite)*LOW + (3.344 + a*NonWhite)
NONWHITE_HIGH_SP <- (a2 + a4*NonWhite)*HIGH + (3.344 + a*NonWhite)

# Dataframe for Plotting Interaction
plot_data <- data.frame(
  Race = rep(c("White", "NonWhite"), each = 4),
  IM = rep(c("Ingratiation", "Ingratiation", "Self-Promotion", "Self-Promotion"), times = 2),
  Level = rep(c("Low", "High"), times = 4),
  Predicted_Support = c(
    WHITE_LOW_ING, WHITE_HIGH_ING, WHITE_LOW_SP, WHITE_HIGH_SP,
    NONWHITE_LOW_ING, NONWHITE_HIGH_ING, NONWHITE_LOW_SP, NONWHITE_HIGH_SP
  )
)

plot_data$Level <- factor(plot_data$Level, levels = c("Low", "High"))

# Plot Interaction
ggplot(plot_data, aes(x = Level, y = Predicted_Support, group = Race, color = Race)) +
  geom_line(aes(linetype = IM), size = 1.2) +
  geom_point(size = 3) +
  facet_wrap(~ IM) +
  labs(x = "Impression Management", y = "Coworker Support", color = "Newcomer Race") +
  theme_minimal(base_size = 14) +
  theme(legend.position = "bottom") +
  guides(linetype = "none")   # <<<< THIS hides the IM legend

Test Mediation by Race: Ingratiation * Race (XW) –> Support (M) –> Person-Job Fit (Y)

estimates <- parameterEstimates(results.2, ci = TRUE, boot.ci.type = "bca.simple")

White <- 0
NonWhite <- 1

# A-path
a1 <- estimates[estimates$label == "a1", "est"]
a3 <- estimates[estimates$label == "a3", "est"]
a1_se <- estimates[estimates$label == "a1", "se"]
a3_se <- estimates[estimates$label == "a3", "se"]

# Conditional a-paths
a_White <- a1 + a3 * White
a_NonWhite <- a1 + a3 * NonWhite

# SE for conditional a-paths
a_White_se <- 0.174
a_NonWhite_se <- 0.174

# B-path
b1 <- estimates[estimates$label == "b1", "est"]
b1_se <- estimates[estimates$label == "b1", "se"]

# Conditional ab
a_White * b1
## [1] 0.1164495
a_NonWhite * b1
## [1] 0.0008054631
# Compute Monte Carlo CI for Whites
mc_ci_low <- medci(mu.x = a_White, mu.y = b1,
                   se.x = a_White_se, se.y = b1_se,
                   rho = 0, alpha = .05, sims = 10000)

# Compute Monte Carlo CI for NonWhites
mc_ci_high <- medci(mu.x = a_NonWhite, mu.y = b1,
                    se.x = a_NonWhite_se, se.y = b1_se,
                    rho = 0, alpha = .05, sims = 10000)

# Print results
cat("Monte Carlo 95% CI (White):  [", round(mc_ci_low$`95% CI`, 3), "]\n")
## Monte Carlo 95% CI (White):  [ 0.025 0.232 ]
cat("Monte Carlo 95% CI (NonWhite): [", round(mc_ci_high$`95% CI`, 3), "]\n")
## Monte Carlo 95% CI (NonWhite): [ -0.057 0.059 ]

Test Mediation by Race: Ingratiation * Race (XW) –> Support (M) –> Person-Group Fit (Y)

# A-path
a1 <- estimates[estimates$label == "a1", "est"]
a3 <- estimates[estimates$label == "a3", "est"]
a1_se <- estimates[estimates$label == "a1", "se"]
a3_se <- estimates[estimates$label == "a3", "se"]

# Conditional a-paths
a_White <- a1 + a3 * White
a_NonWhite <- a1 + a3 * NonWhite

# SE for conditional a-paths
a_White_se <- 0.174
a_NonWhite_se <- 0.174

# B-path
b2 <- estimates[estimates$label == "b2", "est"]
b2_se <- estimates[estimates$label == "b2", "se"]

# Conditional ab
a_White * b2
## [1] 0.3190729
a_NonWhite * b2
## [1] 0.002206979
# Compute Monte Carlo CI for Whites
mc_ci_low <- medci(mu.x = a_White, mu.y = b2,
                   se.x = a_White_se, se.y = b2_se,
                   rho = 0, alpha = .05, sims = 10000)

# Compute Monte Carlo CI for NonWhites
mc_ci_high <- medci(mu.x = a_NonWhite, mu.y = b2,
                    se.x = a_NonWhite_se, se.y = b2_se,
                    rho = 0, alpha = .05, sims = 10000)

# Print results
cat("Monte Carlo 95% CI (White):  [", round(mc_ci_low$`95% CI`, 3), "]\n")
## Monte Carlo 95% CI (White):  [ 0.163 0.503 ]
cat("Monte Carlo 95% CI (NonWhite): [", round(mc_ci_high$`95% CI`, 3), "]\n")
## Monte Carlo 95% CI (NonWhite): [ -0.14 0.145 ]

Moderated Mediation Index: Ingratiation * Race (XW) –> Support (M) –> Person-Job Fit (Y)

estimates <- parameterEstimates(results, ci = TRUE, boot.ci.type = "bca.simple")

a_path <- estimates[estimates$label == "a3", "est"]
a_path_se <- estimates[estimates$label == "a3", "se"]

b_path <- estimates[estimates$label == "b1", "est"]
b_path_se <- estimates[estimates$label == "b1", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: -0.06741854
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ -0.3446356 , 0.1486419 ]

Moderated Mediation Index: Ingratiation * Race (XW) –> Support (M) –> Person-Group Fit (Y)

a_path <- estimates[estimates$label == "a3", "est"]
a_path_se <- estimates[estimates$label == "a3", "se"]

b_path <- estimates[estimates$label == "b2", "est"]
b_path_se <- estimates[estimates$label == "b2", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: -0.1257974
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ -0.3760658 , 0.0289581 ]

Supplemental Analysis: Token Status

MainStudy$Token_Minority <- MainStudy$Token * MainStudy$Minority
MainStudy$Token_ING_c <- MainStudy$Token * MainStudy$ING_c
MainStudy$Minority_ING_c <- MainStudy$Minority * MainStudy$ING_c
MainStudy$Token_Minority_ING_c <- MainStudy$Token * MainStudy$Minority * MainStudy$ING_c

#MainStudy[is.na(MainStudy)] <- 999
#write.table(MainStudy, file = "MainStudy_Mplus.csv", sep = ",", row.names = FALSE, col.names = FALSE)
model <- '
  level: 1
    # Regressions
    PWFit ~ IN_Seek + G_Social + PosFrame + Minority + ING_c + SP_c + b2*Support
    PJFit ~ IN_Seek + G_Social + PosFrame + Minority + cdash*ING_c + SP_c + b1*Support
    Support ~ IN_Seek + G_Social + PosFrame + a2*Minority + a1*ING_c + SP_c +
              a3*Minority_ING_c + a5*Token + a6*Token_ING_c + a7*Token_Minority + a8*Token_Minority_ING_c

  level: 2
    PWFit ~~ PWFit
    PJFit ~~ PJFit
    PWFit ~~ PJFit

  # Define Moderator Values
  White := 0
  NonWhite := 1
  
  nonToken := 0
  Token := 1
  
  LOW_ING := -0.69
  HIGH_ING := 0.69

  # Conditional Effects on Support
  SS_White_nonToken := a1 + a3*White + a6*nonToken + a8*White*nonToken
  SS_NonWhite_nonToken := a1 + a3*NonWhite + a6*nonToken + a8*NonWhite*nonToken
  
  SS_White_Token := a1 + a3*White + a6*Token + a8*White*Token
  SS_NonWhite_Token := a1 + a3*NonWhite + a6*Token + a8*NonWhite*Token

  # Conditional Indirect Effects on PJFit
  IND_White_nonToken_PJ := SS_White_nonToken * b1
  IND_NonWhite_nonToken_PJ := SS_NonWhite_nonToken * b1
  IND_White_Token_PJ := SS_White_Token * b1
  IND_NonWhite_Token_PJ := SS_NonWhite_Token * b1

  # Conditional Indirect Effects on PWFit
  IND_White_nonToken_PW := SS_White_nonToken * b2
  IND_NonWhite_nonToken_PW := SS_NonWhite_nonToken * b2
  IND_White_Token_PW := SS_White_Token * b2
  IND_NonWhite_Token_PW := SS_NonWhite_Token * b2

  # Index of Moderated Mediation
  IMM_PJ := a8 * b1
  IMM_PW := a8 * b2
  
  # Compute predicted values for plotting
  WHITE_nonToken_LOW := ((a1 * LOW_ING) + (a2 * White) + (a5 * nonToken) + 
                       (a3 * White * LOW_ING) + (a6 * nonToken * LOW_ING) + 
                       (a7 * nonToken * White) + (a8 * nonToken * White * LOW_ING)) + 3.329

  WHITE_nonToken_HIGH := ((a1 * HIGH_ING) + (a2 * White) + (a5 * nonToken) + 
                        (a3 * White * HIGH_ING) + (a6 * nonToken * HIGH_ING) + 
                        (a7 * nonToken * White) + (a8 * nonToken * White * HIGH_ING)) + 3.329

  WHITE_Token_LOW := ((a1 * LOW_ING) + (a2 * White) + (a5 * Token) + 
                    (a3 * White * LOW_ING) + (a6 * Token * LOW_ING) + 
                    (a7 * Token * White) + (a8 * Token * White * LOW_ING)) + 3.329

  WHITE_Token_HIGH := ((a1 * HIGH_ING) + (a2 * White) + (a5 * Token) + 
                     (a3 * White * HIGH_ING) + (a6 * Token * HIGH_ING) + 
                     (a7 * Token * White) + (a8 * Token * White * HIGH_ING)) + 3.329

  NONWHITE_nonToken_LOW := ((a1 * LOW_ING) + (a2 * NonWhite) + (a5 * nonToken) + 
                          (a3 * NonWhite * LOW_ING) + (a6 * nonToken * LOW_ING) + 
                          (a7 * nonToken * NonWhite) + (a8 * nonToken * NonWhite * LOW_ING)) + 3.329

  NONWHITE_nonToken_HIGH := ((a1 * HIGH_ING) + (a2 * NonWhite) + (a5 * nonToken) + 
                           (a3 * NonWhite * HIGH_ING) + (a6 * nonToken * HIGH_ING) + 
                           (a7 * nonToken * NonWhite) + (a8 * nonToken * NonWhite * HIGH_ING)) + 3.329

  NONWHITE_Token_LOW := ((a1 * LOW_ING) + (a2 * NonWhite) + (a5 * Token) + 
                       (a3 * NonWhite * LOW_ING) + (a6 * Token * LOW_ING) + 
                       (a7 * Token * NonWhite) + (a8 * Token * NonWhite * LOW_ING)) + 3.329

  NONWHITE_Token_HIGH := ((a1 * HIGH_ING) + (a2 * NonWhite) + (a5 * Token) + 
                        (a3 * NonWhite * HIGH_ING) + (a6 * Token * HIGH_ING) + 
                        (a7 * Token * NonWhite) + (a8 * Token * NonWhite * HIGH_ING)) + 3.329
'
results <- sem(model, data = MainStudy, cluster = "unit", bootstrap = 5000, fixed.x = FALSE)
summary(results, ci = TRUE)
## lavaan 0.6-19 ended normally after 215 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                       112
## 
##                                                   Used       Total
##   Number of observations                           160         164
##   Number of clusters [unit]                         19            
## 
## Model Test User Model:
##                                                       
##   Test statistic                                15.268
##   Degrees of freedom                                10
##   P-value (Chi-square)                           0.123
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Observed
##   Observed information based on                Hessian
## 
## 
## Level 1 [within]:
## 
## Regressions:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##   PWFit ~                                                               
##     IN_Seek          -0.015    0.059   -0.260    0.795   -0.132    0.101
##     G_Socil           0.074    0.072    1.025    0.305   -0.068    0.216
##     PosFram           0.154    0.144    1.066    0.286   -0.129    0.436
##     Minorty           0.034    0.195    0.175    0.861   -0.348    0.417
##     ING_c            -0.172    0.136   -1.267    0.205   -0.439    0.094
##     SP_c              0.141    0.111    1.275    0.202   -0.076    0.358
##     Support   (b2)    0.408    0.063    6.504    0.000    0.285    0.531
##   PJFit ~                                                               
##     IN_Seek          -0.085    0.054   -1.588    0.112   -0.191    0.020
##     G_Socil           0.031    0.066    0.471    0.638   -0.098    0.160
##     PosFram           0.279    0.133    2.094    0.036    0.018    0.540
##     Minorty           0.055    0.179    0.306    0.760   -0.296    0.406
##     ING_c   (cdsh)   -0.048    0.122   -0.391    0.696   -0.287    0.192
##     SP_c              0.220    0.099    2.214    0.027    0.025    0.415
##     Support   (b1)    0.149    0.058    2.568    0.010    0.035    0.263
##   Support ~                                                             
##     IN_Seek           0.069    0.075    0.922    0.357   -0.077    0.215
##     G_Socil           0.156    0.087    1.796    0.072   -0.014    0.326
##     PosFram           0.148    0.174    0.847    0.397   -0.194    0.490
##     Minorty   (a2)    0.437    0.334    1.309    0.191   -0.217    1.092
##     ING_c     (a1)    0.656    0.240    2.733    0.006    0.185    1.126
##     SP_c             -0.231    0.140   -1.653    0.098   -0.505    0.043
##     Mn_ING_   (a3)   -0.402    0.386   -1.041    0.298   -1.159    0.355
##     Token     (a5)    0.087    0.486    0.178    0.859   -0.866    1.040
##     Tk_ING_   (a6)    1.119    0.771    1.451    0.147   -0.392    2.630
##     Tkn_Mnr   (a7)   -0.984    0.631   -1.559    0.119   -2.220    0.253
##     T_M_ING   (a8)   -1.615    0.886   -1.823    0.068   -3.352    0.121
## 
## Covariances:
##                     Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .PWFit ~~                                                               
##    .PJFit              0.316    0.093    3.418    0.001    0.135    0.498
##   IN_Seek ~~                                                             
##     G_Social           0.718    0.184    3.910    0.000    0.358    1.077
##     PosFrame           0.230    0.084    2.746    0.006    0.066    0.395
##     Minority           0.083    0.060    1.386    0.166   -0.034    0.201
##     ING_c              0.234    0.090    2.599    0.009    0.057    0.410
##     SP_c               0.270    0.110    2.456    0.014    0.055    0.486
##     Minority_ING_c     0.084    0.063    1.339    0.180   -0.039    0.208
##     Token              0.042    0.055    0.762    0.446   -0.066    0.149
##     Token_ING_c        0.014    0.047    0.294    0.769   -0.078    0.106
##     Token_Minority     0.088    0.050    1.749    0.080   -0.011    0.186
##     Tkn_Mnrty_ING_     0.008    0.043    0.192    0.847   -0.076    0.093
##   G_Social ~~                                                            
##     PosFrame           0.088    0.070    1.253    0.210   -0.049    0.224
##     Minority           0.115    0.052    2.236    0.025    0.014    0.216
##     ING_c              0.160    0.076    2.107    0.035    0.011    0.308
##     SP_c               0.318    0.095    3.338    0.001    0.131    0.504
##     Minority_ING_c     0.046    0.053    0.860    0.390   -0.059    0.150
##     Token              0.005    0.046    0.111    0.912   -0.086    0.096
##     Token_ING_c        0.044    0.040    1.101    0.271   -0.034    0.123
##     Token_Minority     0.027    0.042    0.628    0.530   -0.056    0.109
##     Tkn_Mnrty_ING_     0.026    0.037    0.724    0.469   -0.045    0.098
##   PosFrame ~~                                                            
##     Minority           0.006    0.024    0.237    0.813   -0.041    0.052
##     ING_c              0.066    0.035    1.869    0.062   -0.003    0.136
##     SP_c               0.020    0.043    0.461    0.645   -0.065    0.104
##     Minority_ING_c     0.030    0.025    1.182    0.237   -0.019    0.079
##     Token             -0.025    0.022   -1.163    0.245   -0.068    0.017
##     Token_ING_c        0.035    0.019    1.850    0.064   -0.002    0.072
##     Token_Minority    -0.003    0.020   -0.131    0.895   -0.041    0.036
##     Tkn_Mnrty_ING_     0.023    0.017    1.353    0.176   -0.010    0.057
##   Minority ~~                                                            
##     ING_c             -0.002    0.026   -0.066    0.948   -0.052    0.048
##     SP_c               0.023    0.031    0.736    0.461   -0.038    0.085
##     Minority_ING_c    -0.001    0.018   -0.073    0.942   -0.037    0.034
##     Token              0.108    0.018    5.997    0.000    0.073    0.144
##     Token_ING_c       -0.016    0.014   -1.162    0.245   -0.043    0.011
##     Token_Minority     0.127    0.018    7.200    0.000    0.092    0.161
##     Tkn_Mnrty_ING_    -0.018    0.013   -1.456    0.145   -0.043    0.006
##   ING_c ~~                                                               
##     SP_c               0.175    0.048    3.628    0.000    0.081    0.270
##     Minority_ING_c     0.241    0.033    7.333    0.000    0.177    0.305
##     Token             -0.034    0.024   -1.453    0.146   -0.080    0.012
##     Token_ING_c        0.137    0.023    5.996    0.000    0.092    0.182
##     Token_Minority    -0.027    0.021   -1.260    0.208   -0.069    0.015
##     Tkn_Mnrty_ING_     0.114    0.021    5.583    0.000    0.074    0.155
##   SP_c ~~                                                                
##     Minority_ING_c     0.101    0.034    2.985    0.003    0.035    0.167
##     Token             -0.052    0.029   -1.798    0.072   -0.109    0.005
##     Token_ING_c        0.042    0.025    1.672    0.095   -0.007    0.090
##     Token_Minority    -0.041    0.026   -1.573    0.116   -0.093    0.010
##     Tkn_Mnrty_ING_     0.036    0.023    1.574    0.116   -0.009    0.080
##   Minority_ING_c ~~                                                      
##     Token             -0.027    0.017   -1.586    0.113   -0.060    0.006
##     Token_ING_c        0.114    0.017    6.765    0.000    0.081    0.148
##     Token_Minority    -0.027    0.015   -1.749    0.080   -0.057    0.003
##     Tkn_Mnrty_ING_     0.114    0.016    7.192    0.000    0.083    0.146
##   Token ~~                                                               
##     Token_ING_c       -0.026    0.013   -2.058    0.040   -0.051   -0.001
##     Token_Minority     0.142    0.017    8.171    0.000    0.108    0.176
##     Tkn_Mnrty_ING_    -0.021    0.012   -1.774    0.076   -0.043    0.002
##   Token_ING_c ~~                                                         
##     Token_Minority    -0.021    0.011   -1.799    0.072   -0.043    0.002
##     Tkn_Mnrty_ING_     0.114    0.013    8.535    0.000    0.088    0.140
##   Token_Minority ~~                                                      
##     Tkn_Mnrty_ING_    -0.022    0.011   -2.088    0.037   -0.043   -0.001
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .Support           3.329    0.851    3.911    0.000    1.661    4.998
##     IN_Seek           5.181    0.127   40.645    0.000    4.931    5.431
##     G_Social          3.825    0.108   35.334    0.000    3.613    4.037
##     PosFrame          4.592    0.051   90.439    0.000    4.492    4.691
##     Minority          0.325    0.037    8.777    0.000    0.252    0.398
##     ING_c            -0.001    0.055   -0.016    0.987   -0.108    0.106
##     SP_c              0.003    0.067    0.051    0.960   -0.128    0.135
##     Minority_ING_c   -0.002    0.039   -0.051    0.960   -0.078    0.074
##     Token             0.244    0.034    7.181    0.000    0.177    0.310
##     Token_ING_c      -0.034    0.029   -1.184    0.236   -0.092    0.023
##     Token_Minority    0.187    0.031    6.076    0.000    0.127    0.248
##     Tkn_Mnrty_ING_   -0.027    0.027   -1.017    0.309   -0.079    0.025
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .PWFit             1.184    0.137    8.645    0.000    0.915    1.452
##    .PJFit             0.951    0.116    8.203    0.000    0.724    1.178
##    .Support           1.825    0.204    8.944    0.000    1.425    2.225
##     IN_Seek           2.600    0.291    8.944    0.000    2.030    3.170
##     G_Social          1.875    0.210    8.944    0.000    1.464    2.286
##     PosFrame          0.412    0.046    8.944    0.000    0.322    0.503
##     Minority          0.219    0.025    8.944    0.000    0.171    0.267
##     ING_c             0.476    0.053    8.944    0.000    0.372    0.581
##     SP_c              0.718    0.080    8.944    0.000    0.561    0.876
##     Minority_ING_c    0.241    0.027    8.944    0.000    0.188    0.294
##     Token             0.184    0.021    8.944    0.000    0.144    0.225
##     Token_ING_c       0.136    0.015    8.944    0.000    0.106    0.165
##     Token_Minority    0.152    0.017    8.944    0.000    0.119    0.186
##     Tkn_Mnrty_ING_    0.114    0.013    8.944    0.000    0.089    0.139
## 
## 
## Level 2 [unit]:
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##  .PWFit ~~                                                              
##    .PJFit             0.058    0.075    0.773    0.439   -0.089    0.204
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .PWFit             2.732    0.719    3.798    0.000    1.322    4.142
##    .PJFit             4.363    0.666    6.551    0.000    3.058    5.669
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##    .PWFit             0.046    0.064    0.722    0.470   -0.079    0.172
##    .PJFit             0.136    0.125    1.086    0.278   -0.110    0.382
## 
## Defined Parameters:
##                    Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper
##     White             0.000                               0.000    0.000
##     NonWhite          1.000                               1.000    1.000
##     nonToken          0.000                               0.000    0.000
##     Token             1.000                               1.000    1.000
##     LOW_ING          -0.690                              -0.690   -0.690
##     HIGH_ING          0.690                               0.690    0.690
##     SS_White_nnTkn    0.656    0.240    2.733    0.006    0.185    1.126
##     SS_NnWht_nnTkn    0.254    0.314    0.807    0.419   -0.362    0.870
##     SS_White_Token    1.775    0.737    2.410    0.016    0.331    3.218
##     SS_NonWhit_Tkn   -0.243    0.325   -0.746    0.456   -0.881    0.395
##     IND_Wht_nnT_PJ    0.098    0.052    1.871    0.061   -0.005    0.200
##     IND_NnWht_T_PJ    0.038    0.049    0.770    0.441   -0.058    0.134
##     IND_Wht_Tkn_PJ    0.264    0.150    1.757    0.079   -0.031    0.559
##     IND_NnWht_T_PJ   -0.036    0.050   -0.716    0.474   -0.135    0.063
##     IND_Wht_nnT_PW    0.268    0.106    2.519    0.012    0.059    0.476
##     IND_NnWht_T_PW    0.104    0.129    0.801    0.423   -0.150    0.357
##     IND_Wht_Tkn_PW    0.724    0.321    2.259    0.024    0.096    1.353
##     IND_NnWht_T_PW   -0.099    0.134   -0.741    0.459   -0.361    0.163
##     IMM_PJ           -0.241    0.162   -1.487    0.137   -0.558    0.077
##     IMM_PW           -0.659    0.376   -1.755    0.079   -1.395    0.077
##     WHITE_nnTk_LOW    2.876    0.166   17.366    0.000    2.552    3.201
##     WHITE_nnT_HIGH    3.782    0.166   22.832    0.000    3.457    4.106
##     WHITE_Tokn_LOW    2.191    0.635    3.449    0.001    0.946    3.436
##     WHITE_Tkn_HIGH    4.640    0.765    6.063    0.000    3.140    6.140
##     NONWHITE_T_LOW    3.591    0.424    8.461    0.000    2.759    4.423
##     NONWHITE_T_HIG    3.941    0.370   10.647    0.000    3.216    4.667
##     NONWHITE_T_LOW    3.037    0.339    8.954    0.000    2.372    3.701
##     NONWHITE_T_HIG    2.702    0.393    6.871    0.000    1.931    3.472
estimates <- parameterEstimates(results.2)[ parameterEstimates(results.2)[,'op'] == '~', c(1:3, 7:12)]
stargazer(estimates, summary=FALSE, type='text', rownames=FALSE, initial.zero=FALSE, digits=3, title='Model 2',out = "model2_table.html")
## 
## Model 2
## ==================================================================
## lhs     op     rhs       est   se    z    pvalue ci.lower ci.upper
## ------------------------------------------------------------------
## PWFit   ~    IN_Seek    -.015 .059 -.260   .795   -.132     .101  
## PWFit   ~    G_Social   .074  .072 1.025   .305   -.068     .216  
## PWFit   ~    PosFrame   .154  .144 1.066   .286   -.129     .436  
## PWFit   ~    Minority   .034  .195  .176   .861   -.348     .417  
## PWFit   ~     ING_c     -.172 .136 -1.267  .205   -.439     .094  
## PWFit   ~      SP_c     .141  .111 1.275   .202   -.076     .358  
## PWFit   ~    Support    .408  .063 6.504    0      .285     .531  
## PJFit   ~    IN_Seek    -.085 .054 -1.588  .112   -.191     .020  
## PJFit   ~    G_Social   .031  .066  .471   .638   -.098     .160  
## PJFit   ~    PosFrame   .279  .133 2.094   .036    .018     .540  
## PJFit   ~    Minority   .055  .179  .306   .760   -.296     .406  
## PJFit   ~     ING_c     -.048 .122 -.391   .696   -.287     .192  
## PJFit   ~      SP_c     .220  .099 2.214   .027    .025     .415  
## PJFit   ~    Support    .149  .058 2.568   .010    .035     .263  
## Support ~    IN_Seek    .040  .074  .539   .590   -.106     .186  
## Support ~    G_Social   .181  .088 2.050   .040    .008     .354  
## Support ~    PosFrame   .163  .176  .929   .353   -.181     .507  
## Support ~    Minority   -.056 .238 -.236   .813   -.522     .410  
## Support ~     ING_c     .782  .236 3.311   .001    .319    1.245  
## Support ~      SP_c     -.290 .177 -1.641  .101   -.636     .056  
## Support ~  Minority_ING -.776 .335 -2.317  .020   -1.433   -.120  
## Support ~  Minority_SP  .327  .281 1.164   .244   -.224     .879  
## ------------------------------------------------------------------
lavInspect(results.2, "r2")
## $within
##   PWFit   PJFit Support 
##   0.257   0.112   0.121 
## 
## $unit
## numeric(0)

Supplemental Analysis: Newcomer Adjustment

model <- '
  level: 1
    PWFit ~ b2*Integrated + Support
    PJFit ~ b1*Role_Clarity + Support

    Role_Clarity ~ a1*Support 
    Integrated ~ a2*Support 
    
  level: 2
    PWFit ~~ PWFit
    PJFit ~~ PJFit
    PWFit ~~ PJFit
'

results <- sem(model, data = MainStudy, cluster = "unit",  bootstrap = 5000, fixed.x = FALSE)
est <- parameterEstimates(results)
estimates <- est[est$op == "~", c("lhs", "op", "rhs", "est", "se", "z", "pvalue", "ci.lower", "ci.upper")]
stargazer(estimates, summary=FALSE, type='text', rownames=FALSE, initial.zero=FALSE, digits=3, title='Supplemental Model',out = "supmodel_table.html")
## 
## Supplemental Model
## ======================================================================
## lhs          op     rhs      est   se    z   pvalue  ci.lower ci.upper
## ----------------------------------------------------------------------
## PWFit        ~   Integrated  .236 .070 3.367  .001     .099     .374  
## PWFit        ~    Support    .298 .063 4.745 0.00000   .175     .421  
## PJFit        ~  Role_Clarity .223 .067 3.324  .001     .091     .355  
## PJFit        ~    Support    .097 .057 1.680  .093    -.016     .209  
## Role_Clarity ~    Support    .264 .061 4.325 .00002    .145     .384  
## Integrated   ~    Support    .305 .064 4.753 0.00000   .179     .431  
## ----------------------------------------------------------------------
lavInspect(results, "r2")
## $within
##        PWFit        PJFit Role_Clarity   Integrated 
##        0.256        0.113        0.108        0.127 
## 
## $unit
## numeric(0)

Test Mediation: Coworker Support (X) –> Role Clarity (M) –> Person-Job Fit (Y)

estimates <- parameterEstimates(results, ci = TRUE, boot.ci.type = "bca.simple")

a_path <- estimates[estimates$label == "a1", "est"]
a_path_se <- estimates[estimates$label == "a1", "se"]

b_path <- estimates[estimates$label == "b1", "est"]
b_path_se <- estimates[estimates$label == "b1", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: 0.05896934
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ 0.02018378 , 0.1087694 ]

Test Mediation: Coworker Support (X) –> Social Integration (M) –> Person-Group Fit (Y)

a_path <- estimates[estimates$label == "a2", "est"]
a_path_se <- estimates[estimates$label == "a2", "se"]

b_path <- estimates[estimates$label == "b2", "est"]
b_path_se <- estimates[estimates$label == "b2", "se"]

cat("indirect effect:", a_path * b_path, "\n")
## indirect effect: 0.07210816
# Compute Monte Carlo confidence interval
mc_ci <- medci(mu.x = a_path, mu.y = b_path, se.x = a_path_se, se.y = b_path_se,
               rho = 0, alpha = .05, sims = 10000, method = "parametric")
cat("Monte Carlo 95% CI: [", mc_ci$`95% CI`[1], ",", mc_ci$`95% CI`[2], "]\n")
## Monte Carlo 95% CI: [ 0.02611773 , 0.1299537 ]