title: “r markdown data 1” output: html_document date: “2026-04-11” —(r) library(“readxl”) library(“ggpubr”) data1 <-read_excel(“A4Q1.xlsx”) ggscatter( data1, x = “age”, y = “education”, add = “reg.line”, xlab = “age”, ylab = “education” ) # The relationship is linear.
mean(data1\(Age) sd(data1\)Age) median(data1$Age)
mean(data1\(education) sd(data1\)education) median(data1$education)
hist(data1$age, main = “age”, breaks = 20, col = “lightblue”, border = “white”, cex.main = 1, cex.axis = 1, cex.lab = 1)
hist(data1$education, main = “education”, breaks = 20, col = “lightcoral”, border = “white”, cex.main = 1, cex.axis = 1, cex.lab = 1)
shapiro.test(data1\(age) shapiro.test(data1\)education)
cor.test(data1\(age, data1\)education, method = “pearson”) ’’’’’’’