packages = c("dplyr","ggplot2", "data.table", "scales", "tidytext","ltm")
existing = as.character(installed.packages()[,1])
for(pkg in packages[!(packages %in% existing)]) install.packages(pkg)require(dplyr)require(ggplot2)require(data.table)require(scales)require(wordcloud2)require(tidytext)require(ltm)TB = read.csv('data.csv')
TB$單因子組別= factor(TB$單因子組別)
TB$雙因子組別= factor(TB$雙因子組別)head(TB)# cronbach alpha
head(TB[6:9])cronbach.alpha(TB[6:9], CI=TRUE, standardized=TRUE)
Standardized Cronbach's alpha for the 'TB[6:9]' data-set
Items: 4
Sample units: 120
alpha: 0.655
Bootstrap 95% CI based on 1000 samples
2.5% 97.5%
0.513 0.753
new_tb <- data.frame(TB$沉浸感1,TB$沉浸感3,TB$沉浸感4)
head(new_tb)cronbach.alpha(new_tb,CI= TRUE, standardized = TRUE)
Standardized Cronbach's alpha for the 'new_tb' data-set
Items: 3
Sample units: 120
alpha: 0.7
Bootstrap 95% CI based on 1000 samples
2.5% 97.5%
0.569 0.781
# 根據上面cronbach.alpha的結果,拿掉沉浸感2
TB <- transform(TB, all_immer = (TB$沉浸感1 + TB$沉浸感3 + TB$沉浸感4)/3)
Result = aov(TB$all_immer~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 5.49 5.490 4.558 0.0348 *
Residuals 118 142.13 1.205
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 加總平均主題分數)
- 不切換場景與切換場景 -> 沉浸感
- 顯著差異: Pr(>F) 0.0348 * (0.01 ’*’)
boxplot(formula = TB$all_immer ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "沉浸感) -> 顯著性",
col = "gray")
ggplot(TB, aes(x = 單因子組別, y = all_immer)) + # Draw ggplot2 boxplot
geom_boxplot() +
stat_summary(fun = mean, geom = "point", col = "red") + # Add points to plot
stat_summary(fun = mean, geom = "text", col = "red", # Add text to plot
vjust = 1.5, aes(label = paste("Mean:", round(after_stat(y), digits = 1))))# cronbach alpha
head(TB[16:18])cronbach.alpha(TB[16:18], CI=TRUE, standardized=TRUE)
Standardized Cronbach's alpha for the 'TB[16:18]' data-set
Items: 3
Sample units: 120
alpha: 0.823
Bootstrap 95% CI based on 1000 samples
2.5% 97.5%
0.759 0.874
TB <- transform(TB, all_creative = (TB$想法數量 + TB$品質 + TB$創造力)/3)
Result = aov(TB$all_creative~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 5.49 5.490 5.482 0.0209 *
Residuals 118 118.18 1.001
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 加總平均主題分數)
- 不切換場景與切換場景 -> 創造力
- 顯著差異: Pr(>F) 0.0209 * (0.01 ’*’)
boxplot(formula = TB$all_creative ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "自我創造力) -> 顯著性",
col = "gray")
ggplot(TB, aes(x = 單因子組別, y = all_creative)) + # Draw ggplot2 boxplot
geom_boxplot() +
stat_summary(fun = mean, geom = "point", col = "red") + # Add points to plot
stat_summary(fun = mean, geom = "text", col = "red", # Add text to plot
vjust = 1.5, aes(label = paste("Mean:", round(after_stat(y), digits = 1))))Result = aov(TB$沉浸感1~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 0.53 0.5333 0.248 0.619
Residuals 118 253.83 2.1511
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 在進行VR頭腦風暴時,我可以像在現實世界中一樣與環境互動
- 不顯著: Pr(>F) 0.619
boxplot(formula = TB$沉浸感1 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我可以像在現實世界中一樣與環境互動",
col = "gray")Result = aov(TB$沉浸感2~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 22.53 22.533 14.49 0.000224 ***
Residuals 118 183.43 1.555
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 在進行VR頭腦風暴時,我感覺與外界隔絕
- 顯著: Pr(>F) 0.000224 *** (0 ’***’)
boxplot(formula = TB$沉浸感2 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我感覺與外界隔絕",
col = "gray")Result = aov(TB$沉浸感3~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 5.21 5.208 3.686 0.0573 .
Residuals 118 166.72 1.413
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 在進行VR頭腦風暴時,我完全沉浸其中
- 顯著: Pr(>F) 0.0573 . (0.05 ‘.’)
boxplot(formula = TB$沉浸感3 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我完全沉浸其中",
col = "gray")Result = aov(TB$沉浸感4~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 16.13 16.133 6.742 0.0106 *
Residuals 118 282.37 2.393
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 在進行VR頭腦風暴時,我忘記了我的日常煩惱
- 顯著: Pr(>F) 0.0106 * (0.01 ’*’)
boxplot(formula = TB$沉浸感4 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我忘記了我的日常煩惱",
col = "gray")Result = aov(TB$精神需求~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 4.8 4.800 3.506 0.0636 .
Residuals 118 161.6 1.369
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 精神需求
- 顯著: Pr(>F) 0.0636 . (0.05 ‘.’)
boxplot(formula = TB$精神需求 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "精神需求",
col = "gray")Result = aov(TB$體力需求~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 0.1 0.075 0.026 0.871
Residuals 118 335.9 2.846
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 體力需求
- 不顯著: Pr(>F) 0.871
boxplot(formula = TB$體力需求 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "體力需求",
col = "gray")
Result = aov(TB$時間壓力~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 2.7 2.700 1.168 0.282
Residuals 118 272.8 2.312
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 時間壓力
- 不顯著: Pr(>F) 0.282
boxplot(formula = TB$時間壓力 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "時間壓力",
col = "gray")Result = aov(TB$成功~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 1.01 1.008 0.784 0.378
Residuals 118 151.78 1.286
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 成功
- 不顯著: Pr(>F) 0.378
boxplot(formula = TB$成功 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "成功",
col = "gray")
Result = aov(TB$努力~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 4.03 4.033 3.89 0.0509 .
Residuals 118 122.33 1.037
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 努力
- 顯著: Pr(>F) 0.0509 . (0.05 ‘.’)
boxplot(formula = TB$努力 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "努力",
col = "gray")Result = aov(TB$不安~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 3.01 3.008 1.226 0.27
Residuals 118 289.58 2.454
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 不安
- 不顯著: Pr(>F) 0.27
boxplot(formula = TB$不安 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "不安",
col = "gray")Result = aov(TB$想法數量~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 4.03 4.033 2.713 0.102
Residuals 118 175.43 1.487
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 想法數量
- 不顯著: Pr(>F) 0.102
boxplot(formula = TB$想法數量 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "想法數量",
col = "gray")Result = aov(TB$品質~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 6.08 6.075 5.518 0.0205 *
Residuals 118 129.92 1.101
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 想法品質
- 顯著: Pr(>F) 0.0205 * (0.01 ’*’)
boxplot(formula = TB$品質 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "品質",
col = "gray")Result = aov(TB$創造力~TB$單因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$單因子組別 1 6.53 6.533 4.249 0.0415 *
Residuals 118 181.43 1.538
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (單因子分析: 各項題目)
- 不切換場景與切換場景 -> 創造力
- 顯著: Pr(>F) 0.0415 * ( 0.01 ’*’)
boxplot(formula = TB$創造力 ~TB$單因子組別,
data =TB,
xlab = "組別",
ylab = "創造力",
col = "gray")NC -> 不切換場景 + 電子鐘 NB -> 不切換場景 + 炸彈 SC -> 切換場景 + 電子鐘 SB -> 切換場景 + 炸彈
# cronbach alpha
head(TB[6:9])cronbach.alpha(TB[6:9], CI=TRUE, standardized=TRUE)
Standardized Cronbach's alpha for the 'TB[6:9]' data-set
Items: 4
Sample units: 120
alpha: 0.655
Bootstrap 95% CI based on 1000 samples
2.5% 97.5%
0.515 0.754
new_tb <- data.frame(TB$沉浸感1,TB$沉浸感3,TB$沉浸感4)
head(new_tb)cronbach.alpha(new_tb,CI= TRUE, standardized = TRUE)
Standardized Cronbach's alpha for the 'new_tb' data-set
Items: 3
Sample units: 120
alpha: 0.7
Bootstrap 95% CI based on 1000 samples
2.5% 97.5%
0.563 0.787
# 根據上面cronbach.alpha的結果,拿掉沉浸感2
TB <- transform(TB, all_immer = (TB$沉浸感1 + TB$沉浸感3 + TB$沉浸感4)/3)
Result = aov(TB$all_immer~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 6.17 2.055 1.685 0.174
Residuals 116 141.46 1.219
- 結果: One-way Anova (雙因子分析: 加總平均主題分數)
- 不切換場景、切換場景、炸彈、電子鐘 -> 沉浸感
- 不顯著: Pr(>F) 0.174
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$all_immer ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.1555556 -0.8987810 0.5876699 0.9475692
SB-NB 0.4222222 -0.3210033 1.1654477 0.4523339
SC-NB 0.2777778 -0.4654477 1.0210033 0.7643641
SB-NC 0.5777778 -0.1654477 1.3210033 0.1842976
SC-NC 0.4333333 -0.3098922 1.1765588 0.4290363
SC-SB -0.1444444 -0.8876699 0.5987810 0.9573703
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$all_immer ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "沉浸感) -> 顯著性",
col = "gray")
ggplot(TB, aes(x = 雙因子組別, y = all_immer)) + # Draw ggplot2 boxplot
geom_boxplot() +
stat_summary(fun = mean, geom = "point", col = "red") + # Add points to plot
stat_summary(fun = mean, geom = "text", col = "red", # Add text to plot
vjust = 1.5, aes(label = paste("Mean:", round(after_stat(y), digits = 1))))NA
NA
NATB <- transform(TB, all_creative = (TB$想法數量 + TB$品質 + TB$創造力)/3)
Result = aov(TB$all_creative~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 6.11 2.038 2.011 0.116
Residuals 116 117.55 1.013
- 結果: One-way Anova (雙因子分析: 加總平均主題分數)
- 不切換場景、切換場景、炸彈、電子鐘 -> 創造力
- 不顯著: Pr(>F) 0.116
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$all_creative ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.1777778 -0.8553028 0.4997472 0.9030170
SB-NB 0.3888889 -0.2886361 1.0664139 0.4431012
SC-NB 0.2888889 -0.3886361 0.9664139 0.6832345
SB-NC 0.5666667 -0.1108583 1.2441917 0.1348794
SC-NC 0.4666667 -0.2108583 1.1441917 0.2807724
SC-SB -0.1000000 -0.7775250 0.5775250 0.9805459
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$all_creative ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "自我創造力) -> 顯著性",
col = "gray")
ggplot(TB, aes(x = 雙因子組別, y = all_creative)) + # Draw ggplot2 boxplot
geom_boxplot() +
stat_summary(fun = mean, geom = "point", col = "red") + # Add points to plot
stat_summary(fun = mean, geom = "text", col = "red", # Add text to plot
vjust = 1.5, aes(label = paste("Mean:", round(after_stat(y), digits = 1))))NA
NAResult = aov(TB$沉浸感1~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 1.1 0.3667 0.168 0.918
Residuals 116 253.3 2.1833
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> -> 在進行VR頭腦風暴時,我可以像在現實世界中一樣與環境互動
- 不顯著: Pr(>F) 0.918
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$沉浸感1 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB 1.000000e-01 -0.8944881 1.0944881 0.9936597
SB-NB 2.666667e-01 -0.7278215 1.2611548 0.8972857
SC-NB 1.000000e-01 -0.8944881 1.0944881 0.9936597
SB-NC 1.666667e-01 -0.8278215 1.1611548 0.9719785
SC-NC 1.776357e-15 -0.9944881 0.9944881 1.0000000
SC-SB -1.666667e-01 -1.1611548 0.8278215 0.9719785
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$沉浸感1 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我可以像在現實世界中一樣與環境互動",
col = "gray")Result = aov(TB$沉浸感2~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 22.83 7.611 4.821 0.00336 **
Residuals 116 183.13 1.579
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 在進行VR頭腦風暴時,我感覺與外界隔絕
- 顯著: Pr(>F) 0.00336 ** (0.001 ’**’)
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$沉浸感2 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB 0.1000000 -0.74565708 0.9456571 0.9897915
SB-NB 0.9666667 0.12100959 1.8123237 0.0182147
SC-NB 0.8666667 0.02100959 1.7123237 0.0423448
SB-NC 0.8666667 0.02100959 1.7123237 0.0423448
SC-NC 0.7666667 -0.07899041 1.6123237 0.0900841
SC-SB -0.1000000 -0.94565708 0.7456571 0.9897915
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$沉浸感2 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我感覺與外界隔絕",
col = "gray")Result = aov(TB$沉浸感3~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 7.76 2.586 1.827 0.146
Residuals 116 164.17 1.415
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 在進行VR頭腦風暴時,我完全沉浸其中
- 不顯著: Pr(>F) 0.146
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$沉浸感3 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.4000000 -1.2006691 0.4006691 0.5633784
SB-NB 0.2666667 -0.5340025 1.0673358 0.8212559
SC-NB 0.1666667 -0.6340025 0.9673358 0.9483579
SB-NC 0.6666667 -0.1340025 1.4673358 0.1376779
SC-NC 0.5666667 -0.2340025 1.3673358 0.2578586
SC-SB -0.1000000 -0.9006691 0.7006691 0.9880224
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$沉浸感3 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我完全沉浸其中",
col = "gray")Result = aov(TB$沉浸感4~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 16.97 5.656 2.33 0.078 .
Residuals 116 281.53 2.427
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 在進行VR頭腦風暴時,我忘記了我的日常煩惱
- 顯著: Pr(>F) 0.078 . (0.05 ‘.’)
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$沉浸感4 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.1666667 -1.2151837 0.8818504 0.9759169
SB-NB 0.7333333 -0.3151837 1.7818504 0.2677889
SC-NB 0.5666667 -0.4818504 1.6151837 0.4964747
SB-NC 0.9000000 -0.1485171 1.9485171 0.1193105
SC-NC 0.7333333 -0.3151837 1.7818504 0.2677889
SC-SB -0.1666667 -1.2151837 0.8818504 0.9759169
plot(TukeyHSD(Result),las=1)
boxplot(formula = TB$沉浸感4 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "在進行VR頭腦風暴時,我忘記了我的日常煩惱",
col = "gray")Result = aov(TB$精神需求~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 5.37 1.789 1.289 0.282
Residuals 116 161.00 1.388
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 精神需求
- 不顯著: Pr(>F) 0.282
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$精神需求 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.1000000 -0.8929093 0.6929093 0.9876771
SB-NB 0.4333333 -0.3595760 1.2262427 0.4866914
SC-NB 0.2666667 -0.5262427 1.0595760 0.8169323
SB-NC 0.5333333 -0.2595760 1.3262427 0.3012427
SC-NC 0.3666667 -0.4262427 1.1595760 0.6246785
SC-SB -0.1666667 -0.9595760 0.6262427 0.9469420
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$精神需求 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "精神需求",
col = "gray")
Result = aov(TB$體力需求~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 0.6 0.1861 0.064 0.979
Residuals 116 335.4 2.8911
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 體力需求
- 不顯著: Pr(>F) 0.979
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$體力需求 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB 1.666667e-01 -0.9777141 1.3110474 0.9812817
SB-NB 6.666667e-02 -1.0777141 1.2110474 0.9987454
SC-NB 1.776357e-15 -1.1443807 1.1443807 1.0000000
SB-NC -1.000000e-01 -1.2443807 1.0443807 0.9958121
SC-NC -1.666667e-01 -1.3110474 0.9777141 0.9812817
SC-SB -6.666667e-02 -1.2110474 1.0777141 0.9987454
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$體力需求 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "體力需求",
col = "gray")Result = aov(TB$時間壓力~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 4.2 1.400 0.599 0.617
Residuals 116 271.3 2.338
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 時間壓力
- 不顯著: Pr(>F) 0.617
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$時間壓力 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB 0.1 -0.9292214 1.1292214 0.9942702
SB-NB 0.5 -0.5292214 1.5292214 0.5861367
SC-NB 0.2 -0.8292214 1.2292214 0.9573866
SB-NC 0.4 -0.6292214 1.4292214 0.7421292
SC-NC 0.1 -0.9292214 1.1292214 0.9942702
SC-SB -0.3 -1.3292214 0.7292214 0.8722848
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$時間壓力 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "時間壓力",
col = "gray")Result = aov(TB$成功~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 6.09 2.031 1.606 0.192
Residuals 116 146.70 1.265
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 成功
- 不顯著: Pr(>F) 0.192
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$成功 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.13333333 -0.8902109 0.6235443 0.9677003
SB-NB 0.03333333 -0.7235443 0.7902109 0.9994559
SC-NB -0.53333333 -1.2902109 0.2235443 0.2615121
SB-NC 0.16666667 -0.5902109 0.9235443 0.9396616
SC-NC -0.40000000 -1.1568776 0.3568776 0.5159010
SC-SB -0.56666667 -1.3235443 0.1902109 0.2125795
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$成功 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "成功",
col = "gray")
Result = aov(TB$努力~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 5.97 1.989 1.916 0.131
Residuals 116 120.40 1.038
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 努力
- 不顯著: Pr(>F) 0.131
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$努力 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.3333333 -1.01901705 0.3523504 0.5855937
SB-NB 0.2666667 -0.41901705 0.9523504 0.7417309
SC-NB 0.1333333 -0.55235038 0.8190170 0.9573056
SB-NC 0.6000000 -0.08568371 1.2856837 0.1084581
SC-NC 0.4666667 -0.21901705 1.1523504 0.2910509
SC-SB -0.1333333 -0.81901705 0.5523504 0.9573056
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$努力 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "努力",
col = "gray")Result = aov(TB$不安~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 7.43 2.475 1.007 0.392
Residuals 116 285.17 2.458
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 不安
- 不顯著: Pr(>F) 0.392
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$不安 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.5333333 -1.588595 0.5219279 0.5537753
SB-NB -0.5333333 -1.588595 0.5219279 0.5537753
SC-NB -0.6333333 -1.688595 0.4219279 0.4029462
SB-NC 0.0000000 -1.055261 1.0552612 1.0000000
SC-NC -0.1000000 -1.155261 0.9552612 0.9946776
SC-SB -0.1000000 -1.155261 0.9552612 0.9946776
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$不安 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "不安",
col = "gray")Result = aov(TB$想法數量~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 7.0 2.333 1.569 0.201
Residuals 116 172.5 1.487
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 想法數量
- 不顯著: Pr(>F) 0.201
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$想法數量 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.4333333 -1.2539932 0.3873265 0.5166459
SB-NB 0.2000000 -0.6206598 1.0206598 0.9204289
SC-NB 0.1000000 -0.7206598 0.9206598 0.9888549
SB-NC 0.6333333 -0.1873265 1.4539932 0.1896463
SC-NC 0.5333333 -0.2873265 1.3539932 0.3314946
SC-SB -0.1000000 -0.9206598 0.7206598 0.9888549
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$想法數量 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "想法數量",
col = "gray")Result = aov(TB$品質~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 6.49 2.164 1.938 0.127
Residuals 116 129.50 1.116
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 想法品質
- 不顯著: Pr(>F) 0.127
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$品質 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB -0.1333333 -0.8444576 0.5777909 0.9614651
SB-NB 0.4333333 -0.2777909 1.1444576 0.3892237
SC-NB 0.3333333 -0.3777909 1.0444576 0.6142971
SB-NC 0.5666667 -0.1444576 1.2777909 0.1667158
SC-NC 0.4666667 -0.2444576 1.1777909 0.3228791
SC-SB -0.1000000 -0.8111242 0.6111242 0.9830876
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$品質 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "品質",
col = "gray")Result = aov(TB$創造力~TB$雙因子組別)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$雙因子組別 3 6.7 2.233 1.429 0.238
Residuals 116 181.3 1.563
- 結果: One-way Anova (雙因子分析: 各項題目)
- 不切換場景、切換場景、炸彈、電子鐘 -> 創造力
- 不顯著: Pr(>F) 0.238
TukeyHSD(Result) Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = TB$創造力 ~ TB$雙因子組別)
$`TB$雙因子組別`
diff lwr upr p adj
NC-NB 0.03333333 -0.8080028 0.8746695 0.9996034
SB-NB 0.53333333 -0.3080028 1.3746695 0.3536891
SC-NB 0.43333333 -0.4080028 1.2746695 0.5378950
SB-NC 0.50000000 -0.3413362 1.3413362 0.4118208
SC-NC 0.40000000 -0.4413362 1.2413362 0.6032619
SC-SB -0.10000000 -0.9413362 0.7413362 0.9896372
plot(TukeyHSD(Result),las=1)boxplot(formula = TB$創造力 ~TB$雙因子組別,
data =TB,
xlab = "組別",
ylab = "創造力",
col = "gray")TB$time= factor(TB$time)
p <- ggplot(data =TB, aes(x = like,fill = time)) + geom_bar(position = "dodge")
p炸彈 B、電子鐘C -> 喜歡程度 1-7分 分布圖
var.test(TB$like~TB$time, data = TB) #函數 var.test()進行變異數同質性檢定
F test to compare two variances
data: TB$like by TB$time
F = 1.0481, num df = 59, denom df = 59, p-value = 0.8576
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.626026 1.754574
sample estimates:
ratio of variances
1.04805
# 炸彈 和 電子鐘 差異程度
t.test(TB$like~TB$time , var.equal = TRUE,data = TB) # t.test 結果顯示雙尾 TWO sample t-test , p-value 要小於0.05 才有顯著差異
Two Sample t-test
data: TB$like by TB$time
t = 0.42491, df = 118, p-value = 0.6717
alternative hypothesis: true difference in means between group B and group C is not equal to 0
95 percent confidence interval:
-0.3660421 0.5660421
sample estimates:
mean in group B mean in group C
4.833333 4.733333
炸彈 B、電子鐘C -> 喜歡程度 t-test 不顯著 p-value = 0.6717
boxplot(formula = TB$like~TB$time,
data =TB,
xlab = "組別",
ylab = "喜歡程度。",
col = "gray")NA
NAt.test(TB$like~TB$time , var.equal = TRUE,alt= "greater",data = TB) # 單尾檢定
Two Sample t-test
data: TB$like by TB$time
t = 0.42491, df = 118, p-value = 0.3358
alternative hypothesis: true difference in means between group B and group C is greater than 0
95 percent confidence interval:
-0.2901671 Inf
sample estimates:
mean in group B mean in group C
4.833333 4.733333
Result = aov(TB$like~TB$time)
summary(Result) Df Sum Sq Mean Sq F value Pr(>F)
TB$time 1 0.3 0.300 0.181 0.672
Residuals 118 196.1 1.662