Step 1: Examine Data

Create a table that indicates if we have “balanced” ANOVA

Each cell contains the same number of participants across our factors.

tbl_count_project <- table(Race_Ethnicity,Employment)
tbl_count_project
##                          Employment
## Race_Ethnicity            Employed_FT Employed_PT Self_Employed Unemployed
##   American_Indian_Alaskan           5           5             5          5
##   Asian                             5           5             5          5
##   Black_AA                          5           5             5          5
##   Hispanic_Latino                   5           5             5          5
##   Multi-Racial                      5           5             5          5
##   Nat_Hawaiian_PI                   5           5             5          5
##   White                             5           5             5          5

We can see in the output that there are 5 individuals in each possible cell, which means we DO have a balanced design and can run a standard Two-Way ANOVA.

Look at the proportion of individuals in each cell.

tbl_percent_project <- round(prop.table(tbl_count_project), digits=2)
tbl_percent_project
##                          Employment
## Race_Ethnicity            Employed_FT Employed_PT Self_Employed Unemployed
##   American_Indian_Alaskan        0.04        0.04          0.04       0.04
##   Asian                          0.04        0.04          0.04       0.04
##   Black_AA                       0.04        0.04          0.04       0.04
##   Hispanic_Latino                0.04        0.04          0.04       0.04
##   Multi-Racial                   0.04        0.04          0.04       0.04
##   Nat_Hawaiian_PI                0.04        0.04          0.04       0.04
##   White                          0.04        0.04          0.04       0.04

Add the sums for each factor level

tbl_cross_project <- table(Race_Ethnicity,Employment)
addmargins(tbl_cross_project)
##                          Employment
## Race_Ethnicity            Employed_FT Employed_PT Self_Employed Unemployed Sum
##   American_Indian_Alaskan           5           5             5          5  20
##   Asian                             5           5             5          5  20
##   Black_AA                          5           5             5          5  20
##   Hispanic_Latino                   5           5             5          5  20
##   Multi-Racial                      5           5             5          5  20
##   Nat_Hawaiian_PI                   5           5             5          5  20
##   White                             5           5             5          5  20
##   Sum                              35          35            35         35 140

Display summed table in Bar Chart

Examine variablity across factor levels using box/scatter plots

Mean comparison model for race_ethnicity

Scatter plot graph with the means and standard error bars.

Mean comparison model for employment

Scatter plot graph with the means and standard error bars.

Step 2: Running the 2-way ANOVA

project_2way <- aov(ASQ ~ Race_Ethnicity + Employment + Race_Ethnicity:Employment, data = project_data)

summary(project_2way)
##                            Df Sum Sq Mean Sq F value   Pr(>F)    
## Race_Ethnicity              6 274591   45765  20.607 4.22e-16 ***
## Employment                  3 196250   65417  29.456 4.37e-14 ***
## Race_Ethnicity:Employment  18   4606     256   0.115        1    
## Residuals                 111 246513    2221                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 1 observation deleted due to missingness

Step 3: Getting Descriptive Statistics

The following includes descriptive statistics needed for reporting results and/or creating a means table.

Race_Ethnicity Descriptives

##            Race_Ethnicity count     mean       sd
## 1 American_Indian_Alaskan    20  99.7000 52.41344
## 2                   Asian    20 175.5500 62.59097
## 3                Black_AA    20  94.3500 46.73697
## 4         Hispanic_Latino    20 152.1500 64.10622
## 5            Multi-Racial    20 105.1579 52.47990
## 6         Nat_Hawaiian_PI    20 109.6000 50.90900
## 7                   White    20 221.2000 73.38980

Employment Descriptives

##      Employment count     mean       sd
## 1   Employed_FT    35 126.0000 60.45885
## 2   Employed_PT    35 114.3429 61.67893
## 3 Self_Employed    35 106.8857 64.63507
## 4    Unemployed    35 200.6286 62.87854

Means Table

##             Race_Ethnicity    Employment count  mean       sd
## 1  American_Indian_Alaskan   Employed_FT     5  89.6 44.76941
## 2  American_Indian_Alaskan   Employed_PT     5  80.8 45.72417
## 3  American_Indian_Alaskan Self_Employed     5  71.2 50.72672
## 4  American_Indian_Alaskan    Unemployed     5 157.2 25.66515
## 5                    Asian   Employed_FT     5 165.0 41.83898
## 6                    Asian   Employed_PT     5 148.2 59.12022
## 7                    Asian Self_Employed     5 141.0 55.21322
## 8                    Asian    Unemployed     5 248.0 34.45287
## 9                 Black_AA   Employed_FT     5  85.0 38.43826
## 10                Black_AA   Employed_PT     5  79.4 39.81583
## 11                Black_AA Self_Employed     5  68.4 45.03110
## 12                Black_AA    Unemployed     5 144.6 29.97165
## 13         Hispanic_Latino   Employed_FT     5 139.2 43.85430
## 14         Hispanic_Latino   Employed_PT     5 126.8 57.63419
## 15         Hispanic_Latino Self_Employed     5 119.4 57.33934
## 16         Hispanic_Latino    Unemployed     5 223.2 48.20996
## 17            Multi-Racial   Employed_FT     5  88.5 40.68169
## 18            Multi-Racial   Employed_PT     5  85.0 38.62642
## 19            Multi-Racial Self_Employed     5  78.0 40.36707
## 20            Multi-Racial    Unemployed     5 165.8 41.55358
## 21         Nat_Hawaiian_PI   Employed_FT     5  98.4 41.79474
## 22         Nat_Hawaiian_PI   Employed_PT     5  90.0 43.84062
## 23         Nat_Hawaiian_PI Self_Employed     5  83.6 47.93537
## 24         Nat_Hawaiian_PI    Unemployed     5 166.4 28.79757
## 25                   White   Employed_FT     5 208.8 56.63656
## 26                   White   Employed_PT     5 190.2 69.71513
## 27                   White Self_Employed     5 186.6 76.73526
## 28                   White    Unemployed     5 299.2 33.65561

Grand Mean for ANOVA model

describe(ASQ)
##    vars   n   mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 139 137.04 72.33    131  132.98 74.13   5 330   325 0.47    -0.17 6.13

Step 4: Partial Eta-Squared

Calculate the partial eta-squared values that align to the various effects within our GLM 2-way ANOVA model.

Ensure we are specifying the correct model

m_2way_project <- aov(ASQ ~ Race_Ethnicity + Employment + Race_Ethnicity:Employment, data = project_data)

Run the partial eta-squared estimates for our 2-way model effects.

eta_squared(car::Anova(m_2way_project, partial = TRUE, type = 2))
## # Effect Size for ANOVA (Type II)
## 
## Parameter                 | Eta2 (partial) |       95% CI
## ---------------------------------------------------------
## Race_Ethnicity            |           0.53 | [0.41, 1.00]
## Employment                |           0.44 | [0.33, 1.00]
## Race_Ethnicity:Employment |           0.02 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

We can see from these results that interaction Race_Ethnicity:Employment has a small effect size (.02). Employment and Race_ethnicity have large effect sizes: (.44) and (.53) respectively.

Testing Assumptions

Homogeneity of Variance

leveneTest(ASQ ~ Race_Ethnicity*Employment, data = project_data)
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  27  0.4086 0.9955
##       111

The assumption is maintained here since the p-value of Levene’s test was > .05.

Normality of Residuals

Independce of Datapoints

Missing Data