## 5 Discussion  
The analysis and discussion of the results of the experiment with WSNs for monitoring sleep quality and vital signs in the elderly demonstrate significant improvements in several key areas. First, it was demonstrated through paired-sample hypothesis tests that all the metrics measured in the experiment generally improved. Subsequently, the chi-square  
Figure 8: Sieve diagram for the variables heart rate variability (HRV) and temperature (T). Figure 7: Sieve diagram for the variables heart rate (HR) and temperature (T). statistical analysis revealed a substantial improvement in BF and DS among the participants. Specifically, a 68% improvement was observed in breathing frequency, indicating that maintaining optimal levels can significantly enhance the total amount of sleep. Similarly, the deep sleep percentage improved by 68%, underscoring the importance of this sleep phase for overall sleep quality. Additionally, the experiment demonstrated a notable 70% reduction in snoring among participants, highlighting the importance of controlling this variable for better sleep quality. Although HR improvements were observed in 60% of the cases, this variable did not show a strong enough correlation to be considered a significant factor in sleep quality enhancement. Conversely, HRV emerged as one of the most crucial variables, with a 91% improvement, indicating that higher HRV levels are associated with better sleep quality and longer sleep duration. OS levels also improved in 59% of the participants, although the correlation with sleep quality was not as strong as for other variables. Nonetheless, higher oxygen saturation levels were linked to improved sleep quality. REMS showed an 85% improvement, demonstrating a direct relationship with increased total sleep hours. Temperature control in the sleeping environment was also found to be critical, as high temperatures negatively impacted sleep duration. Upon examining the patterns found with the association rules in the top five metrics resulting from the chi-square analysis, the following findings about the occurrence levels of each metric emerged:  
* It can be observed that the temperature levels found in the patterns without the sensor network are high and medium-high, while in the patterns found with the use of the sensor network, they are medium-high and medium-low. * It can be observed that the HRV level found in the patterns without the sensor network is low, while with the sensor network, high and medium-low levels were found. * It can be observed that the levels of total sleep hours without the sensor network are low and medium-low, while in the patterns found with the use of the sensor network, they are medium-high and high. * Both snoring and REM sleep present the same levels with and without the sensor network. REM sleep has medium-low and medium-high levels, while snoring has medium-low and low levels. It is known beforehand through chi-square tests that the five metrics used with the association rules improved significantly. However, improvements in the levels of occurrence in the patterns give us the possible dimension of the improvement. It can be observed that temperature improved by one level (25%) of occurrence in patterns with the sensor network. HRV improved by one and three levels (from 25% to 75%) of occurrence in patterns with the sensor network. Finally, total sleep hours improved by one or two levels (from 25% to 50%) of occurrence in patterns with the sensor network. The following findings on relevant associations are made:  
* Total sleep hours and snoring are inversely associated with and without the sensor network. It can be observed that with the sensor network, the pattern shows that people slept more and woke up less. * Temperature and snoring are associated with and without the sensor network. It can be observed that, while snoring remains medium-low in the observed patterns, its association with temperature decreased when using the sensor network. * The HRV and REM sleep metrics are associated with and without the sensor network.