# 1. Comparison with 5 item score -----------------------------------------

Awards <- read.csv("comparison_score_v5.csv")
Awards
##    Year   X_Score  Y_Score
## 1  1987  6.527027 4.828947
## 2  1987  6.705752 4.952586
## 3  1987  5.899263 5.394366
## 4  1987  5.915493 4.664835
## 5  1987  6.894397 5.672269
## 6  1987  4.950495 2.850877
## 7  1987  4.975124 3.448276
## 8  1987  4.986877 3.755869
## 9  1987  4.788732 4.395604
## 10 1987  4.906542 3.361345
## 11 1987  3.106430 6.355263
## 12 1987  3.065646 6.683190
## 13 1987  3.207407 5.406103
## 14 1987  3.638655 5.769231
## 15 1987  2.980851 6.720588
## 16 1987  9.312639 5.186937
## 17 1987  9.846827 6.860619
## 18 1987  8.888889 4.420147
## 19 1987  8.403361 3.943662
## 20 1987 10.212766 6.034483
## 21 1988  2.793548 4.086022
## 22 1988  2.500000 4.166667
## 23 1988  2.706250 4.166667
## 24 1988  2.723270 3.983229
## 25 1988  2.752119 4.025424
## 26 1988  5.128205 6.984716
## 27 1988  5.084746 7.399577
## 28 1988  5.106383 7.383966
## 29 1988  5.530973 7.177215
## 30 1988  5.393258 7.462687
## 31 1988  9.475771 6.117904
## 32 1988  9.383795 6.342495
## 33 1988  9.383795 6.329114
## 34 1988  9.693833 6.329114
## 35 1988  9.581292 6.396588
Awards1987_v2 <- subset(Awards, Year=='1987')

Awards1987_v2
##    Year   X_Score  Y_Score
## 1  1987  6.527027 4.828947
## 2  1987  6.705752 4.952586
## 3  1987  5.899263 5.394366
## 4  1987  5.915493 4.664835
## 5  1987  6.894397 5.672269
## 6  1987  4.950495 2.850877
## 7  1987  4.975124 3.448276
## 8  1987  4.986877 3.755869
## 9  1987  4.788732 4.395604
## 10 1987  4.906542 3.361345
## 11 1987  3.106430 6.355263
## 12 1987  3.065646 6.683190
## 13 1987  3.207407 5.406103
## 14 1987  3.638655 5.769231
## 15 1987  2.980851 6.720588
## 16 1987  9.312639 5.186937
## 17 1987  9.846827 6.860619
## 18 1987  8.888889 4.420147
## 19 1987  8.403361 3.943662
## 20 1987 10.212766 6.034483
Awards1988_v2 <- subset(Awards, Year =='1988')
Awards1988_v2
##    Year  X_Score  Y_Score
## 21 1988 2.793548 4.086022
## 22 1988 2.500000 4.166667
## 23 1988 2.706250 4.166667
## 24 1988 2.723270 3.983229
## 25 1988 2.752119 4.025424
## 26 1988 5.128205 6.984716
## 27 1988 5.084746 7.399577
## 28 1988 5.106383 7.383966
## 29 1988 5.530973 7.177215
## 30 1988 5.393258 7.462687
## 31 1988 9.475771 6.117904
## 32 1988 9.383795 6.342495
## 33 1988 9.383795 6.329114
## 34 1988 9.693833 6.329114
## 35 1988 9.581292 6.396588
# Check for normal distribution

names(Awards)
## [1] "Year"    "X_Score" "Y_Score"
shapiro.test(Awards1987_v2$X_Score)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1987_v2$X_Score
## W = 0.92033, p-value = 0.1006
shapiro.test(Awards1988_v2$X_Score)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1988_v2$X_Score
## W = 0.81839, p-value = 0.006393
shapiro.test(Awards1987_v2$Y_Score)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1987_v2$Y_Score
## W = 0.96849, p-value = 0.7227
shapiro.test(Awards1988_v2$Y_Score)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1988_v2$Y_Score
## W = 0.81752, p-value = 0.006225
kruskal.test(Awards1987_v2$X_Score ~ Awards1987_v2$Y_Score, data = Awards1987_v2)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  Awards1987_v2$X_Score by Awards1987_v2$Y_Score
## Kruskal-Wallis chi-squared = 19, df = 19, p-value = 0.4568
kruskal.test(Awards1988_v2$X_Score ~ Awards1988_v2$Y_Score, data = Awards1988_v2)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  Awards1988_v2$X_Score by Awards1988_v2$Y_Score
## Kruskal-Wallis chi-squared = 13.668, df = 12, p-value = 0.3224
# 2. Convert to linear then use t test ----------------------------------------

library(reshape2)


Awards1987_v2
##    Year   X_Score  Y_Score
## 1  1987  6.527027 4.828947
## 2  1987  6.705752 4.952586
## 3  1987  5.899263 5.394366
## 4  1987  5.915493 4.664835
## 5  1987  6.894397 5.672269
## 6  1987  4.950495 2.850877
## 7  1987  4.975124 3.448276
## 8  1987  4.986877 3.755869
## 9  1987  4.788732 4.395604
## 10 1987  4.906542 3.361345
## 11 1987  3.106430 6.355263
## 12 1987  3.065646 6.683190
## 13 1987  3.207407 5.406103
## 14 1987  3.638655 5.769231
## 15 1987  2.980851 6.720588
## 16 1987  9.312639 5.186937
## 17 1987  9.846827 6.860619
## 18 1987  8.888889 4.420147
## 19 1987  8.403361 3.943662
## 20 1987 10.212766 6.034483
Awards1987_v2$X_Score_log <- log(Awards1987_v2$X_Score)
Awards1987_v2$Y_Score_log <- log(Awards1987_v2$Y_Score)

# Check for normal distribution

shapiro.test(Awards1987_v2$X_Score_log)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1987_v2$X_Score_log
## W = 0.93276, p-value = 0.1745
shapiro.test(Awards1987_v2$Y_Score_log)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1987_v2$Y_Score_log
## W = 0.95396, p-value = 0.4312
myvars <- c("Year", "X_Score_log", "Y_Score_log")
Awards1987_v2_log <- Awards1987_v2[myvars]
Awards1987_v2_log
##    Year X_Score_log Y_Score_log
## 1  1987    1.875952    1.574629
## 2  1987    1.902966    1.599910
## 3  1987    1.774827    1.685355
## 4  1987    1.777575    1.540052
## 5  1987    1.930709    1.735589
## 6  1987    1.599488    1.047627
## 7  1987    1.604450    1.237874
## 8  1987    1.606810    1.323320
## 9  1987    1.566266    1.480605
## 10 1987    1.590569    1.212341
## 11 1987    1.133474    1.849283
## 12 1987    1.120258    1.899595
## 13 1987    1.165463    1.687529
## 14 1987    1.291614    1.752539
## 15 1987    1.092209    1.905176
## 16 1987    2.231372    1.646143
## 17 1987    2.287149    1.925798
## 18 1987    2.184802    1.486173
## 19 1987    2.128632    1.372110
## 20 1987    2.323639    1.797490
Awards1987_v2_log_long <- melt(Awards1987_v2_log, id.vars=c("Year"))

Awards1987_v2_log_long
##    Year    variable    value
## 1  1987 X_Score_log 1.875952
## 2  1987 X_Score_log 1.902966
## 3  1987 X_Score_log 1.774827
## 4  1987 X_Score_log 1.777575
## 5  1987 X_Score_log 1.930709
## 6  1987 X_Score_log 1.599488
## 7  1987 X_Score_log 1.604450
## 8  1987 X_Score_log 1.606810
## 9  1987 X_Score_log 1.566266
## 10 1987 X_Score_log 1.590569
## 11 1987 X_Score_log 1.133474
## 12 1987 X_Score_log 1.120258
## 13 1987 X_Score_log 1.165463
## 14 1987 X_Score_log 1.291614
## 15 1987 X_Score_log 1.092209
## 16 1987 X_Score_log 2.231372
## 17 1987 X_Score_log 2.287149
## 18 1987 X_Score_log 2.184802
## 19 1987 X_Score_log 2.128632
## 20 1987 X_Score_log 2.323639
## 21 1987 Y_Score_log 1.574629
## 22 1987 Y_Score_log 1.599910
## 23 1987 Y_Score_log 1.685355
## 24 1987 Y_Score_log 1.540052
## 25 1987 Y_Score_log 1.735589
## 26 1987 Y_Score_log 1.047627
## 27 1987 Y_Score_log 1.237874
## 28 1987 Y_Score_log 1.323320
## 29 1987 Y_Score_log 1.480605
## 30 1987 Y_Score_log 1.212341
## 31 1987 Y_Score_log 1.849283
## 32 1987 Y_Score_log 1.899595
## 33 1987 Y_Score_log 1.687529
## 34 1987 Y_Score_log 1.752539
## 35 1987 Y_Score_log 1.905176
## 36 1987 Y_Score_log 1.646143
## 37 1987 Y_Score_log 1.925798
## 38 1987 Y_Score_log 1.486173
## 39 1987 Y_Score_log 1.372110
## 40 1987 Y_Score_log 1.797490
Awards1988_v2
##    Year  X_Score  Y_Score
## 21 1988 2.793548 4.086022
## 22 1988 2.500000 4.166667
## 23 1988 2.706250 4.166667
## 24 1988 2.723270 3.983229
## 25 1988 2.752119 4.025424
## 26 1988 5.128205 6.984716
## 27 1988 5.084746 7.399577
## 28 1988 5.106383 7.383966
## 29 1988 5.530973 7.177215
## 30 1988 5.393258 7.462687
## 31 1988 9.475771 6.117904
## 32 1988 9.383795 6.342495
## 33 1988 9.383795 6.329114
## 34 1988 9.693833 6.329114
## 35 1988 9.581292 6.396588
Awards1988_v2$X_Score_log <- log(Awards1988_v2$X_Score)
Awards1988_v2$Y_Score_log <- log(Awards1988_v2$Y_Score)

# Check for normal distribution

shapiro.test(Awards1988_v2$X_Score_log)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1988_v2$X_Score_log
## W = 0.83967, p-value = 0.01244
shapiro.test(Awards1988_v2$Y_Score_log)
## 
##  Shapiro-Wilk normality test
## 
## data:  Awards1988_v2$Y_Score_log
## W = 0.79064, p-value = 0.002795
myvars <- c("Year", "X_Score_log", "Y_Score_log")
Awards1988_v2_log <- Awards1988_v2[myvars]
Awards1988_v2_log
##    Year X_Score_log Y_Score_log
## 21 1988   1.0273126    1.407572
## 22 1988   0.9162907    1.427116
## 23 1988   0.9955639    1.427116
## 24 1988   1.0018335    1.382093
## 25 1988   1.0123710    1.392630
## 26 1988   1.6347557    1.943724
## 27 1988   1.6262450    2.001423
## 28 1988   1.6304913    1.999311
## 29 1988   1.7103638    1.970911
## 30 1988   1.6851497    2.009915
## 31 1988   2.2487381    1.811220
## 32 1988   2.2389843    1.847272
## 33 1988   2.2389843    1.845160
## 34 1988   2.2714899    1.845160
## 35 1988   2.2598124    1.855765
Awards1988_v2_log_long <- melt(Awards1988_v2_log, id.vars=c("Year"))

Awards1988_v2_log_long
##    Year    variable     value
## 1  1988 X_Score_log 1.0273126
## 2  1988 X_Score_log 0.9162907
## 3  1988 X_Score_log 0.9955639
## 4  1988 X_Score_log 1.0018335
## 5  1988 X_Score_log 1.0123710
## 6  1988 X_Score_log 1.6347557
## 7  1988 X_Score_log 1.6262450
## 8  1988 X_Score_log 1.6304913
## 9  1988 X_Score_log 1.7103638
## 10 1988 X_Score_log 1.6851497
## 11 1988 X_Score_log 2.2487381
## 12 1988 X_Score_log 2.2389843
## 13 1988 X_Score_log 2.2389843
## 14 1988 X_Score_log 2.2714899
## 15 1988 X_Score_log 2.2598124
## 16 1988 Y_Score_log 1.4075718
## 17 1988 Y_Score_log 1.4271164
## 18 1988 Y_Score_log 1.4271164
## 19 1988 Y_Score_log 1.3820927
## 20 1988 Y_Score_log 1.3926302
## 21 1988 Y_Score_log 1.9437244
## 22 1988 Y_Score_log 2.0014229
## 23 1988 Y_Score_log 1.9993109
## 24 1988 Y_Score_log 1.9709115
## 25 1988 Y_Score_log 2.0099155
## 26 1988 Y_Score_log 1.8112195
## 27 1988 Y_Score_log 1.8472722
## 28 1988 Y_Score_log 1.8451602
## 29 1988 Y_Score_log 1.8451602
## 30 1988 Y_Score_log 1.8557648
# Independent samples t-test

library(lsr)


independentSamplesTTest (formula = value ~ variable, data = Awards1987_v2_log_long)
## 
##    Welch's independent samples t-test 
## 
## Outcome variable:   value 
## Grouping variable:  variable 
## 
## Descriptive statistics: 
##             X_Score_log Y_Score_log
##    mean           1.709       1.588
##    std dev.       0.404       0.251
## 
## Hypotheses: 
##    null:        population means equal for both groups
##    alternative: different population means in each group
## 
## Test results: 
##    t-statistic:  1.142 
##    degrees of freedom:  31.713 
##    p-value:  0.262 
## 
## Other information: 
##    two-sided 95% confidence interval:  [-0.095, 0.338] 
##    estimated effect size (Cohen's d):  0.361
independentSamplesTTest (formula = value ~ variable, data = Awards1988_v2_log_long)
## 
##    Welch's independent samples t-test 
## 
## Outcome variable:   value 
## Grouping variable:  variable 
## 
## Descriptive statistics: 
##             X_Score_log Y_Score_log
##    mean           1.633       1.744
##    std dev.       0.534       0.255
## 
## Hypotheses: 
##    null:        population means equal for both groups
##    alternative: different population means in each group
## 
## Test results: 
##    t-statistic:  -0.728 
##    degrees of freedom:  20.066 
##    p-value:  0.475 
## 
## Other information: 
##    two-sided 95% confidence interval:  [-0.43, 0.207] 
##    estimated effect size (Cohen's d):  0.266