{r}A4Q2 <- read_excel("Downloads/A4Q2.xlsx")

{r}ggscatter( A4Q2, x = "phone", y = "sleep", add = "reg.line", xlab = "Phone", ylab = "Sleep" )

The relationship is linear. The relationship is negative. The relationship is moderate to strong. There are no outliers.

{r}mean(A4Q2$phone) sd(A4Q2$phone) median(A4Q2$phone)

{r}mean(A4Q2$sleep) sd(A4Q2$sleep) median(A4Q2$sleep)

{r}hist(A4Q2$phone, main = "phone", breaks = 20, col = "lightblue", border = "white", cex.main = 1, cex.axis = 1, cex.lab = 1)

{r}hist(A4Q2$sleep, main = "sleep", breaks = 20, col = "lightcoral", border = "white", cex.main = 1, cex.axis = 1, cex.lab = 1)

Variable 1: Hours of Phone User The first variable looks abnormally distributed. The data is positively skewed. The data has a proper bell curve.

Variable 2: Hours of Sleep The second variable looks abnormally distributed. The data is symmetrical. The data does not have a proper bell curve.

{r}shapiro.test(A4Q2$phone) {r}shapiro.test(A4Q2$sleep)

Variable 1: Phone The first variable is abnormally distributed (p < 0.05).

Variable 2: Name of Variable The first variable is abnormally distributed (p < 0.05).

{r}cor.test(A4Q2$phone, A4Q2$sleep, method = "spearman")

A Spearman correlation was conducted to test the relationship between Hours of Phone Use (Mdn = 3.27) and Hours of Sleep (Mdn = 7.52). There was a statistically significant relationship between the two variables, ρ = -0.61, p < .001. The relationship was negative and strong. As the independent variable increased, the dependent variable decreased.