This function performs a partial correlation trend test using either
the "pearson" correlation coefficient, or the "spearman" rank
correlation coefficient (Hipel and McLoed (1994), p. 882).
The partial correlation coefficient
for the response variable "x" with time "t",
when the effect of the explanatory variable "z" is partialled out,
is defined as:
$$
r_{tx.z} = \frac{r_{tx} - r_{tz}~r_{xz}}
{\sqrt{1 - r_{tz}^2} ~ \sqrt{1-r_{xz}^2}}
$$
The H0: \(r_{tx.z} = 0\) (i.e. no trend for "x", when
effect of "z" is partialled out) is tested against the
alternate Hypothesis, that there is a trend for "x", when the effect of
"z" is partialled out.
The partial correlation coefficient is tested for significance with
the student t distribution on \(df = n - 2\) degree of freedom.