#Import data

read.csv("R.csv") #All students N=65
##     ID    username    feedback ITS pre_test_type post_test_type class
## 1    1      gocola      effort  12             B              A     1
## 2    4      goniku      effort  12             B              A     1
## 3    5      gosoba      effort  12             B              A     1
## 4    7    gotamago      effort  12             B              A     1
## 5    8      gotofu      effort  10             B              A     1
## 6   28     yescola      effort  12             A              B     1
## 7   29     yesfugu      effort  12             A              B     1
## 8   30     yesmiso      effort  12             A              B     1
## 9   31     yesniku      effort  12             A              B     1
## 10  33    yessushi      effort  12             A              B     1
## 11  34   yestamago      effort  12             A              B     1
## 12  35     yestofu      effort  12             A              B     1
## 13  37     gogyoza      effort  12             B              A     2
## 14  38       goika      effort  12             B              A     2
## 15  39      gokaki      effort  12             B              A     2
## 16  40   goonigiri      effort  12             B              A     2
## 17  41     goramen      effort  12             B              A     2
## 18  42    gosakana      effort  12             B              A     2
## 19  43      gotako      effort  12             B              A     2
## 20  44     gounagi      effort  12             B              A     2
## 21  45      goyuba      effort  12             B              A     2
## 22  69   yessakana      effort  12             A              B     2
## 23  74       goimo      effort  12             B              A     3
## 24  75      gonabe      effort  12             B              A     3
## 25  76    gonigiri      effort  12             B              A     3
## 26  77      goocha      effort  12             B              A     3
## 27  79     gosomen      effort  12             B              A     3
## 28 100      yesice      effort  12             A              B     3
## 29 101      yesimo      effort  12             A              B     3
## 30 102     yesnabe      effort  12             A              B     3
## 31 103   yesnigiri      effort  12             A              B     3
## 32 105     yessake      effort  12             A              B     3
## 33 106    yessomen      effort  12             A              B     3
## 34 107  yestaiyaki      effort  12             A              B     3
## 35  10    nicecola performance  11             A              B     1
## 36  12    nicemiso performance  12             A              B     1
## 37  13    niceniku performance  12             A              B     1
## 38  15   nicesushi performance  12             A              B     1
## 39  16  nicetamago performance  12             A              B     1
## 40  20      okfugu performance  12             B              A     1
## 41  21      okmiso performance  12             B              A     1
## 42  23      oksoba performance  12             B              A     1
## 43  25    oktamago performance  12             B              A     1
## 44  26      oktofu performance  12             B              A     1
## 45  27      okudon performance  12             B              A     1
## 46  46   nicegyoza performance  12             A              B     2
## 47  48    nicekaki performance  12             A              B     2
## 48  49 niceonigiri performance  12             A              B     2
## 49  50   niceramen performance  12             A              B     2
## 50  51  nicesakana performance  12             A              B     2
## 51  52    nicetako performance  12             A              B     2
## 52  53   niceunagi performance  12             A              B     2
## 53  54    niceyuba performance  12             A              B     2
## 54  56       okika performance  12             B              A     2
## 55  57      okkaki performance  12             B              A     2
## 56  58   okonigiri performance  12             B              A     2
## 57  62     okunagi performance  12             B              A     2
## 58  63      okyuba performance  12             B              A     2
## 59  82     niceice performance  12             A              B     3
## 60  83     niceimo performance  12             A              B     3
## 61  87    nicesake performance  12             A              B     3
## 62  91       okice performance  12             B              A     3
## 63  93      oknabe performance  12             B              A     3
## 64  96      oksake performance  12             B              A     3
## 65  98   oktaiyaki performance  12             B              A     3
##    PreTest_Total_Score PostTest_Total_Score Post_Pre Intrinsic_Value
## 1                   14                   14        0              15
## 2                   13                   12       -1              10
## 3                    4                    6        2               6
## 4                    3                    9        6              10
## 5                   10                    8       -2              13
## 6                   13                   14        1              11
## 7                    9                   11        2               8
## 8                   12                   14        2              14
## 9                   12                   11       -1               8
## 10                  11                   11        0              15
## 11                   4                    3       -1               6
## 12                   3                   10        7               9
## 13                   3                    3        0               6
## 14                  14                   14        0              15
## 15                   9                    4       -5              15
## 16                  11                   12        1              13
## 17                   2                    1       -1              11
## 18                  14                   14        0              14
## 19                  13                   13        0              12
## 20                   5                    8        3               8
## 21                  12                   12        0              13
## 22                   8                   11        3               5
## 23                  11                    3       -8               5
## 24                   8                    6       -2              10
## 25                  10                   12        2              13
## 26                  12                   10       -2              15
## 27                   5                   10        5               8
## 28                   9                    6       -3               9
## 29                  13                   13        0              11
## 30                   7                    2       -5              12
## 31                  13                   13        0              13
## 32                  12                   14        2              15
## 33                   1                    0       -1               6
## 34                  14                   13       -1              12
## 35                   9                   11        2              13
## 36                   9                    9        0              11
## 37                   1                   14       13              14
## 38                   8                    8        0              11
## 39                   3                    3        0               9
## 40                  13                   13        0              13
## 41                  11                   14        3              12
## 42                   5                    9        4              14
## 43                   3                    4        1               7
## 44                  11                   14        3               7
## 45                  10                   12        2              12
## 46                   5                    2       -3              10
## 47                  12                   13        1              15
## 48                   8                   11        3              15
## 49                  11                   13        2               7
## 50                  14                   14        0              11
## 51                   2                    3        1               8
## 52                  13                   12       -1              13
## 53                   3                   12        9               7
## 54                  11                   13        2              14
## 55                  13                   14        1              13
## 56                  11                   10       -1               9
## 57                  12                   12        0               7
## 58                  12                    6       -6              11
## 59                   3                    1       -2               4
## 60                   2                   13       11               3
## 61                  12                   12        0              12
## 62                   8                   12        4              12
## 63                   5                    8        3              13
## 64                  11                   13        2              11
## 65                  14                   14        0               8
##    Self.regulation Self.efficacy Test_anxiety Survey_Total_Score
## 1               19            20           14                 68
## 2               16            13            8                 47
## 3               11            12            7                 36
## 4               15            12            9                 46
## 5               16            17           15                 61
## 6               16            11            4                 42
## 7               11             9           15                 43
## 8               20            19           16                 69
## 9               13            12            8                 41
## 10              16            17           13                 61
## 11              12            11            7                 36
## 12              13            14           14                 50
## 13              15             6            4                 31
## 14              20            20            6                 61
## 15              18            14           12                 59
## 16              19            17            5                 54
## 17              16            16            4                 47
## 18              18            20           17                 69
## 19              11            16           10                 49
## 20              11            12            8                 39
## 21              13            20           20                 66
## 22              15            11            7                 38
## 23              10             6            6                 27
## 24              11             9           14                 44
## 25              16            15           12                 56
## 26              15            13            7                 50
## 27              14             7            7                 36
## 28               8             7           12                 36
## 29              11            16           14                 52
## 30              18            17           15                 62
## 31              16            16           15                 60
## 32              14            18           18                 65
## 33               9             9            9                 33
## 34              16            18           17                 63
## 35              18            16           15                 62
## 36              15            15           16                 57
## 37              17            17           15                 63
## 38              15            15            4                 45
## 39              13            10            8                 40
## 40              18            19           17                 67
## 41              15            12           12                 51
## 42              13            11            5                 43
## 43              14            13            9                 43
## 44              14            11           13                 45
## 45              14            11           12                 49
## 46              16            11            4                 41
## 47              16            18           15                 64
## 48              17            16           17                 65
## 49              14             8            7                 36
## 50              16            17           13                 57
## 51               7             5            5                 25
## 52              14            18           16                 61
## 53              13            12           13                 45
## 54              18            20           14                 66
## 55              19            18           10                 60
## 56              14            12            9                 44
## 57              14            12            7                 40
## 58              13            12           17                 53
## 59              17            11            4                 36
## 60              11             4            5                 23
## 61              19            15            8                 54
## 62              14            17           14                 57
## 63              17            15           16                 61
## 64              11            13           11                 46
## 65               7             5            8                 28
read.csv("effort.csv") #Only effort group N=34
##     ID   username feedback ITS pre_test_type post_test_type class
## 1    1     gocola   effort  12             B              A     1
## 2    4     goniku   effort  12             B              A     1
## 3    5     gosoba   effort  12             B              A     1
## 4    7   gotamago   effort  12             B              A     1
## 5    8     gotofu   effort  10             B              A     1
## 6   28    yescola   effort  12             A              B     1
## 7   29    yesfugu   effort  12             A              B     1
## 8   30    yesmiso   effort  12             A              B     1
## 9   31    yesniku   effort  12             A              B     1
## 10  33   yessushi   effort  12             A              B     1
## 11  34  yestamago   effort  12             A              B     1
## 12  35    yestofu   effort  12             A              B     1
## 13  37    gogyoza   effort  12             B              A     2
## 14  38      goika   effort  12             B              A     2
## 15  39     gokaki   effort  12             B              A     2
## 16  40  goonigiri   effort  12             B              A     2
## 17  41    goramen   effort  12             B              A     2
## 18  42   gosakana   effort  12             B              A     2
## 19  43     gotako   effort  12             B              A     2
## 20  44    gounagi   effort  12             B              A     2
## 21  45     goyuba   effort  12             B              A     2
## 22  69  yessakana   effort  12             A              B     2
## 23  74      goimo   effort  12             B              A     3
## 24  75     gonabe   effort  12             B              A     3
## 25  76   gonigiri   effort  12             B              A     3
## 26  77     goocha   effort  12             B              A     3
## 27  79    gosomen   effort  12             B              A     3
## 28 100     yesice   effort  12             A              B     3
## 29 101     yesimo   effort  12             A              B     3
## 30 102    yesnabe   effort  12             A              B     3
## 31 103  yesnigiri   effort  12             A              B     3
## 32 105    yessake   effort  12             A              B     3
## 33 106   yessomen   effort  12             A              B     3
## 34 107 yestaiyaki   effort  12             A              B     3
##    PreTest_Total_Score PostTest_Total_Score Post_Pre Intrinsic_Value
## 1                   14                   14        0              15
## 2                   13                   12       -1              10
## 3                    4                    6        2               6
## 4                    3                    9        6              10
## 5                   10                    8       -2              13
## 6                   13                   14        1              11
## 7                    9                   11        2               8
## 8                   12                   14        2              14
## 9                   12                   11       -1               8
## 10                  11                   11        0              15
## 11                   4                    3       -1               6
## 12                   3                   10        7               9
## 13                   3                    3        0               6
## 14                  14                   14        0              15
## 15                   9                    4       -5              15
## 16                  11                   12        1              13
## 17                   2                    1       -1              11
## 18                  14                   14        0              14
## 19                  13                   13        0              12
## 20                   5                    8        3               8
## 21                  12                   12        0              13
## 22                   8                   11        3               5
## 23                  11                    3       -8               5
## 24                   8                    6       -2              10
## 25                  10                   12        2              13
## 26                  12                   10       -2              15
## 27                   5                   10        5               8
## 28                   9                    6       -3               9
## 29                  13                   13        0              11
## 30                   7                    2       -5              12
## 31                  13                   13        0              13
## 32                  12                   14        2              15
## 33                   1                    0       -1               6
## 34                  14                   13       -1              12
##    Self.regulation Self.efficacy Test_anxiety Survey_Total_Score
## 1               19            20           14                 68
## 2               16            13            8                 47
## 3               11            12            7                 36
## 4               15            12            9                 46
## 5               16            17           15                 61
## 6               16            11            4                 42
## 7               11             9           15                 43
## 8               20            19           16                 69
## 9               13            12            8                 41
## 10              16            17           13                 61
## 11              12            11            7                 36
## 12              13            14           14                 50
## 13              15             6            4                 31
## 14              20            20            6                 61
## 15              18            14           12                 59
## 16              19            17            5                 54
## 17              16            16            4                 47
## 18              18            20           17                 69
## 19              11            16           10                 49
## 20              11            12            8                 39
## 21              13            20           20                 66
## 22              15            11            7                 38
## 23              10             6            6                 27
## 24              11             9           14                 44
## 25              16            15           12                 56
## 26              15            13            7                 50
## 27              14             7            7                 36
## 28               8             7           12                 36
## 29              11            16           14                 52
## 30              18            17           15                 62
## 31              16            16           15                 60
## 32              14            18           18                 65
## 33               9             9            9                 33
## 34              16            18           17                 63
read.csv("performance.csv") #Only performance group N=31
##    ID    username    feedback ITS pre_test_type post_test_type class
## 1  10    nicecola performance  11             A              B     1
## 2  12    nicemiso performance  12             A              B     1
## 3  13    niceniku performance  12             A              B     1
## 4  15   nicesushi performance  12             A              B     1
## 5  16  nicetamago performance  12             A              B     1
## 6  20      okfugu performance  12             B              A     1
## 7  21      okmiso performance  12             B              A     1
## 8  23      oksoba performance  12             B              A     1
## 9  25    oktamago performance  12             B              A     1
## 10 26      oktofu performance  12             B              A     1
## 11 27      okudon performance  12             B              A     1
## 12 46   nicegyoza performance  12             A              B     2
## 13 48    nicekaki performance  12             A              B     2
## 14 49 niceonigiri performance  12             A              B     2
## 15 50   niceramen performance  12             A              B     2
## 16 51  nicesakana performance  12             A              B     2
## 17 52    nicetako performance  12             A              B     2
## 18 53   niceunagi performance  12             A              B     2
## 19 54    niceyuba performance  12             A              B     2
## 20 56       okika performance  12             B              A     2
## 21 57      okkaki performance  12             B              A     2
## 22 58   okonigiri performance  12             B              A     2
## 23 62     okunagi performance  12             B              A     2
## 24 63      okyuba performance  12             B              A     2
## 25 82     niceice performance  12             A              B     3
## 26 83     niceimo performance  12             A              B     3
## 27 87    nicesake performance  12             A              B     3
## 28 91       okice performance  12             B              A     3
## 29 93      oknabe performance  12             B              A     3
## 30 96      oksake performance  12             B              A     3
## 31 98   oktaiyaki performance  12             B              A     3
##    PreTest_Total_Score PostTest_Total_Score Post_Pre Intrinsic_Value
## 1                    9                   11        2              13
## 2                    9                    9        0              11
## 3                    1                   14       13              14
## 4                    8                    8        0              11
## 5                    3                    3        0               9
## 6                   13                   13        0              13
## 7                   11                   14        3              12
## 8                    5                    9        4              14
## 9                    3                    4        1               7
## 10                  11                   14        3               7
## 11                  10                   12        2              12
## 12                   5                    2       -3              10
## 13                  12                   13        1              15
## 14                   8                   11        3              15
## 15                  11                   13        2               7
## 16                  14                   14        0              11
## 17                   2                    3        1               8
## 18                  13                   12       -1              13
## 19                   3                   12        9               7
## 20                  11                   13        2              14
## 21                  13                   14        1              13
## 22                  11                   10       -1               9
## 23                  12                   12        0               7
## 24                  12                    6       -6              11
## 25                   3                    1       -2               4
## 26                   2                   13       11               3
## 27                  12                   12        0              12
## 28                   8                   12        4              12
## 29                   5                    8        3              13
## 30                  11                   13        2              11
## 31                  14                   14        0               8
##    Self.regulation Self.efficacy Test_anxiety Survey_Total_Score
## 1               18            16           15                 62
## 2               15            15           16                 57
## 3               17            17           15                 63
## 4               15            15            4                 45
## 5               13            10            8                 40
## 6               18            19           17                 67
## 7               15            12           12                 51
## 8               13            11            5                 43
## 9               14            13            9                 43
## 10              14            11           13                 45
## 11              14            11           12                 49
## 12              16            11            4                 41
## 13              16            18           15                 64
## 14              17            16           17                 65
## 15              14             8            7                 36
## 16              16            17           13                 57
## 17               7             5            5                 25
## 18              14            18           16                 61
## 19              13            12           13                 45
## 20              18            20           14                 66
## 21              19            18           10                 60
## 22              14            12            9                 44
## 23              14            12            7                 40
## 24              13            12           17                 53
## 25              17            11            4                 36
## 26              11             4            5                 23
## 27              19            15            8                 54
## 28              14            17           14                 57
## 29              17            15           16                 61
## 30              11            13           11                 46
## 31               7             5            8                 28
read.csv("R_value.csv") #Feedback(effort=1,performance=2)
##     ID feedback ITS class PreTest_Total_Score PostTest_Total_Score Post_Pre
## 1    1        1  12     1                  14                   14        0
## 2    4        1  12     1                  13                   12       -1
## 3    5        1  12     1                   4                    6        2
## 4    7        1  12     1                   3                    9        6
## 5    8        1  10     1                  10                    8       -2
## 6   28        1  12     1                  13                   14        1
## 7   29        1  12     1                   9                   11        2
## 8   30        1  12     1                  12                   14        2
## 9   31        1  12     1                  12                   11       -1
## 10  33        1  12     1                  11                   11        0
## 11  34        1  12     1                   4                    3       -1
## 12  35        1  12     1                   3                   10        7
## 13  37        1  12     2                   3                    3        0
## 14  38        1  12     2                  14                   14        0
## 15  39        1  12     2                   9                    4       -5
## 16  40        1  12     2                  11                   12        1
## 17  41        1  12     2                   2                    1       -1
## 18  42        1  12     2                  14                   14        0
## 19  43        1  12     2                  13                   13        0
## 20  44        1  12     2                   5                    8        3
## 21  45        1  12     2                  12                   12        0
## 22  69        1  12     2                   8                   11        3
## 23  74        1  12     3                  11                    3       -8
## 24  75        1  12     3                   8                    6       -2
## 25  76        1  12     3                  10                   12        2
## 26  77        1  12     3                  12                   10       -2
## 27  79        1  12     3                   5                   10        5
## 28 100        1  12     3                   9                    6       -3
## 29 101        1  12     3                  13                   13        0
## 30 102        1  12     3                   7                    2       -5
## 31 103        1  12     3                  13                   13        0
## 32 105        1  12     3                  12                   14        2
## 33 106        1  12     3                   1                    0       -1
## 34 107        1  12     3                  14                   13       -1
## 35  10        2  11     1                   9                   11        2
## 36  12        2  12     1                   9                    9        0
## 37  13        2  12     1                   1                   14       13
## 38  15        2  12     1                   8                    8        0
## 39  16        2  12     1                   3                    3        0
## 40  20        2  12     1                  13                   13        0
## 41  21        2  12     1                  11                   14        3
## 42  23        2  12     1                   5                    9        4
## 43  25        2  12     1                   3                    4        1
## 44  26        2  12     1                  11                   14        3
## 45  27        2  12     1                  10                   12        2
## 46  46        2  12     2                   5                    2       -3
## 47  48        2  12     2                  12                   13        1
## 48  49        2  12     2                   8                   11        3
## 49  50        2  12     2                  11                   13        2
## 50  51        2  12     2                  14                   14        0
## 51  52        2  12     2                   2                    3        1
## 52  53        2  12     2                  13                   12       -1
## 53  54        2  12     2                   3                   12        9
## 54  56        2  12     2                  11                   13        2
## 55  57        2  12     2                  13                   14        1
## 56  58        2  12     2                  11                   10       -1
## 57  62        2  12     2                  12                   12        0
## 58  63        2  12     2                  12                    6       -6
## 59  82        2  12     3                   3                    1       -2
## 60  83        2  12     3                   2                   13       11
## 61  87        2  12     3                  12                   12        0
## 62  91        2  12     3                   8                   12        4
## 63  93        2  12     3                   5                    8        3
## 64  96        2  12     3                  11                   13        2
## 65  98        2  12     3                  14                   14        0
##    Intrinsic_Value Self.regulation Self.efficacy Test_anxiety
## 1               15              19            20           14
## 2               10              16            13            8
## 3                6              11            12            7
## 4               10              15            12            9
## 5               13              16            17           15
## 6               11              16            11            4
## 7                8              11             9           15
## 8               14              20            19           16
## 9                8              13            12            8
## 10              15              16            17           13
## 11               6              12            11            7
## 12               9              13            14           14
## 13               6              15             6            4
## 14              15              20            20            6
## 15              15              18            14           12
## 16              13              19            17            5
## 17              11              16            16            4
## 18              14              18            20           17
## 19              12              11            16           10
## 20               8              11            12            8
## 21              13              13            20           20
## 22               5              15            11            7
## 23               5              10             6            6
## 24              10              11             9           14
## 25              13              16            15           12
## 26              15              15            13            7
## 27               8              14             7            7
## 28               9               8             7           12
## 29              11              11            16           14
## 30              12              18            17           15
## 31              13              16            16           15
## 32              15              14            18           18
## 33               6               9             9            9
## 34              12              16            18           17
## 35              13              18            16           15
## 36              11              15            15           16
## 37              14              17            17           15
## 38              11              15            15            4
## 39               9              13            10            8
## 40              13              18            19           17
## 41              12              15            12           12
## 42              14              13            11            5
## 43               7              14            13            9
## 44               7              14            11           13
## 45              12              14            11           12
## 46              10              16            11            4
## 47              15              16            18           15
## 48              15              17            16           17
## 49               7              14             8            7
## 50              11              16            17           13
## 51               8               7             5            5
## 52              13              14            18           16
## 53               7              13            12           13
## 54              14              18            20           14
## 55              13              19            18           10
## 56               9              14            12            9
## 57               7              14            12            7
## 58              11              13            12           17
## 59               4              17            11            4
## 60               3              11             4            5
## 61              12              19            15            8
## 62              12              14            17           14
## 63              13              17            15           16
## 64              11              11            13           11
## 65               8               7             5            8
##    Survey_Total_Score
## 1                  68
## 2                  47
## 3                  36
## 4                  46
## 5                  61
## 6                  42
## 7                  43
## 8                  69
## 9                  41
## 10                 61
## 11                 36
## 12                 50
## 13                 31
## 14                 61
## 15                 59
## 16                 54
## 17                 47
## 18                 69
## 19                 49
## 20                 39
## 21                 66
## 22                 38
## 23                 27
## 24                 44
## 25                 56
## 26                 50
## 27                 36
## 28                 36
## 29                 52
## 30                 62
## 31                 60
## 32                 65
## 33                 33
## 34                 63
## 35                 62
## 36                 57
## 37                 63
## 38                 45
## 39                 40
## 40                 67
## 41                 51
## 42                 43
## 43                 43
## 44                 45
## 45                 49
## 46                 41
## 47                 64
## 48                 65
## 49                 36
## 50                 57
## 51                 25
## 52                 61
## 53                 45
## 54                 66
## 55                 60
## 56                 44
## 57                 40
## 58                 53
## 59                 36
## 60                 23
## 61                 54
## 62                 57
## 63                 61
## 64                 46
## 65                 28
setwd("/Users/satoushintarou/Desktop/Master thesis/大宮北小/Data") #Directory


data<-read.csv("R.csv") 
datae<-read.csv("effort.csv") 
datap<-read.csv("performance.csv") 
datav<-read.csv("R_value.csv")

#Demographic

#All Students (N=65)
table(data$feedback)
## 
##      effort performance 
##          34          31
#Pre-test/All Students (N=65)
mean(data$PreTest_Total_Score)
## [1] 8.907692
sd(data$PreTest_Total_Score)
## [1] 4.076315
median(data$PreTest_Total_Score)
## [1] 10
hist(datae$PreTest_Total_Score,main="PreTest_Total_Score/All students (N=65)",ylim=c(0,15))

#Post-test/All Students (N=65)
mean(data$PostTest_Total_Score)
## [1] 9.784615
sd(data$PostTest_Total_Score)
## [1] 4.173923
median(data$PostTest_Total_Score)
## [1] 11
hist(data$PostTest_Total_Score,main="PostTest_Total_Score/All students (N=65)",ylim=c(0,15))

#Pre-test/effort group (N=34)
mean(datae$PreTest_Total_Score)
## [1] 9.235294
sd(datae$PreTest_Total_Score)
## [1] 4.068049
median(datae$PreTest_Total_Score)
## [1] 10.5
hist(datae$PreTest_Total_Score,main="PreTest_Total_Score/Effort group (N=34)",ylim=c(0,15))

#Post-test/effort group (N=34) 
mean(datae$PostTest_Total_Score)
## [1] 9.323529
sd(datae$PostTest_Total_Score)
## [1] 4.339533
median(datae$PostTest_Total_Score)
## [1] 11
hist(datae$PostTest_Total_Score,main="PostTest_Total_Score/Effort group (N=34)",ylim=c(0,15))

#Pre-test/performance group (N=31)
mean(datap$PreTest_Total_Score)
## [1] 8.548387
sd(datap$PreTest_Total_Score)
## [1] 4.121801
median(datap$PreTest_Total_Score)
## [1] 10
hist(datap$PreTest_Total_Score,main="PreTest_Total_Score/Performance group (N=31)",ylim=c(0,15))

#Post-test/performance group (N=31)
mean(datap$PostTest_Total_Score)
## [1] 10.29032
sd(datap$PostTest_Total_Score)
## [1] 3.993274
median(datap$PostTest_Total_Score)
## [1] 12
hist(datap$PostTest_Total_Score,main="PostTest_Total_Score/Performance group (N=31)",ylim=c(0,15))

#Analysis 1 #Compare Pre- vs. Post-Test #All Students (N=65)

#Comment:Overall, the test score increased significantly before and after the ITS learning activity. 

#T-test 
#Pre-test and Post-test
#p-value = 0.04363 
t.test(data$PreTest_Total_Score, data$PostTest_Total_Score, paired=TRUE)
## 
##  Paired t-test
## 
## data:  data$PreTest_Total_Score and data$PostTest_Total_Score
## t = -2.0584, df = 64, p-value = 0.04363
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -1.72799831 -0.02584785
## sample estimates:
## mean difference 
##      -0.8769231

#Analysis 2 #Compare Pre-Test / Effort vs. Performance Group #Compare Post-Test / Effort vs. Performance Group

#Comment:No significant difference in the pre- and post-test between the effort and performance group. 

#T-test
#Pre-test between the effort and performance group
#p-value = 0.502
var.test(datae$PreTest_Total_Score,datap$PreTest_Total_Score)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$PreTest_Total_Score and datap$PreTest_Total_Score
## F = 0.97409, num df = 33, denom df = 30, p-value = 0.9373
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.4750086 1.9733731
## sample estimates:
## ratio of variances 
##          0.9740879
t.test(PreTest_Total_Score ~ feedback, var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  PreTest_Total_Score by feedback
## t = 0.67568, df = 63, p-value = 0.5017
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -1.344633  2.718447
## sample estimates:
##      mean in group effort mean in group performance 
##                  9.235294                  8.548387
#T-test
#Post-test between the effort and performance group
#p-value = 0.355
var.test(datae$PostTest_Total_Score,datap$PostTest_Total_Score)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$PostTest_Total_Score and datap$PostTest_Total_Score
## F = 1.1809, num df = 33, denom df = 30, p-value = 0.6484
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.5758789 2.3924284
## sample estimates:
## ratio of variances 
##            1.18094
t.test(PostTest_Total_Score ~ feedback, var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  PostTest_Total_Score by feedback
## t = -0.93176, df = 63, p-value = 0.355
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -3.040265  1.106678
## sample estimates:
##      mean in group effort mean in group performance 
##                  9.323529                 10.290323

#Analysis 3 #Compare Test Score Increase (増加量) / Effort vs. Performance Group

#Comment:There is a trend (p=0.051) that greater test score increase [(Post_Test_Total_Score) - (Pre_Test_Total_Score)] among kids who received performance feedback compared to those who received effort-based feedback.

#T-test
#Score Increase [Post_pre = (Post_Test_Total_Score)ー(Pre_Test_Total_Score)] between the effort and performance group 
#p-value = 0.05177
var.test(datae$Post_Pre,datap$Post_Pre)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Post_Pre and datap$Post_Pre
## F = 0.62939, num df = 33, denom df = 30, p-value = 0.1963
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.3069204 1.2750686
## sample estimates:
## ratio of variances 
##          0.6293939
t.test(Post_Pre ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Post_Pre by feedback
## t = -1.9827, df = 63, p-value = 0.05177
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -3.32044774  0.01304737
## sample estimates:
##      mean in group effort mean in group performance 
##                0.08823529                1.74193548

#Analysis 4 #Regression Model #All Students (N=65)

#Comment:"Feedback" and "Pre-Test" has a trend to predict "Post-Test".
#y="Post-test", x="Feedback type" and "Pre-test"
model1 <- lm(PostTest_Total_Score ~ feedback*PreTest_Total_Score, data = data)
summary(model1)
## 
## Call:
## lm(formula = PostTest_Total_Score ~ feedback * PreTest_Total_Score, 
##     data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.7402 -1.6567  0.6542  1.3433  7.9167 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)
## (Intercept)                               1.9096     1.3393   1.426   0.1590
## feedbackperformance                       3.6163     1.8685   1.935   0.0576
## PreTest_Total_Score                       0.8028     0.1330   6.034 1.02e-07
## feedbackperformance:PreTest_Total_Score  -0.2454     0.1915  -1.282   0.2047
##                                            
## (Intercept)                                
## feedbackperformance                     .  
## PreTest_Total_Score                     ***
## feedbackperformance:PreTest_Total_Score    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.109 on 61 degrees of freedom
## Multiple R-squared:  0.4712, Adjusted R-squared:  0.4452 
## F-statistic: 18.12 on 3 and 61 DF,  p-value: 1.598e-08
model2 <- lm(PostTest_Total_Score ~ feedback+PreTest_Total_Score, data = data)
summary(model2)
## 
## Call:
## lm(formula = PostTest_Total_Score ~ feedback + PreTest_Total_Score, 
##     data = data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.531 -1.915  0.416  1.469  8.875 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          3.00386    1.03734   2.896  0.00522 ** 
## feedbackperformance  1.43684    0.77883   1.845  0.06983 .  
## PreTest_Total_Score  0.68430    0.09617   7.115 1.36e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.125 on 62 degrees of freedom
## Multiple R-squared:  0.457,  Adjusted R-squared:  0.4395 
## F-statistic: 26.09 on 2 and 62 DF,  p-value: 6.01e-09
library(ggplot2)  
ggplot(data, aes(x = PreTest_Total_Score, y = PostTest_Total_Score, col = feedback)) + geom_point() +geom_smooth(method = "lm",se=FALSE)
## `geom_smooth()` using formula = 'y ~ x'

#Comment: "Feedback" and "Pre-Test" has a trend to predict "Score Increase(増加量)".
#y="Score Increase(増加量)", x="Feedback type" and "Pre-test"
model3 <- lm(Post_Pre ~ feedback*PreTest_Total_Score, data = data)
summary(model3)
## 
## Call:
## lm(formula = Post_Pre ~ feedback * PreTest_Total_Score, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -7.7402 -1.6567  0.6542  1.3433  7.9167 
## 
## Coefficients:
##                                         Estimate Std. Error t value Pr(>|t|)  
## (Intercept)                               1.9096     1.3393   1.426   0.1590  
## feedbackperformance                       3.6163     1.8685   1.935   0.0576 .
## PreTest_Total_Score                      -0.1972     0.1330  -1.483   0.1434  
## feedbackperformance:PreTest_Total_Score  -0.2454     0.1915  -1.282   0.2047  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.109 on 61 degrees of freedom
## Multiple R-squared:  0.2191, Adjusted R-squared:  0.1807 
## F-statistic: 5.706 on 3 and 61 DF,  p-value: 0.001646
model4 <- lm(Post_Pre ~ feedback+PreTest_Total_Score, data = data)
summary(model4)
## 
## Call:
## lm(formula = Post_Pre ~ feedback + PreTest_Total_Score, data = data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.531 -1.915  0.416  1.469  8.875 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          3.00386    1.03734   2.896  0.00522 **
## feedbackperformance  1.43684    0.77883   1.845  0.06983 . 
## PreTest_Total_Score -0.31570    0.09617  -3.283  0.00169 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.125 on 62 degrees of freedom
## Multiple R-squared:  0.1981, Adjusted R-squared:  0.1722 
## F-statistic: 7.659 on 2 and 62 DF,  p-value: 0.001066
library(ggplot2)  
ggplot(data, aes(x = PreTest_Total_Score, y =  Post_Pre, col = feedback)) + geom_point() +geom_smooth(method = "lm",se=FALSE)
## `geom_smooth()` using formula = 'y ~ x'

#Analysis 5 #Compare Math Motivation Score (算数学習への意欲) / Effort vs. Performance Group

#Comment:In terms of the Math motivation score, no significant difference between the two groups.

#T-test
#Math motivation score between the effort and performance group
#p-value = 0.8305
var.test(datae$Survey_Total_Score,datap$Survey_Total_Score)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Survey_Total_Score and datap$Survey_Total_Score
## F = 0.99344, num df = 33, denom df = 30, p-value = 0.9808
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.4844434 2.0125693
## sample estimates:
## ratio of variances 
##          0.9934357
t.test(Survey_Total_Score ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Survey_Total_Score by feedback
## t = 0.21497, df = 63, p-value = 0.8305
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -5.423100  6.730501
## sample estimates:
##      mean in group effort mean in group performance 
##                  49.91176                  49.25806
#T-test
#Intrinsic value between the effort and performance group
#p-value = 0.7563 
var.test(datae$Intrinsic_Value,datap$Intrinsic_Value)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Intrinsic_Value and datap$Intrinsic_Value
## F = 1.0885, num df = 33, denom df = 30, p-value = 0.8181
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.5308176 2.2052257
## sample estimates:
## ratio of variances 
##           1.088534
t.test(Intrinsic_Value ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Intrinsic_Value by feedback
## t = 0.31166, df = 63, p-value = 0.7563
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -1.345265  1.842419
## sample estimates:
##      mean in group effort mean in group performance 
##                  10.76471                  10.51613
#T-test
#Self efficacy between the effort and performance group
#p-value = 0.5474  
var.test(datae$Self.efficacy,datap$Self.efficacy)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Self.efficacy and datap$Self.efficacy
## F = 1.0701, num df = 33, denom df = 30, p-value = 0.8552
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.5218127 2.1678160
## sample estimates:
## ratio of variances 
##           1.070068
t.test(Self.efficacy ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Self.efficacy by feedback
## t = 0.60497, df = 63, p-value = 0.5474
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -1.450972  2.710934
## sample estimates:
##      mean in group effort mean in group performance 
##                  13.82353                  13.19355
#T-test
#Self regulation between the effort and performance group
#p-value = 0.8525
var.test(datae$Self.regulation,datap$Self.regulation)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Self.regulation and datap$Self.regulation
## F = 1.1886, num df = 33, denom df = 30, p-value = 0.6357
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.579596 2.407871
## sample estimates:
## ratio of variances 
##           1.188563
t.test(Self.regulation ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Self.regulation by feedback
## t = -0.18666, df = 63, p-value = 0.8525
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -1.665894  1.381264
## sample estimates:
##      mean in group effort mean in group performance 
##                  14.47059                  14.61290
#T-test
#Anxiety between the effort and performance group
#p-value = 0.9412 
var.test(datae$Test_anxiety,datap$Test_anxiety)#等分散
## 
##  F test to compare two variances
## 
## data:  datae$Test_anxiety and datap$Test_anxiety
## F = 1.0587, num df = 33, denom df = 30, p-value = 0.8786
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
##  0.5162518 2.1447136
## sample estimates:
## ratio of variances 
##           1.058664
t.test(Test_anxiety ~ feedback,var.equal=T,data = data)
## 
##  Two Sample t-test
## 
## data:  Test_anxiety by feedback
## t = -0.074085, df = 63, p-value = 0.9412
## alternative hypothesis: true difference in means between group effort and group performance is not equal to 0
## 95 percent confidence interval:
##  -2.309021  2.143936
## sample estimates:
##      mean in group effort mean in group performance 
##                  10.85294                  10.93548

#Analysis 6 #Correlation

library(corrplot)
## corrplot 0.92 loaded
round(cor(datav),2)
##                         ID feedback   ITS class PreTest_Total_Score
## ID                    1.00    -0.05  0.24  0.94                0.09
## feedback             -0.05     1.00  0.05 -0.08               -0.08
## ITS                   0.24     0.05  1.00  0.20               -0.03
## class                 0.94    -0.08  0.20  1.00                0.07
## PreTest_Total_Score   0.09    -0.08 -0.03  0.07                1.00
## PostTest_Total_Score -0.05     0.12  0.03 -0.09                0.65
## Post_Pre             -0.17     0.24  0.08 -0.19               -0.39
## Intrinsic_Value      -0.11    -0.04 -0.13 -0.08                0.48
## Self.regulation      -0.26     0.02 -0.12 -0.20                0.27
## Self.efficacy        -0.15    -0.08 -0.13 -0.15                0.45
## Test_anxiety          0.08     0.01 -0.16  0.00                0.35
## Survey_Total_Score   -0.12    -0.03 -0.16 -0.12                0.48
##                      PostTest_Total_Score Post_Pre Intrinsic_Value
## ID                                  -0.05    -0.17           -0.11
## feedback                             0.12     0.24           -0.04
## ITS                                  0.03     0.08           -0.13
## class                               -0.09    -0.19           -0.08
## PreTest_Total_Score                  0.65    -0.39            0.48
## PostTest_Total_Score                 1.00     0.44            0.42
## Post_Pre                             0.44     1.00           -0.07
## Intrinsic_Value                      0.42    -0.07            1.00
## Self.regulation                      0.27     0.00            0.58
## Self.efficacy                        0.42    -0.03            0.77
## Test_anxiety                         0.38     0.04            0.53
## Survey_Total_Score                   0.46    -0.01            0.87
##                      Self.regulation Self.efficacy Test_anxiety
## ID                             -0.26         -0.15         0.08
## feedback                        0.02         -0.08         0.01
## ITS                            -0.12         -0.13        -0.16
## class                          -0.20         -0.15         0.00
## PreTest_Total_Score             0.27          0.45         0.35
## PostTest_Total_Score            0.27          0.42         0.38
## Post_Pre                        0.00         -0.03         0.04
## Intrinsic_Value                 0.58          0.77         0.53
## Self.regulation                 1.00          0.70         0.19
## Self.efficacy                   0.70          1.00         0.57
## Test_anxiety                    0.19          0.57         1.00
## Survey_Total_Score              0.71          0.93         0.75
##                      Survey_Total_Score
## ID                                -0.12
## feedback                          -0.03
## ITS                               -0.16
## class                             -0.12
## PreTest_Total_Score                0.48
## PostTest_Total_Score               0.46
## Post_Pre                          -0.01
## Intrinsic_Value                    0.87
## Self.regulation                    0.71
## Self.efficacy                      0.93
## Test_anxiety                       0.75
## Survey_Total_Score                 1.00
cor_matrix<-round(cor(datav),2)
corrplot(corr=cor_matrix)

#Comment:There is a correlation between the Math motivation score and the test scores.
##Significant Correlation##

#Pre-Test × Post-Test
#p-value = 3.582e-09, cor 0.6535961
cor.test(data$PreTest_Total_Score,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$PreTest_Total_Score and data$PostTest_Total_Score
## t = 6.8545, df = 63, p-value = 3.582e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.4873931 0.7740955
## sample estimates:
##       cor 
## 0.6535961
#Math Motivation Score × Pre-test
#p-value = 5.368e-05, cor 0.4792619 
cor.test(data$Survey_Total_Score,data$PreTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Survey_Total_Score and data$PreTest_Total_Score
## t = 4.3342, df = 63, p-value = 5.368e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2665163 0.6474765
## sample estimates:
##       cor 
## 0.4792619
#Math Motivation Score × Post-test
#p-value = 0.0001171, cor 0.4596764 
cor.test(data$Survey_Total_Score,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Survey_Total_Score and data$PostTest_Total_Score
## t = 4.1083, df = 63, p-value = 0.0001171
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2430238 0.6326465
## sample estimates:
##       cor 
## 0.4596764
#Intrinsic value × Post-test
#p-value = 0.0005316, cor 0.4179531
cor.test(data$Intrinsic_Value,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Intrinsic_Value and data$PostTest_Total_Score
## t = 3.6516, df = 63, p-value = 0.0005316
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1938108 0.6006254
## sample estimates:
##       cor 
## 0.4179531
#Self efficacy × Post-test
#p-value = 0.0005402, cor 0.4174799 
cor.test(data$Self.efficacy,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Self.efficacy and data$PostTest_Total_Score
## t = 3.6466, df = 63, p-value = 0.0005402
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1932590 0.6002589
## sample estimates:
##       cor 
## 0.4174799
#Self regulation × Post-test
#p-value = 0.02902, cor 0.270957 
cor.test(data$Self.regulation,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Self.regulation and data$PostTest_Total_Score
## t = 2.2342, df = 63, p-value = 0.02902
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.02897262 0.48294046
## sample estimates:
##      cor 
## 0.270957
#Test anxiety × Post-test
#p-value = 0.001859, cor 0.3788359 
cor.test(data$Test_anxiety,data$PostTest_Total_Score)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Test_anxiety and data$PostTest_Total_Score
## t = 3.2491, df = 63, p-value = 0.001859
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1486740 0.5700625
## sample estimates:
##       cor 
## 0.3788359
#Comment:There is not significant correlation between the Math motivation score and the Score increase.
##No significant##

#Math motivation score × Score increase(増加量)
cor.test(data$Survey_Total_Score,data$Post_Pre)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Survey_Total_Score and data$Post_Pre
## t = -0.080814, df = 63, p-value = 0.9358
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2534508  0.2342999
## sample estimates:
##         cor 
## -0.01018105
#Intrinsic value × Score increase
cor.test(data$Intrinsic_Value,data$Post_Pre)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Intrinsic_Value and data$Post_Pre
## t = -0.52004, df = 63, p-value = 0.6049
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.3044233  0.1814134
## sample estimates:
##        cor 
## -0.0653785
#Self efficacy × Score increase
cor.test(data$Self.efficacy,data$Post_Pre)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Self.efficacy and data$Post_Pre
## t = -0.20616, df = 63, p-value = 0.8373
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2681662  0.2193227
## sample estimates:
##         cor 
## -0.02596541
#Self regulation × Score increase
cor.test(data$Self.regulation,data$Post_Pre)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Self.regulation and data$Post_Pre
## t = 0.039199, df = 63, p-value = 0.9689
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2392488  0.2485383
## sample estimates:
##         cor 
## 0.004938531
#Test anxiety × Score increase
cor.test(data$Test_anxiety,data$Post_Pre)
## 
##  Pearson's product-moment correlation
## 
## data:  data$Test_anxiety and data$Post_Pre
## t = 0.31772, df = 63, p-value = 0.7517
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.2059111  0.2811531
## sample estimates:
##        cor 
## 0.03999669