Presenting Regression Analyses in R

Kevin Donovan

March 12, 2021

Introduction

missing
Tidyverse

Correlation analyses

##                   EACSF_V24   ICV_V24   TBV_V24   TCV_V24 LeftAmygdala_V24
## EACSF_V24         1.0000000 0.4967139 0.3776087 0.3682626        0.2796662
## ICV_V24           0.4967139 1.0000000 0.9831674 0.9762236        0.7688862
## TBV_V24           0.3776087 0.9831674 1.0000000 0.9958002        0.7775354
## TCV_V24           0.3682626 0.9762236 0.9958002 1.0000000        0.7758346
## LeftAmygdala_V24  0.2796662 0.7688862 0.7775354 0.7758346        1.0000000
## RightAmygdala_V24 0.2780251 0.7694070 0.7789113 0.7759660        0.8863418
##                   RightAmygdala_V24
## EACSF_V24                 0.2780251
## ICV_V24                   0.7694070
## TBV_V24                   0.7789113
## TCV_V24                   0.7759660
## LeftAmygdala_V24          0.8863418
## RightAmygdala_V24         1.0000000

Correlation analyses

Correlation analyses

Summary statistics

Regression summaries

## 
## Call:
## lm(formula = V24_MSEL_EL_ae ~ RiskGroup + RightAmygdala_V24 + 
##     RiskGroup * RightAmygdala_V24, data = brain_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -18.348  -3.159  -0.599   3.324  18.403 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                        6.404220   6.900240   0.928   0.3540  
## RiskGroupHR-Neg                   15.251840   8.012648   1.903   0.0578 .
## RiskGroupLR-Neg                   22.861074   9.024587   2.533   0.0117 *
## RightAmygdala_V24                  0.011110   0.006403   1.735   0.0836 .
## RiskGroupHR-Neg:RightAmygdala_V24 -0.009279   0.007505  -1.236   0.2172  
## RiskGroupLR-Neg:RightAmygdala_V24 -0.015163   0.008514  -1.781   0.0758 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.425 on 351 degrees of freedom
##   (145 observations deleted due to missingness)
## Multiple R-squared:  0.1478, Adjusted R-squared:  0.1357 
## F-statistic: 12.18 on 5 and 351 DF,  p-value: 6.798e-11

Regression summaries: tables

Regression summaries: tables

## 
## Call:
## lm(formula = V24_MSEL_EL_ae ~ RiskGroup + RightAmygdala_V24 + 
##     RiskGroup * RightAmygdala_V24, data = brain_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -18.348  -3.159  -0.599   3.324  18.403 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                        6.404220   6.900240   0.928   0.3540  
## RiskGroupHR-Neg                   15.251840   8.012648   1.903   0.0578 .
## RiskGroupLR-Neg                   22.861074   9.024587   2.533   0.0117 *
## RightAmygdala_V24                  0.011110   0.006403   1.735   0.0836 .
## RiskGroupHR-Neg:RightAmygdala_V24 -0.009279   0.007505  -1.236   0.2172  
## RiskGroupLR-Neg:RightAmygdala_V24 -0.015163   0.008514  -1.781   0.0758 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.425 on 351 degrees of freedom
##   (145 observations deleted due to missingness)
## Multiple R-squared:  0.1478, Adjusted R-squared:  0.1357 
## F-statistic: 12.18 on 5 and 351 DF,  p-value: 6.798e-11
## # A tibble: 6 x 5
##   term                              estimate std.error statistic p.value
##   <chr>                                <dbl>     <dbl>     <dbl>   <dbl>
## 1 (Intercept)                        6.40      6.90        0.928  0.354 
## 2 RiskGroupHR-Neg                   15.3       8.01        1.90   0.0578
## 3 RiskGroupLR-Neg                   22.9       9.02        2.53   0.0117
## 4 RightAmygdala_V24                  0.0111    0.00640     1.74   0.0836
## 5 RiskGroupHR-Neg:RightAmygdala_V24 -0.00928   0.00750    -1.24   0.217 
## 6 RiskGroupLR-Neg:RightAmygdala_V24 -0.0152    0.00851    -1.78   0.0758

Regression summaries: visuals

Regression summaries: visuals

\[ \begin{align} &MSEL = \beta_0+\beta_1Amyg+\beta_2HRneg+\beta_3LRneg+\beta_4HRneg*Amyg+\beta_5LRneg*Amyg=\epsilon \\ &LSM(HRneg)=\beta_0+\beta_2+\beta_1x+\beta_4x \text{ where x is fixed value, e.g. mean Amygfala} \\ &LSM(LRneg)=\beta_0+\beta_3+\beta_1x+\beta_5x\\ &LSM(HRASD)=\beta_0+\beta_1x \end{align} \]

Regression summaries: visuals

missing
Tidyverse

Regression summaries: visuals

missing