In this step we will apply apriori algorithm. The most important
characteristic in this approach are:
In this approach I want to achieve best possible rules in terms of
quality with Apriori algorithm. I want to keep good quality of rules in
terms of support, lift and confidence while keeping the set of rules
quite broad due to the characteristic of the investigated data - medical
data.
Analysis of obtained rules
To get better knowledge about obtained results, I performed the
analysis of obtained rules for both cases. I decided to do that because
sometimes broad basket of rules can give us the more detailed rules and
it’s worth to stick to the broad basked instead of narrowing it. For
this output it is hard to investigate, however we can observe that most
of the results explained profile of women who feel anxious or doesn’t
observe any changes in their’s appetite.
In terms of lift we can observe possitive associate, for all rules
lift is higher than 1, which means that symptoms are more likely to
occur together than expected by chance. That also confirms that the
obtained results are strong. However, the results mostly focused on the
unchanged appetite. That means that most of the interviewed woman didn’t
observe any changes in theirs appetite despite lists of other symptoms.
On the other hand, I observed that many symptoms leads to feeling
anxious.
rules_analysis<-sort(rules_first, by="lift", decreasing=TRUE)
knitr::kable(inspect(rules_analysis))
## lhs rhs support confidence coverage lift count
## [1] {feeling anxious,
## often problems with concentrating or making decision,
## sometimes problems of bonding with baby} => {no troubles with sleeping at night} 0.1099196 0.8586387 0.1280161 3.086961 164
## [2] {no problems with concentrating or making decision,
## not feeling anxious,
## two or more days a week troubles with sleeping at night} => {sometimes irritable towards baby or partner} 0.1159517 0.8963731 0.1293566 3.018936 173
## [3] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {not feeling anxious} 0.1159517 0.9402174 0.1233244 2.682226 173
## [4] {feeling anxious,
## no troubles with sleeping at night,
## sometimes problems of bonding with baby} => {often problems with concentrating or making decision} 0.1099196 0.8367347 0.1313673 2.639341 164
## [5] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## sometimes irritable towards baby or partner} => {not feeling anxious} 0.1092493 0.9209040 0.1186327 2.627129 163
## [6] {sometimes irritable towards baby or partner,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {not feeling anxious} 0.1058981 0.9132948 0.1159517 2.605422 158
## [7] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner,
## standard appetite} => {not feeling anxious} 0.1058981 0.9028571 0.1172922 2.575646 158
## [8] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner} => {not feeling anxious} 0.1373995 0.8951965 0.1534853 2.553792 205
## [9] {feeling anxious,
## no problems of bonding with baby,
## not feeling of guilt,
## standard appetite} => {not feeling sad or tearful} 0.1152815 0.8557214 0.1347185 2.450550 172
## [10] {no problems of bonding with baby,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {no problems with concentrating or making decision} 0.1032172 0.9565217 0.1079088 2.447908 154
## [11] {feeling anxious,
## not irritable towards baby or partner,
## sometimes problems of bonding with baby} => {feeling sad or tearful} 0.1112601 0.8645833 0.1286863 2.447739 166
## [12] {sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {not feeling anxious} 0.1286863 0.8533333 0.1508043 2.434366 192
## [13] {feeling of guilt,
## no problems of bonding with baby} => {not feeling anxious} 0.1092493 0.8445596 0.1293566 2.409336 163
## [14] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner,
## standard appetite} => {no problems of bonding with baby} 0.1038874 0.8857143 0.1172922 2.385353 155
## [15] {feeling of guilt,
## standard appetite} => {not feeling anxious} 0.1219839 0.8310502 0.1467828 2.370797 182
## [16] {no problems of bonding with baby,
## not feeling of guilt,
## standard appetite} => {not feeling sad or tearful} 0.1186327 0.8271028 0.1434316 2.368594 177
## [17] {no problems of bonding with baby,
## not feeling anxious,
## sometimes irritable towards baby or partner} => {no problems with concentrating or making decision} 0.1092493 0.9209040 0.1186327 2.356756 163
## [18] {feeling anxious,
## no problems of bonding with baby,
## not feeling of guilt} => {not feeling sad or tearful} 0.1179625 0.8224299 0.1434316 2.355212 176
## [19] {sometimes irritable towards baby or partner,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {no problems of bonding with baby} 0.1012064 0.8728324 0.1159517 2.350660 151
## [20] {feeling anxious,
## no troubles with sleeping at night,
## not feeling of guilt} => {sometimes problems of bonding with baby} 0.1012064 0.8483146 0.1193029 2.348210 151
## [21] {feeling anxious,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {irritable towards baby or partner} 0.1032172 0.8603352 0.1199732 2.338106 154
## [22] {feeling anxious,
## no problems of bonding with baby,
## standard appetite} => {not feeling sad or tearful} 0.1313673 0.8132780 0.1615282 2.329003 196
## [23] {not feeling of guilt,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {not feeling sad or tearful} 0.1065684 0.8071066 0.1320375 2.311330 159
## [24] {no problems of bonding with baby,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {no problems with concentrating or making decision} 0.1474531 0.9016393 0.1635389 2.307454 220
## [25] {not feeling anxious,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {no problems with concentrating or making decision} 0.1159517 0.9010417 0.1286863 2.305925 173
## [26] {feeling anxious,
## not feeling of guilt,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {not feeling sad or tearful} 0.1032172 0.8020833 0.1286863 2.296945 154
## [27] {no problems of bonding with baby,
## two or more days a week troubles with sleeping at night} => {no problems with concentrating or making decision} 0.1541555 0.8812261 0.1749330 2.255213 230
## [28] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {no problems of bonding with baby} 0.1032172 0.8369565 0.1233244 2.254042 154
## [29] {no problems with concentrating or making decision,
## not feeling sad or tearful,
## standard appetite} => {no problems of bonding with baby} 0.1112601 0.8341709 0.1333780 2.246540 166
## [30] {not feeling anxious,
## sometimes irritable towards baby or partner,
## standard appetite} => {no problems of bonding with baby} 0.1072386 0.8247423 0.1300268 2.221147 160
## [31] {no problems with concentrating or making decision,
## not feeling sad or tearful} => {no problems of bonding with baby} 0.1233244 0.8177778 0.1508043 2.202391 184
## [32] {not feeling sad or tearful,
## sometimes irritable towards baby or partner,
## standard appetite} => {no problems of bonding with baby} 0.1032172 0.8105263 0.1273458 2.182861 154
## [33] {feeling anxious,
## irritable towards baby or partner,
## not feeling sad or tearful,
## standard appetite} => {not feeling of guilt} 0.1038874 0.9011628 0.1152815 2.165113 155
## [34] {feeling anxious,
## not feeling sad or tearful,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {not feeling of guilt} 0.1032172 0.8850575 0.1166220 2.126418 154
## [35] {feeling anxious,
## no problems of bonding with baby,
## not feeling sad or tearful,
## standard appetite} => {not feeling of guilt} 0.1152815 0.8775510 0.1313673 2.108383 172
## [36] {sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {no problems with concentrating or making decision} 0.1233244 0.8177778 0.1508043 2.092838 184
## [37] {not feeling anxious,
## sometimes irritable towards baby or partner,
## standard appetite} => {no problems with concentrating or making decision} 0.1058981 0.8144330 0.1300268 2.084278 158
## [38] {feeling anxious,
## irritable towards baby or partner,
## not feeling sad or tearful} => {not feeling of guilt} 0.1038874 0.8659218 0.1199732 2.080443 155
## [39] {feeling anxious,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {not feeling of guilt} 0.1032172 0.8603352 0.1199732 2.067021 154
## [40] {feeling anxious,
## no problems of bonding with baby,
## not feeling sad or tearful} => {not feeling of guilt} 0.1179625 0.8502415 0.1387399 2.042770 176
## [41] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## sometimes irritable towards baby or partner} => {two or more days a week troubles with sleeping at night} 0.1032172 0.8700565 0.1186327 2.037872 154
## [42] {feeling anxious,
## irritable towards baby or partner,
## not feeling sad or tearful} => {two or more days a week troubles with sleeping at night} 0.1032172 0.8603352 0.1199732 2.015102 154
## [43] {feeling anxious,
## no problems of bonding with baby,
## standard appetite} => {not feeling of guilt} 0.1347185 0.8340249 0.1615282 2.003809 201
## [44] {no problems with concentrating or making decision,
## not feeling anxious,
## sometimes irritable towards baby or partner} => {two or more days a week troubles with sleeping at night} 0.1159517 0.8439024 0.1373995 1.976613 173
## [45] {no problems with concentrating or making decision,
## sometimes feeling of guilt} => {two or more days a week troubles with sleeping at night} 0.1152815 0.8431373 0.1367292 1.974821 172
## [46] {not feeling anxious,
## sometimes irritable towards baby or partner,
## standard appetite} => {two or more days a week troubles with sleeping at night} 0.1058981 0.8144330 0.1300268 1.907589 158
## [47] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## standard appetite} => {two or more days a week troubles with sleeping at night} 0.1474531 0.8058608 0.1829759 1.887511 220
## [48] {irritable towards baby or partner,
## not feeling sad or tearful,
## standard appetite} => {two or more days a week troubles with sleeping at night} 0.1052279 0.8051282 0.1306971 1.885795 157
## [49] {no problems with concentrating or making decision,
## sometimes irritable towards baby or partner} => {two or more days a week troubles with sleeping at night} 0.1233244 0.8034934 0.1534853 1.881966 184
## [50] {irritable towards baby or partner,
## not feeling of guilt,
## not feeling sad or tearful,
## standard appetite} => {feeling anxious} 0.1038874 1.0000000 0.1038874 1.541322 155
## [51] {irritable towards baby or partner,
## not feeling of guilt,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1025469 1.0000000 0.1025469 1.541322 153
## [52] {not feeling of guilt,
## often problems with concentrating or making decision} => {feeling anxious} 0.1628686 0.9918367 0.1642091 1.528740 243
## [53] {not feeling of guilt,
## often problems with concentrating or making decision,
## standard appetite} => {feeling anxious} 0.1199732 0.9889503 0.1213137 1.524291 179
## [54] {no troubles with sleeping at night,
## not feeling of guilt,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1012064 0.9869281 0.1025469 1.521174 151
## [55] {no troubles with sleeping at night,
## often problems with concentrating or making decision,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1099196 0.9761905 0.1126005 1.504624 164
## [56] {irritable towards baby or partner,
## not feeling of guilt,
## not feeling sad or tearful} => {feeling anxious} 0.1038874 0.9748428 0.1065684 1.502547 155
## [57] {not feeling of guilt,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1286863 0.9746193 0.1320375 1.502202 192
## [58] {no problems of bonding with baby,
## not feeling of guilt,
## not feeling sad or tearful,
## standard appetite} => {feeling anxious} 0.1152815 0.9717514 0.1186327 1.497782 172
## [59] {irritable towards baby or partner,
## not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1085791 0.9700599 0.1119303 1.495175 162
## [60] {not feeling of guilt,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1032172 0.9685535 0.1065684 1.492853 154
## [61] {not feeling of guilt,
## not feeling sad or tearful,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1032172 0.9685535 0.1065684 1.492853 154
## [62] {no troubles with sleeping at night,
## often problems with concentrating or making decision} => {feeling anxious} 0.1568365 0.9629630 0.1628686 1.484236 234
## [63] {no problems of bonding with baby,
## not feeling of guilt,
## not feeling sad or tearful} => {feeling anxious} 0.1179625 0.9617486 0.1226542 1.482365 176
## [64] {no troubles with sleeping at night,
## often problems with concentrating or making decision,
## standard appetite} => {feeling anxious} 0.1166220 0.9613260 0.1213137 1.481713 174
## [65] {not feeling of guilt,
## not feeling sad or tearful,
## standard appetite} => {feeling anxious} 0.1829759 0.9545455 0.1916890 1.471262 273
## [66] {40-45,
## not feeling of guilt} => {feeling anxious} 0.1065684 0.9464286 0.1126005 1.458751 159
## [67] {not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1400804 0.9457014 0.1481233 1.457631 209
## [68] {no problems of bonding with baby,
## not feeling of guilt,
## standard appetite} => {feeling anxious} 0.1347185 0.9392523 0.1434316 1.447691 201
## [69] {not irritable towards baby or partner,
## often problems with concentrating or making decision} => {feeling anxious} 0.1139410 0.9392265 0.1213137 1.447651 170
## [70] {irritable towards baby or partner,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1032172 0.9390244 0.1099196 1.447339 154
## [71] {irritable towards baby or partner,
## sometimes problems of bonding with baby,
## standard appetite} => {feeling anxious} 0.1132708 0.9388889 0.1206434 1.447130 169
## [72] {often problems with concentrating or making decision,
## standard appetite} => {feeling anxious} 0.2191689 0.9369628 0.2339142 1.444162 327
## [73] {no problems of bonding with baby,
## not feeling of guilt} => {feeling anxious} 0.1434316 0.9344978 0.1534853 1.440362 214
## [74] {irritable towards baby or partner,
## not feeling of guilt,
## standard appetite} => {feeling anxious} 0.1689008 0.9333333 0.1809651 1.438567 252
## [75] {not feeling of guilt,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1400804 0.9330357 0.1501340 1.438109 209
## [76] {not feeling of guilt,
## not feeling sad or tearful} => {feeling anxious} 0.1876676 0.9302326 0.2017426 1.433788 280
## [77] {irritable towards baby or partner,
## standard appetite,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1387399 0.9282511 0.1494638 1.430734 207
## [78] {not feeling of guilt,
## not irritable towards baby or partner} => {feeling anxious} 0.1179625 0.9263158 0.1273458 1.427751 176
## [79] {no troubles with sleeping at night,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1313673 0.9245283 0.1420912 1.424996 196
## [80] {not feeling of guilt,
## standard appetite} => {feeling anxious} 0.2989276 0.9083503 0.3290885 1.400061 446
## [81] {irritable towards baby or partner,
## not feeling of guilt} => {feeling anxious} 0.1789544 0.8989899 0.1990617 1.385633 267
## [82] {not feeling of guilt} => {feeling anxious} 0.3713137 0.8921095 0.4162198 1.375028 554
## [83] {feeling sad or tearful,
## not feeling of guilt} => {feeling anxious} 0.1079088 0.8895028 0.1213137 1.371010 161
## [84] {not feeling of guilt,
## problems with concentrating or making decision} => {feeling anxious} 0.1079088 0.8846154 0.1219839 1.363477 161
## [85] {irritable towards baby or partner,
## not feeling sad or tearful,
## standard appetite} => {feeling anxious} 0.1152815 0.8820513 0.1306971 1.359525 172
## [86] {no troubles with sleeping at night,
## not feeling of guilt} => {feeling anxious} 0.1193029 0.8811881 0.1353887 1.358195 178
## [87] {no troubles with sleeping at night,
## sometimes feeling sad or tearful} => {feeling anxious} 0.1032172 0.8800000 0.1172922 1.356364 154
## [88] {feeling sad or tearful,
## sometimes problems of bonding with baby,
## standard appetite} => {feeling anxious} 0.1072386 0.8695652 0.1233244 1.340280 160
## [89] {feeling sad or tearful,
## not irritable towards baby or partner,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1112601 0.8691099 0.1280161 1.339579 166
## [90] {not irritable towards baby or partner,
## sometimes feeling of guilt,
## standard appetite} => {feeling anxious} 0.1132708 0.8666667 0.1306971 1.335813 169
## [91] {sometimes feeling of guilt,
## sometimes problems of bonding with baby,
## standard appetite} => {feeling anxious} 0.1119303 0.8652850 0.1293566 1.333683 167
## [92] {feeling sad or tearful,
## sometimes feeling of guilt,
## standard appetite} => {feeling anxious} 0.1005362 0.8620690 0.1166220 1.328726 150
## [93] {often problems with concentrating or making decision,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1280161 0.8603604 0.1487936 1.326093 191
## [94] {irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {feeling anxious} 0.1501340 0.8582375 0.1749330 1.322821 224
## [95] {not irritable towards baby or partner,
## sometimes feeling of guilt} => {feeling anxious} 0.1159517 0.8522167 0.1360590 1.313541 173
## [96] {irritable towards baby or partner,
## standard appetite} => {feeling anxious} 0.2540214 0.8516854 0.2982574 1.312722 379
## [97] {irritable towards baby or partner,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1199732 0.8483412 0.1414209 1.307567 179
## [98] {irritable towards baby or partner,
## not feeling sad or tearful} => {feeling anxious} 0.1199732 0.8443396 0.1420912 1.301400 179
## [99] {sometimes problems of bonding with baby,
## standard appetite} => {feeling anxious} 0.2071046 0.8442623 0.2453083 1.301280 309
## [100] {often problems with concentrating or making decision} => {feeling anxious} 0.2674263 0.8435518 0.3170241 1.300185 399
## [101] {not feeling of guilt,
## troubles with sleeping at night} => {feeling anxious} 0.1119303 0.8434343 0.1327078 1.300004 167
## [102] {not feeling of guilt,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1065684 1.0000000 0.1065684 1.296264 159
## [103] {feeling anxious,
## irritable towards baby or partner,
## not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1038874 1.0000000 0.1038874 1.296264 155
## [104] {feeling anxious,
## not feeling of guilt,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1032172 1.0000000 0.1032172 1.296264 154
## [105] {irritable towards baby or partner,
## no troubles with sleeping at night} => {feeling anxious} 0.1032172 0.8369565 0.1233244 1.290020 154
## [106] {feeling anxious,
## feeling sad or tearful,
## sometimes feeling of guilt} => {standard appetite} 0.1005362 0.9868421 0.1018767 1.279208 150
## [107] {irritable towards baby or partner,
## problems with concentrating or making decision} => {feeling anxious} 0.1246649 0.8230088 0.1514745 1.268522 186
## [108] {feeling anxious,
## no problems of bonding with baby,
## not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1152815 0.9772727 0.1179625 1.266804 172
## [109] {feeling anxious,
## not irritable towards baby or partner,
## sometimes feeling of guilt} => {standard appetite} 0.1132708 0.9768786 0.1159517 1.266293 169
## [110] {feeling anxious,
## not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1829759 0.9750000 0.1876676 1.263858 273
## [111] {irritable towards baby or partner,
## not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1038874 0.9748428 0.1065684 1.263654 155
## [112] {no problems with concentrating or making decision,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1012064 0.9741935 0.1038874 1.262812 151
## [113] {feeling anxious,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1166220 0.9720670 0.1199732 1.260056 174
## [114] {no problems of bonding with baby,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1052279 0.9691358 0.1085791 1.256256 157
## [115] {no problems of bonding with baby,
## not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1186327 0.9672131 0.1226542 1.253764 177
## [116] {irritable towards baby or partner,
## problems with concentrating or making decision,
## standard appetite} => {feeling anxious} 0.1045576 0.8125000 0.1286863 1.252324 156
## [117] {no troubles with sleeping at night,
## standard appetite} => {feeling anxious} 0.1702413 0.8115016 0.2097855 1.250786 254
## [118] {feeling anxious,
## irritable towards baby or partner,
## not feeling sad or tearful} => {standard appetite} 0.1152815 0.9608939 0.1199732 1.245572 172
## [119] {not irritable towards baby or partner,
## sometimes feeling of guilt} => {standard appetite} 0.1306971 0.9605911 0.1360590 1.245180 195
## [120] {not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1735925 0.9592593 0.1809651 1.243453 259
## [121] {irritable towards baby or partner,
## not feeling sad or tearful,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1052279 0.9573171 0.1099196 1.240936 157
## [122] {no problems of bonding with baby,
## not feeling anxious,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1032172 0.9565217 0.1079088 1.239905 154
## [123] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1474531 0.9565217 0.1541555 1.239905 220
## [124] {feeling anxious,
## not feeling sad or tearful} => {standard appetite} 0.2305630 0.9555556 0.2412869 1.238652 344
## [125] {not irritable towards baby or partner,
## sometimes problems of bonding with baby} => {feeling anxious} 0.1286863 0.8000000 0.1608579 1.233058 192
## [126] {not feeling of guilt,
## not feeling sad or tearful} => {standard appetite} 0.1916890 0.9501661 0.2017426 1.231666 286
## [127] {feeling anxious,
## sometimes feeling of guilt} => {standard appetite} 0.2164879 0.9472141 0.2285523 1.227840 323
## [128] {feeling anxious,
## no problems of bonding with baby,
## not feeling sad or tearful} => {standard appetite} 0.1313673 0.9468599 0.1387399 1.227381 196
## [129] {feeling anxious,
## irritable towards baby or partner,
## not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1025469 0.9444444 0.1085791 1.224249 153
## [130] {feeling anxious,
## irritable towards baby or partner,
## sometimes problems of bonding with baby} => {standard appetite} 0.1132708 0.9441341 0.1199732 1.223847 169
## [131] {feeling anxious,
## irritable towards baby or partner,
## not feeling of guilt} => {standard appetite} 0.1689008 0.9438202 0.1789544 1.223440 252
## [132] {irritable towards baby or partner,
## no troubles with sleeping at night} => {standard appetite} 0.1159517 0.9402174 0.1233244 1.218770 173
## [133] {feeling anxious,
## no problems with concentrating or making decision,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1246649 0.9393939 0.1327078 1.217703 186
## [134] {feeling anxious,
## no problems of bonding with baby,
## not feeling of guilt} => {standard appetite} 0.1347185 0.9392523 0.1434316 1.217519 201
## [135] {feeling anxious,
## sometimes feeling of guilt,
## sometimes problems of bonding with baby} => {standard appetite} 0.1119303 0.9382022 0.1193029 1.216158 167
## [136] {no problems of bonding with baby,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1012064 0.9378882 0.1079088 1.215751 151
## [137] {40-45,
## no problems of bonding with baby} => {standard appetite} 0.1005362 0.9375000 0.1072386 1.215248 150
## [138] {no problems of bonding with baby,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1635389 0.9348659 0.1749330 1.211833 244
## [139] {no problems of bonding with baby,
## not feeling of guilt} => {standard appetite} 0.1434316 0.9344978 0.1534853 1.211356 214
## [140] {no problems of bonding with baby,
## not feeling sad or tearful,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1032172 0.9277108 0.1112601 1.202558 154
## [141] {feeling anxious,
## irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1387399 0.9241071 0.1501340 1.197887 207
## [142] {irritable towards baby or partner,
## not feeling sad or tearful} => {standard appetite} 0.1306971 0.9198113 0.1420912 1.192318 195
## [143] {sometimes feeling of guilt,
## sometimes feeling sad or tearful} => {standard appetite} 0.1367292 0.9189189 0.1487936 1.191162 204
## [144] {feeling anxious,
## not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1286863 0.9186603 0.1400804 1.190826 192
## [145] {irritable towards baby or partner,
## not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1025469 0.9161677 0.1119303 1.187595 153
## [146] {no troubles with sleeping at night,
## sometimes feeling sad or tearful} => {standard appetite} 0.1072386 0.9142857 0.1172922 1.185156 160
## [147] {not feeling sad or tearful,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1273458 0.9134615 0.1394102 1.184087 190
## [148] {no problems of bonding with baby,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1709115 0.9107143 0.1876676 1.180526 255
## [149] {irritable towards baby or partner,
## not feeling of guilt} => {standard appetite} 0.1809651 0.9090909 0.1990617 1.178422 270
## [150] {feeling anxious,
## no problems with concentrating or making decision} => {standard appetite} 0.1735925 0.9087719 0.1910188 1.178008 259
## [151] {feeling anxious,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.2238606 0.9051491 0.2473190 1.173312 334
## [152] {no problems of bonding with baby,
## not feeling anxious,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1072386 0.9039548 0.1186327 1.171764 160
## [153] {no problems of bonding with baby,
## not feeling sad or tearful} => {standard appetite} 0.1930295 0.9028213 0.2138070 1.170295 288
## [154] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## not feeling sad or tearful} => {standard appetite} 0.1112601 0.9021739 0.1233244 1.169456 166
## [155] {feeling anxious,
## irritable towards baby or partner} => {standard appetite} 0.2540214 0.9002375 0.2821716 1.166946 379
## [156] {feeling anxious,
## no problems of bonding with baby} => {standard appetite} 0.1615282 0.8992537 0.1796247 1.165670 241
## [157] {not feeling sad or tearful} => {standard appetite} 0.3136729 0.8982726 0.3491957 1.164398 468
## [158] {not feeling of guilt,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1320375 0.8914027 0.1481233 1.155493 197
## [159] {no problems with concentrating or making decision,
## not feeling sad or tearful} => {standard appetite} 0.1333780 0.8844444 0.1508043 1.146474 199
## [160] {45-50,
## feeling anxious} => {standard appetite} 0.1152815 0.8820513 0.1306971 1.143371 172
## [161] {40-45,
## feeling anxious} => {standard appetite} 0.1300268 0.8778281 0.1481233 1.137897 194
## [162] {problems with concentrating or making decision,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1193029 0.8768473 0.1360590 1.136626 178
## [163] {no problems of bonding with baby,
## no problems with concentrating or making decision,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1038874 0.8757062 0.1186327 1.135147 155
## [164] {feeling anxious,
## sometimes feeling sad or tearful} => {standard appetite} 0.1581769 0.8740741 0.1809651 1.133031 236
## [165] {no problems with concentrating or making decision,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.2285523 0.8721228 0.2620643 1.130501 341
## [166] {45-50} => {standard appetite} 0.1581769 0.8708487 0.1816354 1.128850 236
## [167] {feeling anxious,
## problems of bonding with baby} => {standard appetite} 0.1715818 0.8707483 0.1970509 1.128720 256
## [168] {often problems with concentrating or making decision,
## sometimes feeling sad or tearful} => {standard appetite} 0.1005362 0.8670520 0.1159517 1.123928 150
## [169] {no problems with concentrating or making decision,
## sometimes feeling of guilt} => {standard appetite} 0.1179625 0.8627451 0.1367292 1.118346 176
## [170] {sometimes feeling of guilt,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1521448 0.8598485 0.1769437 1.114591 227
## [171] {no problems with concentrating or making decision,
## not feeling of guilt} => {standard appetite} 0.1112601 0.8556701 0.1300268 1.109174 166
## [172] {irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1494638 0.8544061 0.1749330 1.107536 223
## [173] {no problems of bonding with baby,
## no problems with concentrating or making decision} => {standard appetite} 0.1829759 0.8531250 0.2144772 1.105875 273
## [174] {irritable towards baby or partner,
## sometimes problems of bonding with baby} => {standard appetite} 0.1206434 0.8530806 0.1414209 1.105818 180
## [175] {feeling anxious,
## sometimes irritable towards baby or partner} => {standard appetite} 0.1005362 0.8522727 0.1179625 1.104771 150
## [176] {irritable towards baby or partner,
## problems with concentrating or making decision} => {standard appetite} 0.1286863 0.8495575 0.1514745 1.101251 192
## [177] {two or more days a week troubles with sleeping at night} => {standard appetite} 0.3619303 0.8477237 0.4269437 1.098874 540
## [178] {feeling anxious,
## irritable towards baby or partner,
## problems with concentrating or making decision} => {standard appetite} 0.1045576 0.8387097 0.1246649 1.087189 156
## [179] {not feeling sad or tearful,
## troubles with sleeping at night} => {standard appetite} 0.1005362 0.8379888 0.1199732 1.086255 150
## [180] {no problems with concentrating or making decision,
## not irritable towards baby or partner} => {standard appetite} 0.1025469 0.8360656 0.1226542 1.083762 153
## [181] {35-40,
## feeling anxious} => {standard appetite} 0.1260054 0.8355556 0.1508043 1.083101 188
## [182] {sometimes feeling of guilt} => {standard appetite} 0.2955764 0.8352273 0.3538874 1.082675 441
## [183] {irritable towards baby or partner,
## sometimes feeling sad or tearful} => {standard appetite} 0.1018767 0.8351648 0.1219839 1.082594 152
## [184] {feeling anxious} => {standard appetite} 0.5402145 0.8326446 0.6487936 1.079327 806
## [185] {sometimes feeling sad or tearful} => {standard appetite} 0.2466488 0.8306998 0.2969169 1.076806 368
## [186] {40-45} => {standard appetite} 0.1990617 0.8296089 0.2399464 1.075392 297
## [187] {no problems of bonding with baby} => {standard appetite} 0.3076408 0.8285199 0.3713137 1.073981 459
## [188] {not feeling of guilt,
## troubles with sleeping at night} => {standard appetite} 0.1099196 0.8282828 0.1327078 1.073673 164
## [189] {not feeling anxious,
## sometimes irritable towards baby or partner,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1058981 0.8229167 0.1286863 1.066717 158
## [190] {feeling anxious,
## often problems with concentrating or making decision} => {standard appetite} 0.2191689 0.8195489 0.2674263 1.062352 327
## [191] {problems of bonding with baby} => {standard appetite} 0.2184987 0.8190955 0.2667560 1.061764 326
## [192] {irritable towards baby or partner} => {standard appetite} 0.2982574 0.8105647 0.3679625 1.050706 445
## [193] {feeling anxious,
## not feeling of guilt} => {standard appetite} 0.2989276 0.8050542 0.3713137 1.043563 446
## [194] {no problems with concentrating or making decision,
## not feeling anxious,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.1038874 0.8031088 0.1293566 1.041041 155
Developed broad rules are good quality in terms of lift, confidence
and support, but are very broad. However, in the cases of medical data,
it is important to obtain a lot of rules. The detailed rules can give a
deep insight into the human behavior or symptoms and quickly diaganoze
the early symptoms of or for example depression. In my case many
different antecendents lead to the same rule cosequent (feeling anxious
and same appetite).
rules_analysis2<-sort(rules_second, by="lift", decreasing=TRUE)
knitr::kable(inspect(rules_analysis2))
## lhs rhs support confidence coverage lift count
## [1] {often problems with concentrating or making decision,
## standard appetite} => {feeling anxious} 0.2191689 0.9369628 0.2339142 1.444162 327
## [2] {not feeling of guilt,
## standard appetite} => {feeling anxious} 0.2989276 0.9083503 0.3290885 1.400061 446
## [3] {not feeling of guilt} => {feeling anxious} 0.3713137 0.8921095 0.4162198 1.375028 554
## [4] {irritable towards baby or partner,
## standard appetite} => {feeling anxious} 0.2540214 0.8516854 0.2982574 1.312722 379
## [5] {sometimes problems of bonding with baby,
## standard appetite} => {feeling anxious} 0.2071046 0.8442623 0.2453083 1.301280 309
## [6] {often problems with concentrating or making decision} => {feeling anxious} 0.2674263 0.8435518 0.3170241 1.300185 399
## [7] {feeling anxious,
## not feeling sad or tearful} => {standard appetite} 0.2305630 0.9555556 0.2412869 1.238652 344
## [8] {feeling anxious,
## sometimes feeling of guilt} => {standard appetite} 0.2164879 0.9472141 0.2285523 1.227840 323
## [9] {feeling anxious,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.2238606 0.9051491 0.2473190 1.173312 334
## [10] {feeling anxious,
## irritable towards baby or partner} => {standard appetite} 0.2540214 0.9002375 0.2821716 1.166946 379
## [11] {not feeling sad or tearful} => {standard appetite} 0.3136729 0.8982726 0.3491957 1.164398 468
## [12] {no problems with concentrating or making decision,
## two or more days a week troubles with sleeping at night} => {standard appetite} 0.2285523 0.8721228 0.2620643 1.130501 341
## [13] {two or more days a week troubles with sleeping at night} => {standard appetite} 0.3619303 0.8477237 0.4269437 1.098874 540
## [14] {sometimes feeling of guilt} => {standard appetite} 0.2955764 0.8352273 0.3538874 1.082675 441
## [15] {feeling anxious} => {standard appetite} 0.5402145 0.8326446 0.6487936 1.079327 806
## [16] {sometimes feeling sad or tearful} => {standard appetite} 0.2466488 0.8306998 0.2969169 1.076806 368
## [17] {no problems of bonding with baby} => {standard appetite} 0.3076408 0.8285199 0.3713137 1.073981 459
## [18] {feeling anxious,
## often problems with concentrating or making decision} => {standard appetite} 0.2191689 0.8195489 0.2674263 1.062352 327
## [19] {problems of bonding with baby} => {standard appetite} 0.2184987 0.8190955 0.2667560 1.061764 326
## [20] {irritable towards baby or partner} => {standard appetite} 0.2982574 0.8105647 0.3679625 1.050706 445
## [21] {feeling anxious,
## not feeling of guilt} => {standard appetite} 0.2989276 0.8050542 0.3713137 1.043563 446
After the increase in support level the numbers of developed rules
decreased and they become less detailed - that’s why for the first part
of analysis I would like to stick to the broad rules - first ones. The
first basked is more detailed and allows me to detected rules which
leads to other cosequent rules than feeling anxious and standard
appetite.
Graphical analysis of obtained rules
In this chapter I will focus on graphical interpretation of obtained
rules. As I mentioned in previous chapter developed rules are broad, but
provide the meaningful insight into rules, which can be very helpful in
early detection of the postpartum depression.
As was stated at the beginning the lift, support and confidence
levels for obtained results guearantee that rules are strong and
reliable. Which also is presented in the graph below - majority of rules
is located in the left corner of the graph which indicates low support
levels, low lift levels. We can also observe high confidence levels.
plot(rules_analysis, measure=c("support","lift"), shading="confidence", col=paletteInferno[c(3,5,7)], main="Scatter plot with the key characteristic for 194 rules")
## To reduce overplotting, jitter is added! Use jitter = 0 to prevent jitter.

Not only we can investigate the quality of the rules but also its
length. In the presented graph below it is worth noticing that majority
of obtained rules has length 3 and four, which means that the sum of the
antecedents and consequent in majority of rules is equal to 3 and 4, for
example below presented is the rule with order=4:
{not feeling anxious, sometimes irritable towards baby or partner, two or more days a week troubles with sleeping at night} => {standard appetite}
plot(rules_analysis, shading="order", control=list(main="Plot of confidence, support and order among 194 rules", col=paletteInferno[c(1,3,5,7)], jitter=0.1))

Paralllel cordinates plot is are also valuable tools for gaining
insights into the structure of the obtained rules. From this chart, the
length and position of each symptom (or attribute) can be easily
observed.
plot(rules_analysis, method="paracoord", control=list(reorder=TRUE))

The graph below should present the obtained rules in the graphical
way. However, for 194 rules it is hard to detect patterns. That’s why I
decided to take a deeper look into profile of women with the key
consequents.
plot(rules_analysis, method="graph")
