University of Minnesota, Twin Cities     School of Statistics     Stat 5601     Rweb

Stat 5601 (Geyer) Examples (Correlation)

Contents

General Instructions

To do each example, just click the "Submit" button. You do not have to type in any R instructions or specify a dataset. That's already done for you.

Kendall's Tau

Hypothesis Test

Example 8.1 in Hollander and Wolfe.

External Data Entry

Enter a dataset URL :

For comparison, the second line gives the usual parametric analysis based on assumption of population normality and using Pearson's product-moment correlation coefficient (what many textbooks just call correlation with no qualifying adjectives).

Point Estimate

Example 8.1 in Hollander and Wolfe.

External Data Entry

Enter a dataset URL :

Same thing, except that we don't have to bother with the alternative = "greater".

Confidence Interval

Unfortunately, cor.test doesn't do confidence intervals, so we have to do by hand in R.

Example 8.1 in Hollander and Wolfe.

External Data Entry

Enter a dataset URL :

For comparison, the second analysis (below the blank line) gives the usual parametric analysis based on assumption of population normality and using Pearson's product-moment correlation coefficient (what many textbooks just call correlation with no qualifying adjectives). A reference is Lindgren Statistical Theory, 4th ed., p. 427.

Spearman's Rho

Hypothesis Test

Unfortunately, the Spearman mode of the cor.test function doesn't do the right thing in the presence of ties.

To its credit, it says it doesn't do the right thing.

Hollander and Wolfe give a very bizarre correction for ties that actually changes the point estimate (not just its estimated asymptotic variance) for no reason they explain. Rather than do that, we will do an exact test, that uses a new perm function, which runs over all possible permutations.

Example 8.5 in Hollander and Wolfe.

External Data Entry

Enter a dataset URL :

Point Estimate and Confidence Interval

Spearman's rho doesn't actually estimate any population quantity of interest.

It does estimate φ defined on p. 405 in Hollander and Wolfe, but that's not a very interesting quantity.

Hence we don't consider it an estimator of anything and the question of confidence intervals is moot.