```{r} library(readxl) library(ggpubr) A5Q1 <- read_excel(“C:/Users/User/Downloads/A5Q1.xlsx”) ggscatter( A5Q1, x = “age”, y = “education”, add = “reg.line”, xlab = “age”, ylab = “education” ) # The relationship is linear. # The relationship is positive. # There are outliers. mean(A5Q1\(age) sd(A5Q1\)age) median(A5Q1$age)
mean(A5Q1\(education) sd(A5Q1\)education) median(A5Q1\(education) hist(A5Q1\)age, main = “age”, breaks = 20, col = “lightblue”, border = “white”, cex.main = 1, cex.axis = 1, cex.lab = 1)
hist(A5Q1$education, main = “education”, breaks = 20, col = “lightcoral”, border = “white”, cex.main = 1, cex.axis = 1, cex.lab = 1) # Variable 1: Age # The variable looks normally distributed. # The data is symmetrical. # The data has a proper bell curve.
shapiro.test(A5Q1$age)
shapiro.test(A5Q1\(education) # Variable 1: Age # The variable is normally distributed (p>.05). ## Above, I wrote (p=.56), but p should have been written as (p>.05) to demonstrate that the data is normal, since p>.05 is normal data, and p<.05 is abnormal data. # Variable 2: education # The variable is normally distributed (p>.05). ## Above, I wrote (p=.44), but p should have been written as (p>.05) to demonstrate that the data is normal, since p>.05 is normal data, and p<.05 is abnormal data. cor.test( A5Q1\)age, A5Q1$education, method = “pearson” ) # A Pearson correlation was conducted to test the relationship between age (M = 35.33, SD = 11.45) and education (M = 13.83, SD = 2.60).
```