4 Comparing Two Categorical Variables: Practical 10
In this practical we focus on investigating the association between two categorical variables. We commence in the same way as the previous practical, loading libraries, setting options and themes, and reading in the data.
#--- Load libraries - reminder to always load tidyverse last
library(epiDisplay)
library(magrittr)
library(foreign)
library(psych)
library(tidyverse)
#--- Change to show no scientific notation & round to 3 decimal places
options(scipen = 10, digits=3)
#--- Set the plot theme to come out in black and white
theme_set(theme_bw())
#--- Read in the file
bab9 <- read.dta("./BAB9.dta", convert.factors = T)