PostPartum depression analysis

Introduction

Why Postpartum analysis is important - healthcare and social aspects

PPD is a major mental health issue affecting a significant percentage of new mothers around the world. It does not only affect the well-being of mothers but also the health, development, and emotional state of their infants. Understanding the underlying factors contributing to PPD is important for early identification, intervention, and support.

Postnatal depression happens within the first year after giving birth and it affects 10-15% women.1 The first symptoms of postnatal are very broad. Postpartum depression is sometimes misidentified with baby blues due to the similar symptoms. However, the PPD symptoms are typically greater severity and lasts longer. Unlike baby blues, which typically resolve within a few weeks, PPD can significantly impair a mother’s ability to care for her infant and manage everyday responsibilities.2

Postpartum depression is not only abour the symptoms and experiences - the study Correlates of Early Postpartum Depressive Symptoms showed that the risk of experience of the postpartum depression is correlated with the demographic and social support. Researchers also stated that “social support interventions during pregnancy reduce postnatal levels of depressive symptoms, particularly in women with a past history of depression”3.

For this reason, I concluded that examining the symptoms experienced by women with postpartum depression is a crucial area of study. Gaining knowledge from surveys and obtain valuable rules could help with the awarness campaigns development and motivate new mothers to not only observe the behavior of their infants, but also take care of theirs well-being.

The National Health Service (Great Britain) warned woman about several symptoms: feeling sad, low in mood or tearful, feeling agitated or irritable towards your partner, baby or other children, trouble sleeping at night – you may be awake even when your baby is sleeping, feelings of guilt or even suicide thoughts.4. Many of listed symptoms are also variables in my dataset, which proofs that my goal to developed associated rules in this dataset may provide some valuable insights and develop meaningful patterns.

Dataset

In this project, I will apply association rule to analyze patterns and relationships between various factors, which contribute to PPD. To my analyzes I will use dataset PostPartum Depression. It dataset of 1503 records from Chittagong Medical Hospital5, which was gathered through a Google Form survey among woman who experienced postpartum depression. The conducted survey was designed in form of closed questions with answers corresponding to the problems listed below.

  • Timestamp - time of starting the survey

  • Age - woman age range

  • Feeling sad or Tearful -

  • Irritable towards baby & partner

  • Trouble sleeping at night

  • Problems concentrating or making decision

  • Overeating or loss of appetite

  • Feeling anxious

  • Feeling of guilt

  • Problems of bonding with baby

  • Suicide attempt

Main goal

The main aim is to highlight the most frequent combinations of risk factors that bear a significant influence on the development of postpartum depression and thus help health professionals in targeted prevention, early intervention, and personalized support. Then to compare obtained results with symptoms describe in literature and analyze the differences.

Methodology

  1. Data preparation - there is a need to adjust answers Yes/No/Sometimes to “feeling anxious”/“not feeling anxious”/“sometimes feeling anxious” to better understand rules and relations. Dataset needs to be prepared in the adjusted form - as a transactions. That’s why firstly I will focus on data cleaning, transforming and converting data into proper format.

  2. Association rule mining techniques - in this step I will focus on gathering informations about my data set. My main goal in this part it’s to obtain relationships present in my data set. I would like to detrieve patterns in the form of relations: If A, then B

  3. Interpretation of the outcomes and real-life outcomes, suggestions and discussion.

Dataset preparation

Dataset cleaning and transforming

The raw data is the dataset from google form with answers yes/no/sometimes/maybe and missing data. To obtain meaningful results and rules we need to transform the data to detrieve meaningful insights. That’s why in the first step I focused on converting dataset into proper format. I also narrowed the analyses - I dropped two columns - timestamp and suicide attempt. First one was useless from the prespective of association rules investigation. The suicide attempt on the other hand was missing a lot of values.

postpartum <- read.csv("/Users/aleksandraengel/Library/Mobile Documents/com~apple~CloudDocs/uczelnia/Unsupervised learning/association rules final project/post natal data clean.csv", sep=";")


kable(
  head(postpartum),
  caption = "Preview of Postpartum Dataset") %>%
  kable_styling(font_size = 12)
Preview of Postpartum Dataset
Timestamp Age Feeling.sad.or.Tearful Irritable.towards.baby…partner Trouble.sleeping.at.night Problems.concentrating.or.making.decision Overeating.or.loss.of.appetite Feeling.anxious Feeling.of.guilt Problems.of.bonding.with.baby Suicide.attempt
6/14/2022 20:02 35-40 Yes Yes Two or more days a week Yes Yes Yes No Yes Yes
6/14/2022 20:03 40-45 Yes No No Yes Yes No Yes Yes No
6/14/2022 20:04 35-40 Yes No Yes Yes Yes Yes No Sometimes No
6/14/2022 20:05 35-40 Yes Yes Yes Yes No Yes Maybe No No
6/14/2022 20:06 40-45 Yes No Two or more days a week Yes No Yes No Yes No
6/14/2022 20:06 30-35 No No Yes Yes Yes Yes No No Yes

The cleaned and prepared data is structured as follows:

kable(
  head(postpartum),
  caption = "Preview of cleaned Postpartum Dataset") %>%
  kable_styling(font_size = 12)
Preview of cleaned Postpartum Dataset
Age Feeling.sad.or.Tearful Irritable.towards.baby…partner Trouble.sleeping.at.night Problems.concentrating.or.making.decision Overeating.or.loss.of.appetite Feeling.anxious Feeling.of.guilt Problems.of.bonding.with.baby
35-40 feeling sad or tearful irritable towards baby or partner two or more days a week troubles with sleeping at night problems with concentrating or making decision overeating or loss appetite feeling anxious not feeling of guilt problems of bonding with baby
40-45 feeling sad or tearful not irritable towards baby or partner no troubles with sleeping at night problems with concentrating or making decision overeating or loss appetite not feeling anxious feeling of guilt problems of bonding with baby
35-40 feeling sad or tearful not irritable towards baby or partner troubles with sleeping at night problems with concentrating or making decision overeating or loss appetite feeling anxious not feeling of guilt sometimes problems of bonding with baby
35-40 feeling sad or tearful irritable towards baby or partner troubles with sleeping at night problems with concentrating or making decision standard appetite feeling anxious sometimes feeling of guilt no problems of bonding with baby
40-45 feeling sad or tearful not irritable towards baby or partner two or more days a week troubles with sleeping at night problems with concentrating or making decision standard appetite feeling anxious not feeling of guilt problems of bonding with baby
30-35 not feeling sad or tearful not irritable towards baby or partner troubles with sleeping at night problems with concentrating or making decision overeating or loss appetite feeling anxious not feeling of guilt no problems of bonding with baby

Dataset upload in proper format

For an association rules the uploading data is done with usage of package arules. The dataset is a list of transactions with adjusted format.

write.csv(postpartum, file="postpartumv2.csv")

postpartum_trans<-read.transactions("postpartumv2.csv", format="basket", sep=",", skip=0) 
postpartum_trans
## transactions in sparse format with
##  1492 transactions (rows) and
##  1527 items (columns)

Next I inspected the structure of the uploaded cleaned data. All sets are equal in size - 10 records in set and I was investigating 1500 observation, on based which I tried try to detect rules.

Rules development

In this step we will apply apriori algorithm. The most important characteristic in this approach are:

  • Support - how frequently an item set or rule occurs in the data. It’s a probability measure, measure the probability that the transaction will contain A and B.

  • Confidence - is the percentage in which the consequent is also satisfied upon particular antecedent. The proportion of transactions where the presence of item or item set A results in the presence of item or item set B.

  • Lift - controls for the support (frequency) of consequent while calculating the conditional probability of occurrence of {B} given {A}. Lift evaluates the strength of the association between A and B by comparing it to their independent occurrences.

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.

Most frequent items

In the first step I will investigate the more frequent items (symptoms) in dataset:

We can observe that the most frequent observations are: standard appetite, feeling anxious and two or more days a week troubles with sleeping at night. That means that among the interviewed women who experienced postpartum depression those were the most common symptoms. The first observed - standard appetite is actually a good symptom, while others can be an alarming symptoms.

itemFrequencyPlot(postpartum_trans, topN=10, type="relative", col=paletteInferno[3], border=paletteInferno[3], las=1, cex.names=0.7, ylim = c(0, 1))

Now I will analyze the cross tables for most frequent patterns.

support

Table below respresents the support of the intemsets. It allows to get better understanding between items - for example the value of itemset of {standard appetite, feeling anxious} indicates that this itemset appears in 54% of all transactions in the dataset.

stab<-crossTable(postpartum_trans, measure="support", sort=TRUE)[1:10,1:10]
stab_rounded <- round(stab, 2)
kable(stab_rounded)
standard appetite feeling anxious two or more days a week troubles with sleeping at night not feeling of guilt no problems with concentrating or making decision no problems of bonding with baby irritable towards baby or partner sometimes problems of bonding with baby sometimes feeling of guilt feeling sad or tearful
standard appetite 0.77 0.54 0.36 0.33 0.31 0.31 0.30 0.25 0.30 0.21
feeling anxious 0.54 0.65 0.25 0.37 0.19 0.18 0.28 0.27 0.23 0.23
two or more days a week troubles with sleeping at night 0.36 0.25 0.43 0.15 0.26 0.17 0.17 0.16 0.18 0.13
not feeling of guilt 0.33 0.37 0.15 0.42 0.13 0.15 0.20 0.15 0.00 0.12
no problems with concentrating or making decision 0.31 0.19 0.26 0.13 0.39 0.21 0.11 0.12 0.14 0.13
no problems of bonding with baby 0.31 0.18 0.17 0.15 0.21 0.37 0.12 0.00 0.09 0.08
irritable towards baby or partner 0.30 0.28 0.17 0.20 0.11 0.12 0.37 0.14 0.10 0.10
sometimes problems of bonding with baby 0.25 0.27 0.16 0.15 0.12 0.00 0.14 0.36 0.17 0.21
sometimes feeling of guilt 0.30 0.23 0.18 0.00 0.14 0.09 0.10 0.17 0.35 0.16
feeling sad or tearful 0.21 0.23 0.13 0.12 0.13 0.08 0.10 0.21 0.16 0.35

lift

Now I moved to the analysis of lift. Lift value shows the strenght of the association between two variables. Each cell is the representation of the lift value for variables combination. For example we can observe that feeling anxious and not feeling of guilt has lift equal to 1.38 which indicates a postitive association - the presence of feeling anxious increase the probability of coccurance of the not feeling of guilt item.

Also, there are variable with no association - value 1.03 between no problems with concentrating or making decision and standard appetite suggest that those two variables are independent.

ltab<-crossTable(postpartum_trans, measure="lift", sort=TRUE)[1:10,1:10]
ltab_rounded <- round(ltab, 2)
kable(ltab_rounded)
standard appetite feeling anxious two or more days a week troubles with sleeping at night not feeling of guilt no problems with concentrating or making decision no problems of bonding with baby irritable towards baby or partner sometimes problems of bonding with baby sometimes feeling of guilt feeling sad or tearful
standard appetite NA 1.08 1.10 1.02 1.03 1.07 1.05 0.88 1.08 0.77
feeling anxious 1.08 NA 0.89 1.38 0.75 0.75 1.18 1.16 1.00 0.99
two or more days a week troubles with sleeping at night 1.10 0.89 NA 0.83 1.57 1.10 1.11 1.02 1.17 0.86
not feeling of guilt 1.02 1.38 0.83 NA 0.80 0.99 1.30 1.00 0.00 0.83
no problems with concentrating or making decision 1.03 0.75 1.57 0.80 NA 1.48 0.80 0.82 0.99 0.94
no problems of bonding with baby 1.07 0.75 1.10 0.99 1.48 NA 0.87 0.00 0.67 0.57
irritable towards baby or partner 1.05 1.18 1.11 1.30 0.80 0.87 NA 1.06 0.79 0.80
sometimes problems of bonding with baby 0.88 1.16 1.02 1.00 0.82 0.00 1.06 NA 1.29 1.62
sometimes feeling of guilt 1.08 1.00 1.17 0.00 0.99 0.67 0.79 1.29 NA 1.27
feeling sad or tearful 0.77 0.99 0.86 0.83 0.94 0.57 0.80 1.62 1.27 NA

Now, we can move to the finding rules. In the apriori algorithm firstly we set the support and confidence at the lowest level and than we will search for rules. If the algorithm won’t find rules we will be slowly increasing the confidence and support to find the desired basket of rules.

For now I will set the support at default level - 10% and confidence at 80%, that will be our starting point.

rules_first<-apriori(postpartum_trans, parameter=list(support=0.1, confidence=0.8))
## Apriori
## 
## Parameter specification:
##  confidence minval smax arem  aval originalSupport maxtime support minlen
##         0.8    0.1    1 none FALSE            TRUE       5     0.1      1
##  maxlen target  ext
##      10  rules TRUE
## 
## Algorithmic control:
##  filter tree heap memopt load sort verbose
##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
## 
## Absolute minimum support count: 149 
## 
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[1527 item(s), 1492 transaction(s)] done [0.00s].
## sorting and recoding items ... [27 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 4 5 done [0.00s].
## writing ... [194 rule(s)] done [0.00s].
## creating S4 object  ... done [0.00s].

Algorithm has found 194 rules. My goal in this analysis is to find the meaningful and strong rules. That’s why I decided to increase support to 0.2 to obtain stronger rules. I will keep confidence at 80% level, that level indicates that rules are true 80% of the time, which is relatively high score.

rules_second<-apriori(postpartum_trans, parameter=list(support=0.2, confidence=0.8))
## Apriori
## 
## Parameter specification:
##  confidence minval smax arem  aval originalSupport maxtime support minlen
##         0.8    0.1    1 none FALSE            TRUE       5     0.2      1
##  maxlen target  ext
##      10  rules TRUE
## 
## Algorithmic control:
##  filter tree heap memopt load sort verbose
##     0.1 TRUE TRUE  FALSE TRUE    2    TRUE
## 
## Absolute minimum support count: 298 
## 
## set item appearances ...[0 item(s)] done [0.00s].
## set transactions ...[1527 item(s), 1492 transaction(s)] done [0.00s].
## sorting and recoding items ... [25 item(s)] done [0.00s].
## creating transaction tree ... done [0.00s].
## checking subsets of size 1 2 3 done [0.00s].
## writing ... [21 rule(s)] done [0.00s].
## creating S4 object  ... done [0.00s].

Now I obtained 22 rules, which is a big improvement comparing to the previous result. The obtained rules are strong and frequent - 20% support, which means that the pattern is highly frequent in the data and 80% confidence which indicates that in 80% of transaction the antecedent leads to the consequent. This results means that I found the meaningful, quite strong rules, but still I obtained the broad set of rules.

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")

Analysis of Rule Antecedents and Consequents - Identifying Key Alarming Symptoms

To gain a deeper understanding of the initial symptoms and the associated rules within the analyzed dataset on postpartum depression, this part will focus on investigating the symptoms that are most likely to trigger negative consequent rules.

feeling_sad<-apriori(postpartum_trans, parameter=list(support=0.1, confidence=0.8), appearance=list(default="lhs", rhs="feeling sad or tearful"), control=list(verbose=F)) 
feeling_sad_by_lift<-sort(feeling_sad, by="lift", decreasing=TRUE)
inspect(head(feeling_sad))
##     lhs                                          rhs                        support confidence  coverage     lift count
## [1] {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
plot(feeling_sad, method="graph")

Now, we can observe that woman who feels sad or tearful sometimes have problems with bonding with baby, feeling anxious but are not irritable towards their baby or partner. The rule has 0.86 confidence - which indactes that developed rule is quite consequent, it’s also rare - support is 0.11. It has high lift level, which indicates that

feeling_irritable<-apriori(postpartum_trans, parameter=list(support=0.1, confidence=0.8), appearance=list(default="lhs", rhs="sometimes irritable towards baby or partner"), control=list(verbose=F)) 
feeling_irritable_by_confidence<-sort(feeling_irritable, by="confidence", decreasing=TRUE)
inspect(head(feeling_irritable_by_confidence))
##     lhs                                                          rhs                                             support confidence  coverage     lift count
## [1] {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
plot(feeling_irritable, method="graph")

As in the previous example the obtained rule is strong but rather rare. Women who are sometimes irritable towards partners don’t experience feeling anxious or problems with concentrating, but has problems with sleeping at night.

sleeping_troubles<-apriori(postpartum_trans, parameter=list(support=0.1, confidence=0.8), appearance=list(default="lhs", rhs="two or more days a week troubles with sleeping at night"), control=list(verbose=F)) 
sleeping_troubles_confidence<-sort(sleeping_troubles, by="confidence", decreasing=TRUE)
inspect(head(sleeping_troubles_confidence))
##     lhs                                                     rhs                                                         support confidence  coverage     lift count
## [1] {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
## [2] {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
## [3] {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
## [4] {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
## [5] {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
## [6] {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
plot(sleeping_troubles, method="graph")

Now we can observe two or more days a week troubles with sleeping at night can be caused by many different items. Woman who experience trouble with sleeping is also a woman who experience feeling of guilt, but has no problems with concentrating or no problems with bonding with the baby.

In the last part I would like to observe the rules with the consequent rule “feeling anxious”. This term is very broad and it may be not a very good measure to identify the postpartum depression symptoms.

feeling_anxious<-apriori(postpartum_trans, parameter=list(support=0.1, confidence=0.8), appearance=list(default="lhs", rhs="feeling anxious"), control=list(verbose=F)) 
feeling_anxious_confidence<-sort(feeling_anxious, by="confidence", decreasing=TRUE)
inspect(head(feeling_anxious_confidence))
##     lhs                                                          rhs                 support confidence  coverage     lift count
## [1] {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
## [2] {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
## [3] {not feeling of guilt,                                                                                                      
##      often problems with concentrating or making decision}    => {feeling anxious} 0.1628686  0.9918367 0.1642091 1.528740   243
## [4] {not feeling of guilt,                                                                                                      
##      often problems with concentrating or making decision,                                                                      
##      standard appetite}                                       => {feeling anxious} 0.1199732  0.9889503 0.1213137 1.524291   179
## [5] {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
## [6] {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

As we can observe - the number of antecedent in this itemset is wide - that can indicate the various feelings, problems can lead to feeling anxious. That’s why based on this analysis I can assume that feeling anxious question should be marked as alarming, but less significant than others.

As I was developing this project I was searching for some visuals and I’ve found the Senkey diagram. It is great to observe how many different combinations of symptoms corresponds to one consequent. In the diagram the line width should correspondence to the lift measure, however in my case there are too many lhs rules for this feature to be visible. This graph only confirmed that there are many rules antecedent leading to the same rule consequent.

sankey<-sankeyNetwork(
  Links=links, Nodes=nodes, 
  Source="source", Target="target", 
  Value="value", NodeID="name", 
  fontSize=7, nodeWidth=1, colourScale=JS("d3.scaleOrdinal(d3.schemeCategory10);"))

sankey

A similar diagram can be made for all the rules in which the consequent will be “standard appetite.” In the case of which even more variations of symptoms bring about the consequent “standard appetite.” This is contrary to what could have been expected from the analysis of symptoms described by organizations and existing literature. This frequency and the associations indicate a potential discrepancy between empirical patterns in this data set and theoretical expectations derived from earlier studies.

sankey_apetite<-sankeyNetwork(
  Links=links, Nodes=nodes, 
  Source="source", Target="target", 
  Value="value", NodeID="name", 
  fontSize=7, nodeWidth=1, colourScale=JS("d3.scaleOrdinal(d3.schemeCategory10);"))

sankey_apetite

Rules evaluation

In cases when a numerous rules antecedents lead to the same consequent, it is worth to evaluate the quality of developed rules. In this section of repoport I will focus on examining the quality of the most frequent itemsets. This analysis is particularly noteworthy due to the characteristics of the “standard appetite” symptom. n the literature I have reviewed, as well as on health organization websites, one of the most frequently mentioned symptoms is a change in appetite. This discrepancy between the observed frequent itemsets and the theoretical emphasis on appetite changes it’s worth investigating.

To check the quality of the rules I will use two functions:

  • is.significant() - this function helps to identify the statistically meaningful patterns among the generated rules. It uses statistical tests to analyze the significance, that’s why the significance level is important feature to specify. In my analysis the significance level will be set as 5%.

  • is.maximal() - checks if the set is maximal. It is maximal if it doesn’t contain superset. Maximal superset is a maximal rule, which include all relevant items and cannot be extend without loosing the quality. In this case it will be useful to check wheter obtained rules are maximal, but in terms of the medical data we want to develop even detailed patterns. That’s why

  • is.redundant() - the rule is redundant if we can detrieve it from other rules with higher confidence or support levels or if it doesn;t provide the meaninful insight into data comparing to other developed rules.

All methods contribute to reducing the number of similar, frequent rules, helps to provide the clear results. For this reason, I decided to apply them in two cases in my analysis - rules with the consequent of “standard appetite” and rules with the consequent of “feeling anxious”. This approach allows for a more focused analysis of these particular symptoms, ensuring that only the most distinct and meaningful associations are considered.

In the first step I will observe the rules with feeling anxious consequent.

is.significant(feeling_anxious, rules_first, alpha=0.05)
##  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [16] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [31] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## [46] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
inspect(feeling_anxious[is.maximal(feeling_anxious)==FALSE])
##      lhs                                                          rhs                 support confidence  coverage     lift count
## [1]  {often problems with concentrating or making decision}    => {feeling anxious} 0.2674263  0.8435518 0.3170241 1.300185   399
## [2]  {not feeling of guilt}                                    => {feeling anxious} 0.3713137  0.8921095 0.4162198 1.375028   554
## [3]  {no troubles with sleeping at night,                                                                                        
##       often problems with concentrating or making decision}    => {feeling anxious} 0.1568365  0.9629630 0.1628686 1.484236   234
## [4]  {no troubles with sleeping at night,                                                                                        
##       sometimes problems of bonding with baby}                 => {feeling anxious} 0.1313673  0.9245283 0.1420912 1.424996   196
## [5]  {no troubles with sleeping at night,                                                                                        
##       not feeling of guilt}                                    => {feeling anxious} 0.1193029  0.8811881 0.1353887 1.358195   178
## [6]  {no troubles with sleeping at night,                                                                                        
##       standard appetite}                                       => {feeling anxious} 0.1702413  0.8115016 0.2097855 1.250786   254
## [7]  {irritable towards baby or partner,                                                                                         
##       problems with concentrating or making decision}          => {feeling anxious} 0.1246649  0.8230088 0.1514745 1.268522   186
## [8]  {often problems with concentrating or making decision,                                                                      
##       sometimes problems of bonding with baby}                 => {feeling anxious} 0.1280161  0.8603604 0.1487936 1.326093   191
## [9]  {not feeling of guilt,                                                                                                      
##       often problems with concentrating or making decision}    => {feeling anxious} 0.1628686  0.9918367 0.1642091 1.528740   243
## [10] {often problems with concentrating or making decision,                                                                      
##       standard appetite}                                       => {feeling anxious} 0.2191689  0.9369628 0.2339142 1.444162   327
## [11] {not irritable towards baby or partner,                                                                                     
##       sometimes feeling of guilt}                              => {feeling anxious} 0.1159517  0.8522167 0.1360590 1.313541   173
## [12] {not irritable towards baby or partner,                                                                                     
##       sometimes problems of bonding with baby}                 => {feeling anxious} 0.1286863  0.8000000 0.1608579 1.233058   192
## [13] {irritable towards baby or partner,                                                                                         
##       not feeling sad or tearful}                              => {feeling anxious} 0.1199732  0.8443396 0.1420912 1.301400   179
## [14] {not feeling of guilt,                                                                                                      
##       not feeling sad or tearful}                              => {feeling anxious} 0.1876676  0.9302326 0.2017426 1.433788   280
## [15] {irritable towards baby or partner,                                                                                         
##       sometimes problems of bonding with baby}                 => {feeling anxious} 0.1199732  0.8483412 0.1414209 1.307567   179
## [16] {not feeling of guilt,                                                                                                      
##       sometimes problems of bonding with baby}                 => {feeling anxious} 0.1400804  0.9330357 0.1501340 1.438109   209
## [17] {sometimes problems of bonding with baby,                                                                                   
##       standard appetite}                                       => {feeling anxious} 0.2071046  0.8442623 0.2453083 1.301280   309
## [18] {irritable towards baby or partner,                                                                                         
##       not feeling of guilt}                                    => {feeling anxious} 0.1789544  0.8989899 0.1990617 1.385633   267
## [19] {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
## [20] {irritable towards baby or partner,                                                                                         
##       standard appetite}                                       => {feeling anxious} 0.2540214  0.8516854 0.2982574 1.312722   379
## [21] {no problems of bonding with baby,                                                                                          
##       not feeling of guilt}                                    => {feeling anxious} 0.1434316  0.9344978 0.1534853 1.440362   214
## [22] {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
## [23] {not feeling of guilt,                                                                                                      
##       standard appetite}                                       => {feeling anxious} 0.2989276  0.9083503 0.3290885 1.400061   446
## [24] {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
## [25] {irritable towards baby or partner,                                                                                         
##       not feeling sad or tearful,                                                                                                
##       standard appetite}                                       => {feeling anxious} 0.1152815  0.8820513 0.1306971 1.359525   172
## [26] {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
## [27] {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
## [28] {not feeling of guilt,                                                                                                      
##       not feeling sad or tearful,                                                                                                
##       standard appetite}                                       => {feeling anxious} 0.1829759  0.9545455 0.1916890 1.471262   273
## [29] {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
## [30] {irritable towards baby or partner,                                                                                         
##       not feeling of guilt,                                                                                                      
##       standard appetite}                                       => {feeling anxious} 0.1689008  0.9333333 0.1809651 1.438567   252
## [31] {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
## [32] {no problems of bonding with baby,                                                                                          
##       not feeling of guilt,                                                                                                      
##       standard appetite}                                       => {feeling anxious} 0.1347185  0.9392523 0.1434316 1.447691   201
## [33] {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

As for the first parameter we can observe that at the significance level of 5% all rules are significant. That inidcates that the rules have a high levels of confidence and are good quality.

Additionally, for the is.maximal function we can observe that majority of rules with consequent rule “feeling anxious” are not maximal. This suggest that many of these rules are subsets of more general rules. They may be significant individually but overall they aren’t a representation of the most frequent patterns. It is not surprising, due to my decision with sticking with the higher number of developed rules. As the result I developed more detailed, but not the most frequent rules.

is.redundant(feeling_anxious)
##  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE  TRUE  TRUE
## [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE
## [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE  TRUE  TRUE
## [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE

In my case I only obtained 2 redundant rules for feeling anxious itemset. That means that the majority of obtained rules are unique and positively contributes to gaining the deeper knowledge of the dataset. It provides the unique information that wasn’t delivered from other rules.

Overall the quality of the information provided by 194 rules is very good, however some of the obtained results can be narrowed in terms of maximal measure. The results provides the unique insights which allows me to understand some, even not very frequent patterns among the feelings that are experienced by woman with postpartum depression. When it comes to feeling anxious it is a very broad feeling and it’s not directly linked with postpartum depression. Anxiety is a common emotion, that’s why it’s not surprising that in my research it was an item of many rules.

Next, I would like to move to the next symptom - standard appetite. The unchanged appetite in the majority of the rules was the surprising discovery at first, but after the deeper research I discovered that may be some reasons to support this rule. According to the article “Assessment of Postpartum Depressive Symptoms: The Importance of Somatic Symptoms and Irritability” by Williamson, O’Hara and Watsan, changes in the appetite can vary. We need to take into consideration the important factor - new mothers usually needs additional 670 kcal due to the breastfeeding6. On the other hands are woman who stopped breastfeeding and they can experience the loss of the appetite. The variability in eating patterns7 of new mothers can lead to the uncertainty about wheter changes in the appetite can actually be a postpartum depression symptom.

is.significant(same_appetite, rules_first, alpha=0.05)
##  [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [13]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [25]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [37]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [49]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [61]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [73]  TRUE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
## [85]  TRUE  TRUE  TRUE  TRUE
inspect(same_appetite[is.maximal(same_appetite)==FALSE])
##      lhs                                                          rhs                   support confidence  coverage     lift count
## [1]  {45-50}                                                   => {standard appetite} 0.1581769  0.8708487 0.1816354 1.128850   236
## [2]  {40-45}                                                   => {standard appetite} 0.1990617  0.8296089 0.2399464 1.075392   297
## [3]  {problems of bonding with baby}                           => {standard appetite} 0.2184987  0.8190955 0.2667560 1.061764   326
## [4]  {sometimes feeling sad or tearful}                        => {standard appetite} 0.2466488  0.8306998 0.2969169 1.076806   368
## [5]  {not feeling sad or tearful}                              => {standard appetite} 0.3136729  0.8982726 0.3491957 1.164398   468
## [6]  {sometimes feeling of guilt}                              => {standard appetite} 0.2955764  0.8352273 0.3538874 1.082675   441
## [7]  {irritable towards baby or partner}                       => {standard appetite} 0.2982574  0.8105647 0.3679625 1.050706   445
## [8]  {no problems of bonding with baby}                        => {standard appetite} 0.3076408  0.8285199 0.3713137 1.073981   459
## [9]  {two or more days a week troubles with sleeping at night} => {standard appetite} 0.3619303  0.8477237 0.4269437 1.098874   540
## [10] {feeling anxious}                                         => {standard appetite} 0.5402145  0.8326446 0.6487936 1.079327   806
## [11] {irritable towards baby or partner,                                                                                           
##       problems with concentrating or making decision}          => {standard appetite} 0.1286863  0.8495575 0.1514745 1.101251   192
## [12] {not feeling sad or tearful,                                                                                                  
##       sometimes irritable towards baby or partner}             => {standard appetite} 0.1273458  0.9134615 0.1394102 1.184087   190
## [13] {no problems of bonding with baby,                                                                                            
##       sometimes irritable towards baby or partner}             => {standard appetite} 0.1709115  0.9107143 0.1876676 1.180526   255
## [14] {not irritable towards baby or partner,                                                                                       
##       sometimes feeling of guilt}                              => {standard appetite} 0.1306971  0.9605911 0.1360590 1.245180   195
## [15] {irritable towards baby or partner,                                                                                           
##       not feeling sad or tearful}                              => {standard appetite} 0.1306971  0.9198113 0.1420912 1.192318   195
## [16] {no problems of bonding with baby,                                                                                            
##       not feeling sad or tearful}                              => {standard appetite} 0.1930295  0.9028213 0.2138070 1.170295   288
## [17] {no problems with concentrating or making decision,                                                                           
##       not feeling sad or tearful}                              => {standard appetite} 0.1333780  0.8844444 0.1508043 1.146474   199
## [18] {not feeling of guilt,                                                                                                        
##       not feeling sad or tearful}                              => {standard appetite} 0.1916890  0.9501661 0.2017426 1.231666   286
## [19] {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
## [20] {feeling anxious,                                                                                                             
##       not feeling sad or tearful}                              => {standard appetite} 0.2305630  0.9555556 0.2412869 1.238652   344
## [21] {feeling anxious,                                                                                                             
##       sometimes feeling of guilt}                              => {standard appetite} 0.2164879  0.9472141 0.2285523 1.227840   323
## [22] {irritable towards baby or partner,                                                                                           
##       sometimes problems of bonding with baby}                 => {standard appetite} 0.1206434  0.8530806 0.1414209 1.105818   180
## [23] {irritable towards baby or partner,                                                                                           
##       not feeling of guilt}                                    => {standard appetite} 0.1809651  0.9090909 0.1990617 1.178422   270
## [24] {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
## [25] {feeling anxious,                                                                                                             
##       irritable towards baby or partner}                       => {standard appetite} 0.2540214  0.9002375 0.2821716 1.166946   379
## [26] {no problems of bonding with baby,                                                                                            
##       no problems with concentrating or making decision}       => {standard appetite} 0.1829759  0.8531250 0.2144772 1.105875   273
## [27] {no problems of bonding with baby,                                                                                            
##       not feeling of guilt}                                    => {standard appetite} 0.1434316  0.9344978 0.1534853 1.211356   214
## [28] {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
## [29] {feeling anxious,                                                                                                             
##       no problems of bonding with baby}                        => {standard appetite} 0.1615282  0.8992537 0.1796247 1.165670   241
## [30] {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
## [31] {feeling anxious,                                                                                                             
##       no problems with concentrating or making decision}       => {standard appetite} 0.1735925  0.9087719 0.1910188 1.178008   259
## [32] {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
## [33] {feeling anxious,                                                                                                             
##       not feeling of guilt}                                    => {standard appetite} 0.2989276  0.8050542 0.3713137 1.043563   446
## [34] {feeling anxious,                                                                                                             
##       two or more days a week troubles with sleeping at night} => {standard appetite} 0.2238606  0.9051491 0.2473190 1.173312   334
## [35] {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
## [36] {feeling anxious,                                                                                                             
##       irritable towards baby or partner,                                                                                           
##       not feeling sad or tearful}                              => {standard appetite} 0.1152815  0.9608939 0.1199732 1.245572   172
## [37] {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
## [38] {feeling anxious,                                                                                                             
##       no problems of bonding with baby,                                                                                            
##       not feeling sad or tearful}                              => {standard appetite} 0.1313673  0.9468599 0.1387399 1.227381   196
## [39] {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
## [40] {feeling anxious,                                                                                                             
##       not feeling of guilt,                                                                                                        
##       not feeling sad or tearful}                              => {standard appetite} 0.1829759  0.9750000 0.1876676 1.263858   273
## [41] {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
## [42] {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
## [43] {feeling anxious,                                                                                                             
##       irritable towards baby or partner,                                                                                           
##       not feeling of guilt}                                    => {standard appetite} 0.1689008  0.9438202 0.1789544 1.223440   252
## [44] {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
## [45] {feeling anxious,                                                                                                             
##       no problems of bonding with baby,                                                                                            
##       not feeling of guilt}                                    => {standard appetite} 0.1347185  0.9392523 0.1434316 1.217519   201
## [46] {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

As we can observe for standard appetite almost all rules are significant at the significance level 5% - there is only one that’s not a significant one:

no problems with concentrating or making decision, not feeling anxious, two or more days a week troubles with sleeping at night => standard appetite

As for the maximal it’s almost the same situation as in the feeling anxious case - majority of rules with consequent rule “standard appetite” are not maximal. As I discussed above - that is due to the fact that I decided to proceed with the highest number of values without increasing the confidence level. I did it due to the fact I wasn’t searching for the most broad rules, I was searching for detailed rules, which can provide deep understanding of the sympotms and it outcomes.

is.redundant(same_appetite)
##  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
## [25] FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE
## [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [49] FALSE FALSE FALSE FALSE  TRUE FALSE  TRUE FALSE  TRUE  TRUE  TRUE FALSE
## [61] FALSE FALSE  TRUE FALSE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
## [73] FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
## [85] FALSE FALSE  TRUE FALSE

In standard apetite case I obtained more redundant rules. That means that there are rules that doesn’t provide unique insight into data. This rules could be removed to obtained only meaningful, maximal and unique rules.

Summary

In this paper, I applied the Apriori algorithm to generate association rules to identify patterns of symptoms among women who experienced postpartum depression. The rules developed were both comprehensive and detailed, due to the decision of proceeding withe the biggest itemset of rules. This approach was crucial to gaining a detailed understanding of the findings, taking into consideration the uniqueness and complexity of this mental disorder.

The analysis revealed that the most frequently observed symptoms were standard appetite and feelings of anxiety. Furthermore, a deeper investigation indicated that, despite the broad range of factors contributing to these symptoms, the results were both statistically significant and unique. Overall, the quality of the rules was robust, as evidenced by strong support, confidence, and lift measures.

The results were supported by the existing literature and article on mental-health support portals. Initially there was one finding that surprised me at first - the most frequent item was standard appetite, which wasn’t consistent with the literature. However after the further investigation it became more understandable and rational. Most of the trends align with the theories I’ve found during the literature review.

The decision about keeping the majority of the rules unfortunately didn’t allowed me to develop the majority of the graphs we discussed during classes. Due to this reason I decided to search for graphs more suitable for my data and rules. That’s why I implemented Sankey’s diagram8.


  1. https://www2.hse.ie/conditions/postnatal-depression/↩︎

  2. https://www.mayoclinic.org/diseases-conditions/postpartum-depression/symptoms-causes/syc-20376617↩︎

  3. https://link.springer.com/article/10.1007/s10995-005-0048-9↩︎

  4. https://www.nhs.uk/mental-health/conditions/post-natal-depression/symptoms/↩︎

  5. unfortunately the dataset is from kaggle, however I did some research and according to the details it was performed in university hospital in Chittagong in educational purposes↩︎

  6. Dewey K. G. (1997). Energy and protein requirements during lactation. Annual Review of Nutrition, 17, 19-36.↩︎

  7. Lipsky L. M., Strawderman M. S., Olson C. M. (2012). Maternal weight change between 1and 2 years postpartum: The importance of 1 year weight retention. Epidemiology, 20, 1496-1502.↩︎

  8. the main tutorial used http://cran.nexr.com/web/packages/networkD3/README.html, debbuging with chat GPT↩︎