Ref:https://onlinecourses.science.psu.edu/stat464/print/book/export/html/12
The case before us is: response is continuous, variable is discrete. Example: If you intend to check whether the median of GPA is related to the position of the student sitting in the classroom,
Then the median of GPA is continuous, is the response variable, the position of the student sitting (before and after) is discrete, is the explanatory variable.
It is also a continuous case to consider explanatory variables, that is, to check the causal relationship between the two consecutive variables. Among them, we are most concerned about the strength and direction of the relationship.
First, we consider the case of linear correlation , calculating Pearson ' s correlation coefficient
Calculate Pearson ' s Correlation coefficient
Cor.test (x, y)
The results will give the coefficient cor, confidence interval, p-value
Calculate slope (least squares fitting)
> h=c (up, up, up) > W=c (172, 167, 145) > lm (W~H)
Note: Here is the use of y~x to fit, it should be possible to choose a different formula. In the result, the slope is-10.85.
Spearman ' s Rank Correlation
Using the rank value of two variables, the permutation calculation Pearson ' s, that is Spearman ' s
Kendall ' s Tau Rank Correlation
Measuring Association by counting the number of concordant and disconcordant pairs
Concordant Pairs
Applied Nonparametric STATISTICS-LEC9