1 FUNCTIONS

2 DATA PREPARATION

2.1 Load all sheets of an Excel

X: Leader delegation=LDLV Level-1 Moderator [Mo1]: Leader emotional exhaustion =LEDV Level-2 Moderator [Mo2]: LMX=LMX

Mediator [M]: Follower work engagement =MWEV Y: Follower task performance(t+1)=LPERFV2

Controls: [C1] Interaction Freuencey=MIFV, [C2] Follower work engagement (t-1)=MWEV0, [C4] Leader delegation(t-1)=LDLV0, [C5] Leader emotional exhaustion (t-1)=LEDV0, [C3] Follower task performance(t-1)=LPERFV0

2.2 Same day: All group mean centered

## Error: 在 'old' 中未找到如下列名:[LPERF.GroC]。请考虑设置 skip_absent=TRUE。

2.3 Reproduce HRs (f - mod lmx.out): All group mean centered

    X=LDLV0; !leader delegation
    C0=MIFV0;
    C1=MIFV;
    C2=MWEV0;
    C3=LPERFV0;
    C4=LDLV;
    C5=LEDV;
    !C6=LPERFV;
    !Mo1=LEEHV0; !leader emotionale exhaustion
    Mo2=MLMXP; !LSABP;
    Me=MWEV;
    Y=LPERFV2;
    CENTER X(GROUPMEAN);
    !CENTER X Mo1(GROUPMEAN);
    !Inter1 = X*Mo1;
    CENTER Mo2 (GRANDMEAN);

2.4 Same day: All group mean centered

## Error: 在 'old' 中未找到如下列名:[LDLV.GroC, LEDV.GroC, MWEV.GroC]。请考虑设置 skip_absent=TRUE。

IV: LDLV Level-1 Moderator: LEDV Level-2 Moderator: LMX Mediator: MWEV DV: LPERFV2 Controls: MIFV, MWEV0, LDLV0, LEDV0, LPERFV0

## 
## ------ Sample Size Information ------
## 
## Level 1: N = 1071 observations ("X")
## Level 2: K = 106 groups ("MNum")
## 
##        n (group sizes)
## Min.               6.0
## Median            10.0
## Mean              10.1
## Max.              16.0
## 
## ------ ICC(1), ICC(2), and rWG ------
## 
## ICC variable: "X"
## 
## ICC(1) = 0.000 (non-independence of data)
## ICC(2) = 0.000 (reliability of group means)
## 
## rWG variable: "X"
## 
## rWG (within-group agreement for single-item measures)
## ─────────────────────────────────────────────
##       Min. 1st Qu. Median  Mean 3rd Qu.  Max.
## ─────────────────────────────────────────────
## rWG  0.103   0.782  0.866 0.833   0.920 1.000
## ─────────────────────────────────────────────
## 
## 
## ------ Sample Size Information ------
## 
## Level 1: N = 1071 observations ("Mo1")
## Level 2: K = 106 groups ("MNum")
## 
##        n (group sizes)
## Min.               6.0
## Median            10.0
## Mean              10.1
## Max.              16.0
## 
## ------ ICC(1), ICC(2), and rWG ------
## 
## ICC variable: "Mo1"
## 
## ICC(1) = 0.000 (non-independence of data)
## ICC(2) = 0.000 (reliability of group means)
## 
## rWG variable: "Mo1"
## 
## rWG (within-group agreement for single-item measures)
## ─────────────────────────────────────────────
##       Min. 1st Qu. Median  Mean 3rd Qu.  Max.
## ─────────────────────────────────────────────
## rWG  0.000   0.760  0.914 0.845   0.979 1.000
## ─────────────────────────────────────────────
## Error in eval_f(x, ...): Downdated VtV is not positive definite

3 PATH A

## 
## Hierarchical Linear Model (HLM)
## (also known as) Linear Mixed Model (LMM)
## (also known as) Multilevel Linear Model (MLM)
## 
## Model Information:
## Formula: M ~ X * Mo1 + X * Mo2 + C1 + (X | MNum)
## Level-1 Observations: N = 1008
## Level-2 Groups/Clusters: MNum, 104
## 
## Model Fit:
## AIC = 2928.464
## BIC = 2982.537
## R_(m)² = 0.03661  (Marginal R²: fixed effects)
## R_(c)² = 0.64390  (Conditional R²: fixed + random effects)
## Omega² = 0.68315  (= 1 - proportion of unexplained variance)
## 
## ANOVA Table:
## ──────────────────────────────────────────────────
##        Sum Sq Mean Sq NumDF  DenDF     F     p    
## ──────────────────────────────────────────────────
## X        0.89    0.89  1.00  53.92  1.14  .290    
## Mo1      0.43    0.43  1.00 908.11  0.56  .455    
## Mo2      0.62    0.62  1.00 104.74  0.80  .373    
## C1      58.09   58.09  1.00 826.63 74.62 <.001 ***
## X:Mo1    3.10    3.10  1.00 716.52  3.98  .046 *  
## X:Mo2    3.74    3.74  1.00  45.83  4.80  .033 *  
## ──────────────────────────────────────────────────
## 
## Fixed Effects:
## Unstandardized Coefficients (b or γ):
## Outcome Variable: M
## ─────────────────────────────────────────────────────────────────
##                 b/γ    S.E.     t    df     p     [95% CI of b/γ]
## ─────────────────────────────────────────────────────────────────
## (Intercept)   5.199 (0.116) 44.72 104.4 <.001 *** [ 4.968, 5.429]
## X             0.041 (0.038)  1.07  53.9  .290     [-0.036, 0.117]
## Mo1          -0.029 (0.039) -0.75 908.1  .455     [-0.104, 0.047]
## Mo2           0.091 (0.102)  0.89 104.7  .373     [-0.111, 0.293]
## C1            0.206 (0.024)  8.64 826.6 <.001 *** [ 0.159, 0.253]
## X:Mo1         0.125 (0.063)  1.99 716.5  .046 *   [ 0.002, 0.247]
## X:Mo2         0.075 (0.034)  2.19  45.8  .033 *   [ 0.006, 0.143]
## ─────────────────────────────────────────────────────────────────
## 'df' is estimated by Satterthwaite approximation.
## 
## Standardized Coefficients (β):
## Outcome Variable: M
## ───────────────────────────────────────────────────────────
##             β    S.E.     t    df     p       [95% CI of β]
## ───────────────────────────────────────────────────────────
## X       0.021 (0.020)  1.07  53.9  .290     [-0.019, 0.061]
## Mo1    -0.014 (0.019) -0.75 908.1  .455     [-0.052, 0.023]
## Mo2     0.069 (0.078)  0.89 104.7  .373     [-0.085, 0.224]
## C1      0.163 (0.019)  8.64 826.6 <.001 *** [ 0.126, 0.200]
## X:Mo1   0.041 (0.020)  1.99 716.5  .046 *   [ 0.001, 0.081]
## X:Mo2   0.043 (0.020)  2.19  45.8  .033 *   [ 0.004, 0.083]
## ───────────────────────────────────────────────────────────
## 
## Random Effects:
## ──────────────────────────────────────────
##  Cluster  K   Parameter   Variance     ICC
## ──────────────────────────────────────────
##  MNum     104 (Intercept)  1.32196 0.62939
##               X            0.00991        
##  Residual                  0.77844        
## ──────────────────────────────────────────

4 PATH B

## 
## Hierarchical Linear Model (HLM)
## (also known as) Linear Mixed Model (LMM)
## (also known as) Multilevel Linear Model (MLM)
## 
## Model Information:
## Formula: Y ~ M + X + C1 + (X | MNum)
## Level-1 Observations: N = 907
## Level-2 Groups/Clusters: MNum, 104
## 
## Model Fit:
## AIC = 2507.561
## BIC = 2546.043
## R_(m)² = 0.00549  (Marginal R²: fixed effects)
## R_(c)² = 0.72476  (Conditional R²: fixed + random effects)
## Omega² = NA  (= 1 - proportion of unexplained variance)
## 
## ANOVA Table:
## ──────────────────────────────────────────────
##     Sum Sq Mean Sq NumDF  DenDF    F     p    
## ──────────────────────────────────────────────
## M     2.80    2.80  1.00 893.62 4.53  .033 *  
## X     1.61    1.61  1.00 123.27 2.62  .108    
## C1    1.15    1.15  1.00 810.83 1.86  .173    
## ──────────────────────────────────────────────
## 
## Fixed Effects:
## Unstandardized Coefficients (b or γ):
## Outcome Variable: Y
## ─────────────────────────────────────────────────────────────────
##                 b/γ    S.E.     t    df     p     [95% CI of b/γ]
## ─────────────────────────────────────────────────────────────────
## (Intercept)   4.758 (0.205) 23.27 449.5 <.001 *** [ 4.356, 5.160]
## M             0.066 (0.031)  2.13 893.6  .033 *   [ 0.005, 0.127]
## X             0.069 (0.042)  1.62 123.3  .108     [-0.015, 0.153]
## C1           -0.033 (0.024) -1.36 810.8  .173     [-0.080, 0.014]
## ─────────────────────────────────────────────────────────────────
## 'df' is estimated by Satterthwaite approximation.
## 
## Standardized Coefficients (β):
## Outcome Variable: Y
## ────────────────────────────────────────────────────────
##          β    S.E.     t    df     p       [95% CI of β]
## ────────────────────────────────────────────────────────
## M    0.062 (0.029)  2.13 893.6  .033 *   [ 0.005, 0.120]
## X    0.034 (0.021)  1.62 123.3  .108     [-0.008, 0.076]
## C1  -0.025 (0.018) -1.36 810.8  .173     [-0.060, 0.011]
## ────────────────────────────────────────────────────────
## 
## Random Effects:
## ──────────────────────────────────────────
##  Cluster  K   Parameter   Variance     ICC
## ──────────────────────────────────────────
##  MNum     104 (Intercept)  1.58739 0.72002
##               X            0.04272        
##  Residual                  0.61725        
## ──────────────────────────────────────────
## 
## Model Summary
## 
## ───────────────────────────────────────────────────
##                          (1) M         (2) Y       
## ───────────────────────────────────────────────────
## (Intercept)                 5.199 ***     4.758 ***
##                            (0.116)       (0.205)   
## X                           0.041         0.069    
##                            (0.038)       (0.042)   
## Mo1                        -0.029                  
##                            (0.039)                 
## Mo2                         0.091                  
##                            (0.102)                 
## C1                          0.206 ***    -0.033    
##                            (0.024)       (0.024)   
## X:Mo1                       0.125 *                
##                            (0.063)                 
## X:Mo2                       0.075 *                
##                            (0.034)                 
## M                                         0.066 *  
##                                          (0.031)   
## ───────────────────────────────────────────────────
## Marginal R^2                0.037         0.005    
## Conditional R^2             0.644         0.725    
## AIC                      2928.464      2507.561    
## BIC                      2982.537      2546.043    
## Num. obs.                1008           907        
## Num. groups: MNum         104           104        
## Var: MNum (Intercept)       1.322         1.587    
## Var: MNum X                 0.010         0.043    
## Cov: MNum (Intercept) X    -0.096         0.005    
## Var: Residual               0.778         0.617    
## ───────────────────────────────────────────────────
## Note. * p < .05, ** p < .01, *** p < .001.
## 
## Effects of Mediation (rep=5000, seed=1223 if not preset):
## ────────────────────────────────────────────────────────────────────────────────────
##                        Effects    ab  SEab     a   SEa     b   SEb abLLCI abULCI sig
## ────────────────────────────────────────────────────────────────────────────────────
## 1  Monte Carlo based Mediation 0.008 0.006 0.125 0.063 0.066 0.031 -0.001  0.022  no
## 2  Monte Carlo based Mediation 0.005 0.003 0.075 0.034 0.066 0.031 -0.000  0.013  no
## ────────────────────────────────────────────────────────────────────────────────────