## 
## Mediation Analysis with Control Variables
## ====================================================================================================================
##                                                                         Dependent variable:                         
##                                                ---------------------------------------------------------------------
##                                                        means                  severe                  means         
##                                                         (1)                    (2)                     (3)          
## --------------------------------------------------------------------------------------------------------------------
## PHQ_2Depression                                       0.35***                 0.48**                 0.28***        
##                                                        (0.08)                 (0.18)                 (0.07)         
##                                                                                                                     
## severe                                                                                               0.13***        
##                                                                                                      (0.03)         
##                                                                                                                     
## Age25-34                                                0.05                   0.22                   0.02          
##                                                        (0.11)                 (0.25)                 (0.11)         
##                                                                                                                     
## Age35-44                                                0.04                  0.74**                  -0.05         
##                                                        (0.12)                 (0.27)                 (0.11)         
##                                                                                                                     
## Age45-54                                                0.02                   0.15                   0.003         
##                                                        (0.13)                 (0.30)                 (0.12)         
##                                                                                                                     
## Age55-64                                               -0.34*                 -0.20                  -0.32*         
##                                                        (0.15)                 (0.35)                 (0.14)         
##                                                                                                                     
## Age65-74                                               -0.39*                  0.19                  -0.42*         
##                                                        (0.18)                 (0.41)                 (0.17)         
##                                                                                                                     
## Age75+                                                 -0.35                  -0.97                   -0.22         
##                                                        (0.27)                 (0.63)                 (0.26)         
##                                                                                                                     
## GenderMale                                             -0.04                   0.32                   -0.08         
##                                                        (0.07)                 (0.17)                 (0.07)         
##                                                                                                                     
## GenderTransgender                                       0.14                  -1.27                   0.30          
##                                                        (0.57)                 (1.31)                 (0.54)         
##                                                                                                                     
## RaceHispanic                                           -0.21                  -0.61                   -0.13         
##                                                        (0.16)                 (0.36)                 (0.15)         
##                                                                                                                     
## RaceMixed                                              -0.34                  -0.24                   -0.31         
##                                                        (0.18)                 (0.42)                 (0.17)         
##                                                                                                                     
## RaceWhite                                              -0.21                  -0.58                   -0.13         
##                                                        (0.14)                 (0.31)                 (0.13)         
##                                                                                                                     
## EducationLess than High School                          0.29                   0.24                   0.26          
##                                                        (0.16)                 (0.37)                 (0.15)         
##                                                                                                                     
## EducationMore than College                              0.13                   0.01                   0.13          
##                                                        (0.09)                 (0.21)                 (0.09)         
##                                                                                                                     
## EducationSome College                                  -0.03                   0.12                   -0.04         
##                                                        (0.10)                 (0.24)                 (0.10)         
##                                                                                                                     
## HHsize_cat1-5                                           0.14                  0.63*                   0.06          
##                                                        (0.11)                 (0.26)                 (0.11)         
##                                                                                                                     
## HHsize_cat5+                                           -0.02                   0.27                   -0.06         
##                                                        (0.18)                 (0.40)                 (0.17)         
##                                                                                                                     
## TBIStatusModerate to Severe                             0.01                   0.69                   -0.08         
##                                                        (0.18)                 (0.42)                 (0.18)         
##                                                                                                                     
## TBIStatusNo TBI                                       -0.33**                 -0.36                  -0.28**        
##                                                        (0.10)                 (0.24)                 (0.10)         
##                                                                                                                     
## TBIStatusSubconcussive                                 -0.06                   0.13                   -0.08         
##                                                        (0.08)                 (0.19)                 (0.08)         
##                                                                                                                     
## Seizure_Frequency1 or fewer seizures per month        0.48***                 0.67**                 0.39***        
##                                                        (0.09)                 (0.21)                 (0.09)         
##                                                                                                                     
## Seizure_Frequency11 or more seizures per month        0.90***                1.87***                 0.65**         
##                                                        (0.24)                 (0.56)                 (0.24)         
##                                                                                                                     
## Seizure_Frequency2-5 seizures per month               0.67***                0.85***                 0.55***        
##                                                        (0.11)                 (0.24)                 (0.10)         
##                                                                                                                     
## Seizure_Frequency6-10 seizures per month              0.76***                1.95***                 0.50**         
##                                                        (0.16)                 (0.36)                 (0.16)         
##                                                                                                                     
## Constant                                              2.58***                1.94***                 2.33***        
##                                                        (0.21)                 (0.48)                 (0.21)         
##                                                                                                                     
## --------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                     261          
## R2                                                      0.50                   0.39                   0.54          
## Adjusted R2                                             0.45                   0.32                   0.49          
## Residual Std. Error                               0.56 (df = 236)        1.28 (df = 236)         0.53 (df = 235)    
## F Statistic                                    9.70*** (df = 24; 236) 6.16*** (df = 24; 236) 11.18*** (df = 25; 235)
## ====================================================================================================================
## Note:                                                                                  *p<0.05; **p<0.01; ***p<0.001
m2<-lm(means~GAD2_2 + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)



m2.M<-lm(severe~GAD2_2+ Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency, data= LEEP)


m2.Y<-lm(means~ GAD2_2 + severe+ + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)




stargazer(m2,m2.M,m2.Y, type = "text", title = "Mediation Analysis with Control Variables",
          star.cutoffs = c(0.05, 0.01, 0.001), digits = 2)
## 
## Mediation Analysis with Control Variables
## ====================================================================================================================
##                                                                         Dependent variable:                         
##                                                ---------------------------------------------------------------------
##                                                        means                  severe                  means         
##                                                         (1)                    (2)                     (3)          
## --------------------------------------------------------------------------------------------------------------------
## GAD2_2GAD                                             0.31***                 0.43*                  0.25**         
##                                                        (0.08)                 (0.18)                 (0.08)         
##                                                                                                                     
## severe                                                                                               0.14***        
##                                                                                                      (0.03)         
##                                                                                                                     
## Age25-34                                                0.10                   0.29                   0.06          
##                                                        (0.11)                 (0.26)                 (0.11)         
##                                                                                                                     
## Age35-44                                                0.05                  0.75**                  -0.05         
##                                                        (0.12)                 (0.27)                 (0.11)         
##                                                                                                                     
## Age45-54                                                0.07                   0.22                   0.04          
##                                                        (0.13)                 (0.30)                 (0.13)         
##                                                                                                                     
## Age55-64                                               -0.27                  -0.10                   -0.26         
##                                                        (0.15)                 (0.35)                 (0.15)         
##                                                                                                                     
## Age65-74                                               -0.33                   0.27                  -0.37*         
##                                                        (0.18)                 (0.41)                 (0.17)         
##                                                                                                                     
## Age75+                                                 -0.26                  -0.85                   -0.15         
##                                                        (0.28)                 (0.63)                 (0.26)         
##                                                                                                                     
## GenderMale                                             -0.02                  0.35*                   -0.06         
##                                                        (0.08)                 (0.17)                 (0.07)         
##                                                                                                                     
## GenderTransgender                                       0.57                  -0.66                   0.66          
##                                                        (0.58)                 (1.31)                 (0.55)         
##                                                                                                                     
## RaceHispanic                                           -0.12                  -0.48                   -0.06         
##                                                        (0.16)                 (0.36)                 (0.15)         
##                                                                                                                     
## RaceMixed                                              -0.23                  -0.09                   -0.22         
##                                                        (0.18)                 (0.42)                 (0.18)         
##                                                                                                                     
## RaceWhite                                              -0.15                  -0.51                   -0.08         
##                                                        (0.14)                 (0.31)                 (0.13)         
##                                                                                                                     
## EducationLess than High School                          0.24                   0.17                   0.22          
##                                                        (0.16)                 (0.37)                 (0.15)         
##                                                                                                                     
## EducationMore than College                              0.09                  -0.05                   0.10          
##                                                        (0.09)                 (0.21)                 (0.09)         
##                                                                                                                     
## EducationSome College                                  -0.07                   0.06                   -0.08         
##                                                        (0.10)                 (0.23)                 (0.10)         
##                                                                                                                     
## HHsize_cat1-5                                           0.11                  0.57*                   0.03          
##                                                        (0.12)                 (0.26)                 (0.11)         
##                                                                                                                     
## HHsize_cat5+                                            0.03                   0.34                   -0.02         
##                                                        (0.18)                 (0.40)                 (0.17)         
##                                                                                                                     
## TBIStatusModerate to Severe                             0.05                   0.74                   -0.05         
##                                                        (0.18)                 (0.42)                 (0.18)         
##                                                                                                                     
## TBIStatusNo TBI                                       -0.33**                 -0.37                  -0.28**        
##                                                        (0.10)                 (0.24)                 (0.10)         
##                                                                                                                     
## TBIStatusSubconcussive                                 -0.07                   0.12                   -0.09         
##                                                        (0.08)                 (0.19)                 (0.08)         
##                                                                                                                     
## Seizure_Frequency1 or fewer seizures per month        0.50***                 0.70**                 0.41***        
##                                                        (0.09)                 (0.21)                 (0.09)         
##                                                                                                                     
## Seizure_Frequency11 or more seizures per month        0.98***                1.98***                 0.71**         
##                                                        (0.24)                 (0.56)                 (0.24)         
##                                                                                                                     
## Seizure_Frequency2-5 seizures per month               0.74***                0.95***                 0.61***        
##                                                        (0.10)                 (0.24)                 (0.10)         
##                                                                                                                     
## Seizure_Frequency6-10 seizures per month              0.77***                1.97***                 0.51**         
##                                                        (0.16)                 (0.36)                 (0.16)         
##                                                                                                                     
## Constant                                              2.50***                1.83***                 2.26***        
##                                                        (0.22)                 (0.49)                 (0.21)         
##                                                                                                                     
## --------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                     261          
## R2                                                      0.49                   0.38                   0.54          
## Adjusted R2                                             0.44                   0.32                   0.49          
## Residual Std. Error                               0.56 (df = 236)        1.28 (df = 236)         0.53 (df = 235)    
## F Statistic                                    9.34*** (df = 24; 236) 6.07*** (df = 24; 236) 10.89*** (df = 25; 235)
## ====================================================================================================================
## Note:                                                                                  *p<0.05; **p<0.01; ***p<0.001
m2<-lm(MCS_m~ PHQ_2 + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)



m2.M<-lm(severe~PHQ_2+ Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency, data= LEEP)


m2.Y<-lm(MCS_m~ PHQ_2 + severe+ + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)




stargazer(m2,m2.M,m2.Y, type = "text", title = "Mediation Analysis with Control Variables",
          star.cutoffs = c(0.05, 0.01, 0.001), digits = 2)
## 
## Mediation Analysis with Control Variables
## ===================================================================================================================
##                                                                        Dependent variable:                         
##                                                --------------------------------------------------------------------
##                                                        MCS_m                  severe                 MCS_m         
##                                                         (1)                    (2)                    (3)          
## -------------------------------------------------------------------------------------------------------------------
## PHQ_2Depression                                       -9.26***                0.48**                -8.69***       
##                                                        (1.18)                 (0.18)                 (1.18)        
##                                                                                                                    
## severe                                                                                              -1.19**        
##                                                                                                      (0.43)        
##                                                                                                                    
## Age25-34                                                2.35                   0.22                   2.61         
##                                                        (1.69)                 (0.25)                 (1.67)        
##                                                                                                                    
## Age35-44                                                2.43                  0.74**                  3.31         
##                                                        (1.78)                 (0.27)                 (1.78)        
##                                                                                                                    
## Age45-54                                               5.62**                  0.15                  5.79**        
##                                                        (1.97)                 (0.30)                 (1.95)        
##                                                                                                                    
## Age55-64                                               7.05**                 -0.20                  6.82**        
##                                                        (2.30)                 (0.35)                 (2.27)        
##                                                                                                                    
## Age65-74                                               8.02**                  0.19                  8.25**        
##                                                        (2.71)                 (0.41)                 (2.68)        
##                                                                                                                    
## Age75+                                                12.65**                 -0.97                 11.49**        
##                                                        (4.18)                 (0.63)                 (4.14)        
##                                                                                                                    
## GenderMale                                              1.81                   0.32                   2.18         
##                                                        (1.14)                 (0.17)                 (1.14)        
##                                                                                                                    
## GenderTransgender                                      -9.20                  -1.27                  -10.71        
##                                                        (8.70)                 (1.31)                 (8.60)        
##                                                                                                                    
## RaceHispanic                                            3.57                  -0.61                   2.85         
##                                                        (2.42)                 (0.36)                 (2.40)        
##                                                                                                                    
## RaceMixed                                               2.19                  -0.24                   1.90         
##                                                        (2.80)                 (0.42)                 (2.76)        
##                                                                                                                    
## RaceWhite                                               1.29                  -0.58                   0.60         
##                                                        (2.08)                 (0.31)                 (2.07)        
##                                                                                                                    
## EducationLess than High School                         -2.09                   0.24                  -1.80         
##                                                        (2.45)                 (0.37)                 (2.41)        
##                                                                                                                    
## EducationMore than College                             -0.60                   0.01                  -0.59         
##                                                        (1.39)                 (0.21)                 (1.37)        
##                                                                                                                    
## EducationSome College                                   2.04                   0.12                   2.18         
##                                                        (1.57)                 (0.24)                 (1.55)        
##                                                                                                                    
## HHsize_cat1-5                                           0.65                  0.63*                   1.39         
##                                                        (1.75)                 (0.26)                 (1.74)        
##                                                                                                                    
## HHsize_cat5+                                           6.77*                   0.27                  7.09**        
##                                                        (2.69)                 (0.40)                 (2.65)        
##                                                                                                                    
## TBIStatusModerate to Severe                            -0.19                   0.69                   0.63         
##                                                        (2.80)                 (0.42)                 (2.78)        
##                                                                                                                    
## TBIStatusNo TBI                                        5.10**                 -0.36                  4.67**        
##                                                        (1.59)                 (0.24)                 (1.57)        
##                                                                                                                    
## TBIStatusSubconcussive                                  1.29                   0.13                   1.45         
##                                                        (1.28)                 (0.19)                 (1.26)        
##                                                                                                                    
## Seizure_Frequency1 or fewer seizures per month         -0.57                  0.67**                  0.22         
##                                                        (1.40)                 (0.21)                 (1.41)        
##                                                                                                                    
## Seizure_Frequency11 or more seizures per month         -5.58                 1.87***                 -3.36         
##                                                        (3.72)                 (0.56)                 (3.75)        
##                                                                                                                    
## Seizure_Frequency2-5 seizures per month                -0.61                 0.85***                  0.40         
##                                                        (1.61)                 (0.24)                 (1.63)        
##                                                                                                                    
## Seizure_Frequency6-10 seizures per month               -0.84                 1.95***                  1.48         
##                                                        (2.41)                 (0.36)                 (2.52)        
##                                                                                                                    
## Constant                                              36.29***               1.94***                38.60***       
##                                                        (3.18)                 (0.48)                 (3.24)        
##                                                                                                                    
## -------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                    261          
## R2                                                      0.42                   0.39                   0.44         
## Adjusted R2                                             0.37                   0.32                   0.38         
## Residual Std. Error                               8.49 (df = 236)        1.28 (df = 236)        8.37 (df = 235)    
## F Statistic                                    7.25*** (df = 24; 236) 6.16*** (df = 24; 236) 7.47*** (df = 25; 235)
## ===================================================================================================================
## Note:                                                                                 *p<0.05; **p<0.01; ***p<0.001
m2<-lm(MCS_m~ GAD2_2 + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)



m2.M<-lm(severe~GAD2_2+ Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency, data= LEEP)


m2.Y<-lm(MCS_m~ GAD2_2 + severe+ + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)




stargazer(m2,m2.M,m2.Y, type = "text", title = "Mediation Analysis with Control Variables",
          star.cutoffs = c(0.05, 0.01, 0.001), digits = 2)
## 
## Mediation Analysis with Control Variables
## ===================================================================================================================
##                                                                        Dependent variable:                         
##                                                --------------------------------------------------------------------
##                                                        MCS_m                  severe                 MCS_m         
##                                                         (1)                    (2)                    (3)          
## -------------------------------------------------------------------------------------------------------------------
## GAD2_2GAD                                             -9.13***                0.43*                 -8.59***       
##                                                        (1.19)                 (0.18)                 (1.18)        
##                                                                                                                    
## severe                                                                                              -1.25**        
##                                                                                                      (0.43)        
##                                                                                                                    
## Age25-34                                                0.90                   0.29                   1.26         
##                                                        (1.71)                 (0.26)                 (1.69)        
##                                                                                                                    
## Age35-44                                                2.08                  0.75**                  3.02         
##                                                        (1.79)                 (0.27)                 (1.79)        
##                                                                                                                    
## Age45-54                                               4.02*                   0.22                  4.30*         
##                                                        (2.00)                 (0.30)                 (1.97)        
##                                                                                                                    
## Age55-64                                               4.81*                  -0.10                  4.69*         
##                                                        (2.35)                 (0.35)                 (2.31)        
##                                                                                                                    
## Age65-74                                               6.35*                   0.27                  6.69*         
##                                                        (2.73)                 (0.41)                 (2.69)        
##                                                                                                                    
## Age75+                                                 9.89*                  -0.85                  8.84*         
##                                                        (4.21)                 (0.63)                 (4.16)        
##                                                                                                                    
## GenderMale                                              1.16                  0.35*                   1.59         
##                                                        (1.16)                 (0.17)                 (1.15)        
##                                                                                                                    
## GenderTransgender                                     -21.52*                 -0.66                 -22.35*        
##                                                        (8.76)                 (1.31)                 (8.63)        
##                                                                                                                    
## RaceHispanic                                            1.16                  -0.48                   0.56         
##                                                        (2.41)                 (0.36)                 (2.38)        
##                                                                                                                    
## RaceMixed                                              -0.82                  -0.09                  -0.94         
##                                                        (2.80)                 (0.42)                 (2.76)        
##                                                                                                                    
## RaceWhite                                              -0.28                  -0.51                  -0.91         
##                                                        (2.09)                 (0.31)                 (2.07)        
##                                                                                                                    
## EducationLess than High School                         -0.51                   0.17                  -0.30         
##                                                        (2.47)                 (0.37)                 (2.43)        
##                                                                                                                    
## EducationMore than College                              0.52                  -0.05                   0.46         
##                                                        (1.39)                 (0.21)                 (1.37)        
##                                                                                                                    
## EducationSome College                                   3.01                   0.06                  3.09*         
##                                                        (1.56)                 (0.23)                 (1.54)        
##                                                                                                                    
## HHsize_cat1-5                                           1.78                  0.57*                   2.50         
##                                                        (1.76)                 (0.26)                 (1.75)        
##                                                                                                                    
## HHsize_cat5+                                           5.34*                   0.34                  5.77*         
##                                                        (2.69)                 (0.40)                 (2.66)        
##                                                                                                                    
## TBIStatusModerate to Severe                            -1.13                   0.74                  -0.20         
##                                                        (2.81)                 (0.42)                 (2.78)        
##                                                                                                                    
## TBIStatusNo TBI                                        5.04**                 -0.37                  4.58**        
##                                                        (1.60)                 (0.24)                 (1.58)        
##                                                                                                                    
## TBIStatusSubconcussive                                  1.45                   0.12                   1.60         
##                                                        (1.28)                 (0.19)                 (1.26)        
##                                                                                                                    
## Seizure_Frequency1 or fewer seizures per month         -1.13                  0.70**                 -0.26         
##                                                        (1.40)                 (0.21)                 (1.41)        
##                                                                                                                    
## Seizure_Frequency11 or more seizures per month         -7.61*                1.98***                 -5.13         
##                                                        (3.71)                 (0.56)                 (3.75)        
##                                                                                                                    
## Seizure_Frequency2-5 seizures per month                -2.41                 0.95***                 -1.23         
##                                                        (1.58)                 (0.24)                 (1.61)        
##                                                                                                                    
## Seizure_Frequency6-10 seizures per month               -0.98                 1.97***                  1.49         
##                                                        (2.42)                 (0.36)                 (2.52)        
##                                                                                                                    
## Constant                                              39.08***               1.83***                41.36***       
##                                                        (3.27)                 (0.49)                 (3.31)        
##                                                                                                                    
## -------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                    261          
## R2                                                      0.42                   0.38                   0.44         
## Adjusted R2                                             0.36                   0.32                   0.38         
## Residual Std. Error                               8.53 (df = 236)        1.28 (df = 236)        8.39 (df = 235)    
## F Statistic                                    7.11*** (df = 24; 236) 6.07*** (df = 24; 236) 7.38*** (df = 25; 235)
## ===================================================================================================================
## Note:                                                                                 *p<0.05; **p<0.01; ***p<0.001
m2<-lm(PCS_m~ PHQ_2 + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)



m2.M<-lm(severe~PHQ_2+ Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency, data= LEEP)


m2.Y<-lm(PCS_m~ PHQ_2 + severe+ + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)




stargazer(m2,m2.M,m2.Y, type = "text", title = "Mediation Analysis with Control Variables",
          star.cutoffs = c(0.05, 0.01, 0.001), digits = 2)
## 
## Mediation Analysis with Control Variables
## ===================================================================================================================
##                                                                        Dependent variable:                         
##                                                --------------------------------------------------------------------
##                                                        PCS_m                  severe                 PCS_m         
##                                                         (1)                    (2)                    (3)          
## -------------------------------------------------------------------------------------------------------------------
## PHQ_2Depression                                       -5.75***                0.48**                -4.69***       
##                                                        (1.26)                 (0.18)                 (1.22)        
##                                                                                                                    
## severe                                                                                              -2.23***       
##                                                                                                      (0.44)        
##                                                                                                                    
## Age25-34                                               -1.70                   0.22                  -1.21         
##                                                        (1.81)                 (0.25)                 (1.72)        
##                                                                                                                    
## Age35-44                                               -4.20*                 0.74**                 -2.56         
##                                                        (1.90)                 (0.27)                 (1.84)        
##                                                                                                                    
## Age45-54                                               -5.45*                  0.15                  -5.12*        
##                                                        (2.11)                 (0.30)                 (2.01)        
##                                                                                                                    
## Age55-64                                               -2.13                  -0.20                  -2.58         
##                                                        (2.46)                 (0.35)                 (2.34)        
##                                                                                                                    
## Age65-74                                               -1.98                   0.19                  -1.54         
##                                                        (2.90)                 (0.41)                 (2.76)        
##                                                                                                                    
## Age75+                                                 -4.66                  -0.97                  -6.83         
##                                                        (4.46)                 (0.63)                 (4.27)        
##                                                                                                                    
## GenderMale                                              0.06                   0.32                   0.77         
##                                                        (1.22)                 (0.17)                 (1.17)        
##                                                                                                                    
## GenderTransgender                                      -16.07                 -1.27                 -18.89*        
##                                                        (9.30)                 (1.31)                 (8.87)        
##                                                                                                                    
## RaceHispanic                                            1.73                  -0.61                   0.38         
##                                                        (2.59)                 (0.36)                 (2.48)        
##                                                                                                                    
## RaceMixed                                              -3.16                  -0.24                  -3.70         
##                                                        (2.99)                 (0.42)                 (2.85)        
##                                                                                                                    
## RaceWhite                                               1.38                  -0.58                   0.08         
##                                                        (2.23)                 (0.31)                 (2.13)        
##                                                                                                                    
## EducationLess than High School                         -1.20                   0.24                  -0.66         
##                                                        (2.61)                 (0.37)                 (2.49)        
##                                                                                                                    
## EducationMore than College                             -0.74                   0.01                  -0.72         
##                                                        (1.49)                 (0.21)                 (1.42)        
##                                                                                                                    
## EducationSome College                                   0.39                   0.12                   0.65         
##                                                        (1.68)                 (0.24)                 (1.60)        
##                                                                                                                    
## HHsize_cat1-5                                          -0.27                  0.63*                   1.13         
##                                                        (1.86)                 (0.26)                 (1.80)        
##                                                                                                                    
## HHsize_cat5+                                            0.95                   0.27                   1.55         
##                                                        (2.87)                 (0.40)                 (2.73)        
##                                                                                                                    
## TBIStatusModerate to Severe                             0.21                   0.69                   1.75         
##                                                        (3.00)                 (0.42)                 (2.87)        
##                                                                                                                    
## TBIStatusNo TBI                                        4.59**                 -0.36                  3.79*         
##                                                        (1.69)                 (0.24)                 (1.62)        
##                                                                                                                    
## TBIStatusSubconcussive                                  1.44                   0.13                   1.73         
##                                                        (1.36)                 (0.19)                 (1.30)        
##                                                                                                                    
## Seizure_Frequency1 or fewer seizures per month         -3.01*                 0.67**                 -1.53         
##                                                        (1.49)                 (0.21)                 (1.45)        
##                                                                                                                    
## Seizure_Frequency11 or more seizures per month        -11.23**               1.87***                 -7.07         
##                                                        (3.97)                 (0.56)                 (3.87)        
##                                                                                                                    
## Seizure_Frequency2-5 seizures per month                -2.90                 0.85***                 -1.01         
##                                                        (1.72)                 (0.24)                 (1.68)        
##                                                                                                                    
## Seizure_Frequency6-10 seizures per month              -6.96**                1.95***                 -2.61         
##                                                        (2.57)                 (0.36)                 (2.60)        
##                                                                                                                    
## Constant                                              46.72***               1.94***                51.04***       
##                                                        (3.40)                 (0.48)                 (3.34)        
##                                                                                                                    
## -------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                    261          
## R2                                                      0.27                   0.39                   0.34         
## Adjusted R2                                             0.20                   0.32                   0.27         
## Residual Std. Error                               9.07 (df = 236)        1.28 (df = 236)        8.63 (df = 235)    
## F Statistic                                    3.67*** (df = 24; 236) 6.16*** (df = 24; 236) 4.91*** (df = 25; 235)
## ===================================================================================================================
## Note:                                                                                 *p<0.05; **p<0.01; ***p<0.001
m2<-lm(PCS_m~ GAD2_2 + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)



m2.M<-lm(severe~GAD2_2+ Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency, data= LEEP)


m2.Y<-lm(PCS_m~ GAD2_2 + severe+ + Age+Gender+ Race+Education+ HHsize_cat+TBIStatus+Seizure_Frequency , data= LEEP)




stargazer(m2,m2.M,m2.Y, type = "text", title = "Mediation Analysis with Control Variables",
          star.cutoffs = c(0.05, 0.01, 0.001), digits = 2)
## 
## Mediation Analysis with Control Variables
## ===================================================================================================================
##                                                                        Dependent variable:                         
##                                                --------------------------------------------------------------------
##                                                        PCS_m                  severe                 PCS_m         
##                                                         (1)                    (2)                    (3)          
## -------------------------------------------------------------------------------------------------------------------
## GAD2_2GAD                                             -5.38***                0.43*                 -4.39***       
##                                                        (1.27)                 (0.18)                 (1.22)        
##                                                                                                                    
## severe                                                                                              -2.27***       
##                                                                                                      (0.44)        
##                                                                                                                    
## Age25-34                                               -2.55                   0.29                  -1.90         
##                                                        (1.83)                 (0.26)                 (1.74)        
##                                                                                                                    
## Age35-44                                               -4.37*                 0.75**                 -2.67         
##                                                        (1.91)                 (0.27)                 (1.85)        
##                                                                                                                    
## Age45-54                                              -6.36**                  0.22                 -5.86**        
##                                                        (2.14)                 (0.30)                 (2.04)        
##                                                                                                                    
## Age55-64                                               -3.42                  -0.10                  -3.64         
##                                                        (2.51)                 (0.35)                 (2.38)        
##                                                                                                                    
## Age65-74                                               -2.96                   0.27                  -2.34         
##                                                        (2.92)                 (0.41)                 (2.78)        
##                                                                                                                    
## Age75+                                                 -6.27                  -0.85                  -8.19         
##                                                        (4.51)                 (0.63)                 (4.30)        
##                                                                                                                    
## GenderMale                                             -0.30                  0.35*                   0.49         
##                                                        (1.24)                 (0.17)                 (1.19)        
##                                                                                                                    
## GenderTransgender                                     -23.49*                 -0.66                 -24.99**       
##                                                        (9.38)                 (1.31)                 (8.91)        
##                                                                                                                    
## RaceHispanic                                            0.23                  -0.48                  -0.86         
##                                                        (2.58)                 (0.36)                 (2.46)        
##                                                                                                                    
## RaceMixed                                              -5.00                  -0.09                  -5.21         
##                                                        (3.00)                 (0.42)                 (2.85)        
##                                                                                                                    
## RaceWhite                                               0.43                  -0.51                  -0.72         
##                                                        (2.24)                 (0.31)                 (2.14)        
##                                                                                                                    
## EducationLess than High School                         -0.29                   0.17                   0.10         
##                                                        (2.64)                 (0.37)                 (2.51)        
##                                                                                                                    
## EducationMore than College                             -0.05                  -0.05                  -0.15         
##                                                        (1.49)                 (0.21)                 (1.42)        
##                                                                                                                    
## EducationSome College                                   1.03                   0.06                   1.17         
##                                                        (1.67)                 (0.23)                 (1.59)        
##                                                                                                                    
## HHsize_cat1-5                                           0.41                  0.57*                   1.71         
##                                                        (1.88)                 (0.26)                 (1.80)        
##                                                                                                                    
## HHsize_cat5+                                            0.08                   0.34                   0.85         
##                                                        (2.88)                 (0.40)                 (2.74)        
##                                                                                                                    
## TBIStatusModerate to Severe                            -0.40                   0.74                   1.29         
##                                                        (3.01)                 (0.42)                 (2.87)        
##                                                                                                                    
## TBIStatusNo TBI                                        4.61**                 -0.37                  3.78*         
##                                                        (1.71)                 (0.24)                 (1.63)        
##                                                                                                                    
## TBIStatusSubconcussive                                  1.56                   0.12                   1.83         
##                                                        (1.37)                 (0.19)                 (1.30)        
##                                                                                                                    
## Seizure_Frequency1 or fewer seizures per month         -3.38*                 0.70**                 -1.79         
##                                                        (1.50)                 (0.21)                 (1.45)        
##                                                                                                                    
## Seizure_Frequency11 or more seizures per month        -12.55**               1.98***                 -8.05*        
##                                                        (3.97)                 (0.56)                 (3.87)        
##                                                                                                                    
## Seizure_Frequency2-5 seizures per month                -4.06*                0.95***                 -1.91         
##                                                        (1.69)                 (0.24)                 (1.66)        
##                                                                                                                    
## Seizure_Frequency6-10 seizures per month              -7.15**                1.97***                 -2.66         
##                                                        (2.59)                 (0.36)                 (2.61)        
##                                                                                                                    
## Constant                                              48.23***               1.83***                52.37***       
##                                                        (3.50)                 (0.49)                 (3.42)        
##                                                                                                                    
## -------------------------------------------------------------------------------------------------------------------
## Observations                                            261                    261                    261          
## R2                                                      0.26                   0.38                   0.34         
## Adjusted R2                                             0.19                   0.32                   0.27         
## Residual Std. Error                               9.12 (df = 236)        1.28 (df = 236)        8.67 (df = 235)    
## F Statistic                                    3.51*** (df = 24; 236) 6.07*** (df = 24; 236) 4.80*** (df = 25; 235)
## ===================================================================================================================
## Note:                                                                                 *p<0.05; **p<0.01; ***p<0.001

References

https://stats.stackexchange.com/questions/185626/what-if-path-c-isnt-significant-but-paths-a-and-b-are-indirect-effect-in-medi file:///C:/Users/u6032404/Downloads/MakingSenseofMediatingAnalysis.pdf https://en.wikipedia.org/wiki/Mediation_(statistics) https://nmmichalak.github.io/nicholas_michalak/blog_entries/2018/nrg01/nrg01.html https://tvpollet.github.io/PY_0782/Exercise_6.html https://rpubs.com/cardiomoon/481347 https://rpubs.com/cardiomoon/468602 https://rpubs.com/markhw/processr https://rpubs.com/VivianaWu/mssp_lab10 https://rpubs.com/maureenkelly03/606717 https://rpubs.com/Tarid/fullsem

##very important https://advstats.psychstat.org/book/mediation/index.php#baron-and-kenny-1986-method http://quantpsy.org/pubs/rucker_preacher_tormala_petty_2011.pdf https://ademos.people.uic.edu/Chapter14.html https://data.library.virginia.edu/introduction-to-mediation-analysis/ https://benwhalley.github.io/just-enough-r/mediation.html https://rpubs.com/VivianaWu/mssp_lab10

http://www.alexanderdemos.org/Class11.html