library(tidyverse)
library(psych)
library(hemp)Maggie_Gatongi_Project1_Quarto
Load Libraries
Load Data
project1 <- read.csv("project1.csv")
View(project1)View Data Structure
str(project1)'data.frame': 450 obs. of 9 variables:
$ id : int 1 2 3 4 5 6 7 8 9 10 ...
$ gender : chr "male" "female" "female" "female" ...
$ ses : num 0.1402 0.1493 -0.1112 0.0876 -0.7549 ...
$ math_score: num 56.2 56.6 50.4 38.1 34.3 ...
$ career : chr "Non-STEM" "Non-STEM" "Non-STEM" "Non-STEM" ...
$ mse1 : int 3 3 3 3 3 3 3 3 2 4 ...
$ mse2 : int 2 2 3 2 3 3 2 4 2 4 ...
$ mse3 : int 3 3 4 3 3 3 3 4 3 4 ...
$ mse4 : int 3 4 4 2 3 3 3 4 3 4 ...
Select Data - mse columns
project1data <- project1[, c("mse1", "mse2", "mse3", "mse4")]
view(project1data)
#print(project1data)Split-half Relibility and Spearman-Brown Correction: Alternate
# Spearman-Brown Correction to adjust for bias based on number of items, the more the items the higher the reliability, the lower the number of items the lower the reliability value. SB correction helps reduce this bias.# add sb = TRUE
#calculated using every other item; check ?split_half
split_half(project1data, type = "alternate") [1] 0.83
split_half(project1data, type = "alternate", sb = TRUE) [1] 0.9071038
Split-half reliability with alternate selection of items is 0.83 before Spearman-Brown correction. After Spearman-Brown correction, Split-Half reliability with alternate selection of items increases to 0.907.
Split-Half Reliability with Spearman-Brown Correction: Random
#splitting the instrument in half at random
#splitting the instrument in half at random
set.seed(1)
split_half(project1data, type = "random")[1] 0.83
split_half(project1data, type = "random", sb = TRUE) [1] 0.8649262
Split-half reliability with random selection of items is 0.83 before Spearman-Brown correction. After Spearman-Brown correction, Split-Half reliability with randome selection of items increases to 0.865.
In comparison to the random selection of items (0.865), the alternate selection of items yields a higher relibility value (0.907) following Spearman-Brown correction but is the same prior to correction.
Based on Zhao et. al (2021) the reliability cut-off of 0.6 has been exceeded for this scale. Based on the results, the scale measuring math self efficacy can be concluded to be a reliable scale.
Zhao, S., Li, Y., Su, Y., & Sun, L. (2021). Reliability and Validity of the Chinese General Social Capital Scale and Its Effect on Physical Disease and Psychological Distress among Chinese Medical Professionals. International Journal of Environmental Research and Public Health, 18(12), 1-13.
Cronbach’s alpha for the math self-efficacy items (mse1-mse4)
#library(hemp)
coef_alpha(project1data)[1] 0.89
Based on the results, with alpha value of 0.89 the measurement scale can be conclude to be reliable (Taber, 2018).
Pearson Correlation
#rse_sub <- subset(rse, select=Q1:Q10) # we only need the variables Q1-Q10
project1data_cor <- cor(project1data) # Correlation table
project1data_cor mse1 mse2 mse3 mse4
mse1 1.0000000 0.7162808 0.6695710 0.6872565
mse2 0.7162808 1.0000000 0.6276703 0.6272018
mse3 0.6695710 0.6276703 1.0000000 0.7085754
mse4 0.6872565 0.6272018 0.7085754 1.0000000
Correlation Result Rounded to 2 decimal places
project1data_cor_r2 <- round(project1data_cor,2) #Rounding values to two decimal places
project1data_cor_r2 mse1 mse2 mse3 mse4
mse1 1.00 0.72 0.67 0.69
mse2 0.72 1.00 0.63 0.63
mse3 0.67 0.63 1.00 0.71
mse4 0.69 0.63 0.71 1.00