# Activity Recommendation Model Using Rank Correlation for Chronic Stress Management
## 2 Materials and Methods
### Detection Relation Using Correlation Coefficients  
The correlation analysis [9] is a method of analyzing linear relationships between two variables in statistics and probability theory. Two variables may be independent or correlated with each other. At this time, the relationship between the two variables is called a correlation. The correlation coefficient is a measure of identifying the degree of correlation, which allows you to understand the correlation between the two variables but not to identify the causal relationship. The types of correlation coefficients include [PERSON]'s correlation coefficient [10], [PERSON]'s rank correlation coefficient [11], and [PERSON]'s correlation coefficient [12]. Among them, the most commonly-used correlation coefficients are Pearson and Spearman. Pearson's correlation coefficient [10] is commonly used to find out the relationship between two variables. In statistics, the Pearson's correlation coefficient is a numerical value of quantifying the linear correlation between X and Y and has a value between \(-1\) and \(+1\). The values of \(+1\), \(0\), and \(-1\) mean perfect linear correlation, no relation, and negative linear correlation, respectively. The calculation method is to divide the covariance of two variables by the product of standard deviations. Figure 2 presents the correlation of variables to predict the weather. Figure 2 shows the correlation coefficients between RPCP, TMAX, TMIN, and RAIN. The variables used are as follows: PRCP means the amount of precipitation. TMAX means the maximum temperature for a day. TMIN means the minimum temperature for a day. RAIN means true and false for raining. This is TRUE if rain was observed on that day, or FALSE if it was not. The correlation coefficients are expressed in color according to the label on the right. It is blue as it gets closer to 1, red as it is \(-1\), and white as it is 0. For example, RAIN and TMAX show a moderate red color because they show a correlation of \(-0.4\). The same variable also appears blue because the correlation coefficient is unconditionally \(+1\). Compared to the Pearson coefficient, the Spearman coefficient is rank-based and independent of non-parameters and size. The Spearman rank correlation coefficient is a nonparametric measure of statistically measuring statistical dependence between the ranks of two variables. It evaluates whether  
Figure 1: Process of stress management service using the Perceived Stress Scale (PSS). to explain the relationship between two variables well using a monotonic function. The Spearman rank correlation coefficient between two variables is equal to the Pearson correlation coefficient between the rank values of the two variables. However, Pearson's correlation coefficient evaluates linear relationships between two variables, while Spearman evaluates their monotonic relationships [13]. Without duplicate values, a perfect Spearman rank correlation of +1 and -1 occurs when each variable is a perfect monotonic function of another variable. Pearson's correlation coefficient is calculated only when both variables are present. As a result, it is challenging to process missing values. The [PERSON]'s correlation coefficient, however, can perform better than Pearson because it calculates the basic rank even if there are missing values. Using the rank, it can also be used for ordinal rather than continuous variables. Taking advantage of these advantages, this paper uses the Spearman rank correlation coefficient. Formula (1) represents the formula of the [PERSON] rank correlation coefficient. \(d_{i}\) to the difference in the \(i\)th rank when sorting the values of two variables in order of size. \(n\) means the number of data. \[\text{P}=\frac{6\sum d_{i}^{2}}{n(n^{2}-1)}, \tag{1}\]  
[PERSON] et.al [14] proposed a decision tree and parallel implementation method based on [PERSON]'s correlation.