aloud <- dat$aloud_point
silent <- dat$silent_point
var.test(aloud, silent)
##
## F test to compare two variances
##
## data: aloud and silent
## F = 0.75717, num df = 27, denom df = 27, p-value = 0.4747
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
## 0.3503905 1.6362117
## sample estimates:
## ratio of variances
## 0.7571744
t.test(aloud, silent, alternative = "less", var.equal=TRUE)
##
## Two Sample t-test
##
## data: aloud and silent
## t = -0.73669, df = 54, p-value = 0.2322
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
## -Inf 0.3633522
## sample estimates:
## mean of x mean of y
## 5.500000 5.785714
mean_data <- dat %>%
summarise(silent_mean = mean(silent_point),
aloud_mean = mean(aloud_point))
plot_data <- data.frame(Method = c("Silent Point", "Aloud Point"),
Average_Point = c(mean_data$silent_mean, mean_data$aloud_mean))
graph <- ggplot(plot_data, aes(x = Method, y = Average_Point, fill = Method)) +
geom_bar(stat = "identity", width = 0.5) +
labs(x = "Reading Method", y = "Average Point") +
theme_minimal()+
ggtitle("Comparison of average reading score and silent reading score")
graph
comparison_boxplot <- ggplot(dat, aes(x = factor(1), y = aloud)) +
geom_boxplot(fill = "lightblue", color = "black") +
geom_boxplot(aes(x = factor(2), y = silent), fill = "lightgreen", color = "black") +
scale_x_discrete(labels = c("Aloud", "Silent")) +
ylab("Point") +
theme_minimal()+
ggtitle("Comparison of Aloud and Silent Reading Points")+
xlab("Method")
comparison_plotly <- ggplotly(comparison_boxplot)
comparison_plotly
sc <- ggplot(dat, aes(x = silent_point, y = aloud_point, color = gender)) +
geom_point() +
geom_abline(intercept = 0, slope = 1, linetype = "dashed") +
labs(x = "Silent Reading Score", y = "Aloud Reading Score", color = "Gender")
sc <- ggplotly(sc)
sc
各條柱的高度(y軸)表示該範圍內數據的出現頻率。頻率表示該範圍內的數據個數。在這種情況下,x軸表示”Point(分數)“,表示數據值的範圍。y軸值表示各範圍的頻率。
data <- data.frame(
Method = rep(c("Aloud", "Silent"), each = length(aloud)),
Point = c(aloud, silent)
)
plot <- ggplot(data, aes(x = Point, fill = Method)) +
geom_histogram(binwidth = 1, position = "identity", alpha = 0.5) +
labs(x = "Point", y = "Frequency", fill = "Method") +
theme_minimal()+
ggtitle("Frequency Distribution of Scores for Silent and Aloud Reading")
animation <- plot +
transition_states(Method, transition_length = 2, state_length = 1) +
enter_fade() +
exit_fade()
animate(animation)
這是一個按性別比較朗讀和默讀分數關係的Box Plot。
mean_data_g <- dat %>%
group_by(gender) %>%
summarise(silent_mean = mean(silent_point),
aloud_mean = mean(aloud_point))
gender_graph1 <- ggplot(mean_data_g, aes(x = gender, y = silent_mean, fill = gender)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x = "Gender", y = "Silent Point", fill = "Gender") +
theme_minimal()
gender_graph2 <- ggplot(mean_data_g, aes(x = gender, y = aloud_mean, fill = gender)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x = "Gender", y = "Aloud Point", fill = "Gender") +
theme_minimal()
gender_graph <- grid.arrange(gender_graph1, gender_graph2, nrow = 1)
gender_graph
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
這是一個按性別比較朗讀和默讀分數差異的Box Plot。通過Box Plot的位置和範圍,可以看出不同性別之間分數分佈和變異程度的差異。圖中使用不同顏色區分不同閱讀順序,可以比較不同閱讀順序之間的性別差異。閱讀順序(Reading order)的A是朗朗默默,B是默默朗朗
gender_plot <- ggplot(dat, aes(x = gender, y = silent_point - aloud_point, fill = module)) +
geom_boxplot() +
labs(x = "Gender", y = "Difference in Points (Silent - Aloud)", fill = "Reading order") +
theme_minimal()+
ggtitle("Relationship between Gender and Difference in Points (Silent - Aloud)") +
xlab("Gender") +
ylab("Difference in Points")
gender_plot_animated <- gender_plot +
transition_states(
states = module,
transition_length = 0.5,
state_length = 1
) +
enter_fade() +
exit_fade()
animate(gender_plot_animated)
這是比較每個閱讀順序(Reading order)的朗讀分數和默讀分數平均值的Bar Plot。閱讀順序(Reading order)的A是朗朗默默,B是默默朗朗
mean_data_o <- dat %>%
group_by(module) %>%
summarise(silent_mean = mean(silent_point),
aloud_mean = mean(aloud_point))
order_graph1 <- ggplot(mean_data_o, aes(x = module, y = silent_mean, fill = module)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x = "Reading Order", y = "Silent Point", fill = "Order") +
theme_minimal()
order_graph2 <- ggplot(mean_data_o, aes(x = module, y = aloud_mean, fill = module)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x = "Reading Order", y = "Aloud Point", fill = "Order") +
theme_minimal()
order_graph <- grid.arrange(order_graph1, order_graph2, nrow = 1)
order_graph
## TableGrob (1 x 2) "arrange": 2 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
這是一個按閱讀順序比較朗讀和默讀分數差異的Box Plot。通過Box Plot的位置和範圍,可以看出不同模組之間分數分佈和變異程度的差異。圖中使用不同顏色區分不同性別,可以比較不同性別之間的模組差異。閱讀順序(Reading order)的A是朗朗默默,B是默默朗朗
module_plot <- ggplot(dat, aes(x = module, y = silent_point - aloud_point, fill = gender)) +
geom_boxplot() +
labs(x = "Reading order", y = "Difference in Points (Silent - Aloud)", fill = "Gender") +
theme_minimal()+
ggtitle("Relationship between Reading order and Difference in Points (Silent - Aloud)") +
xlab("Reading order") +
ylab("Difference in Points")
module_plot_interactive <- ggplotly(module_plot)
module_plot_interactive
這是一個顯示考試所花時間與朗讀和默讀分數差異關係的Scatter Plot。每個數據點代表一個受測者,點的位置反映了時間和分數差異的關係。圖中使用不同顏色區分不同性別,可以比較不同性別之間時間和分數差異的關係。
convert_time <- function(time_str) {
time_components <- strsplit(time_str, "m")[[1]]
minutes <- as.numeric(time_components[1])
seconds <- as.numeric(sub("s", "", time_components[2]))
total_seconds <- minutes * 60 + seconds
return(total_seconds)
}
dat$time <- sapply(dat$time, convert_time)
time_plot <- ggplot(dat, aes(x = time, y = silent_point - aloud_point, color = gender)) +
geom_point() +
labs(x = "Time", y = "Difference in Points (Silent - Aloud)", color = "Gender") +
theme_minimal()+
ggtitle("Relationship between Time and Difference in Points (Silent - Aloud)") +
xlab("Time(seconds)") +
ylab("Difference in Points")
time_plot_interactive <- ggplotly(time_plot)
time_plot_interactive