Performs a partial correlation trend test with either Pearson's or
Spearman's correlation coefficients (
partial.cor.trend.test(x, z, method = c("pearson", "spearman"))
a "vector" or "ts" object that contains the variable, which is tested for trend (i.e. correlated with time)
a "vector" or "ts" object that contains the co-variate, which will be partialled out
a character string indicating which correlation coefficient is to be computed. One of "pearson" (default) or "spearman", can be abbreviated.
An object of class "htest"
a character string indicating the chosen test
a character string giving the name(s) of the data
the value of the test statistic
the partial correlation coefficient
the degrees of freedom of the test statistic in the case that it follows a t distribution
a character string describing the alternative hypothesis
the p-value of the test
The value of the null hypothesis
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:
The H0:
The partial correlation coefficient is tested for significance with
the student t distribution on
Hipel, K.W. and McLeod, A.I. (1994), Time Series Modelling of Water Resources and Environmental Systems. New York: Elsevier Science.
Bahrenberg, G., Giese, E. and Nipper, J., (1992): Statistische Methoden in der Geographie, Band 2 Multivariate Statistik, Teubner, Stuttgart.
# NOT RUN {
data(maxau)
a <- tsp(maxau) ; tt <- a[1]:a[2]
s <- maxau[,"s"] ; Q <- maxau[,"Q"]
maxau.df <- data.frame(Year = tt, s =s, Q = Q)
plot(maxau.df)
partial.cor.trend.test(s,Q, method="pearson")
partial.cor.trend.test(s,Q, method="spearman")
# }
Run the code above in your browser using DataLab