View source: R/partial.cor.trend.test.R
partial.cor.trend.test | R Documentation |
Performs a partial correlation trend test with either Pearson's or
Spearman's correlation coefficients (r(tx.z)
).
partial.cor.trend.test(x, z, method = c("pearson", "spearman"))
x |
a "vector" or "ts" object that contains the variable, which is tested for trend (i.e. correlated with time) |
z |
a "vector" or "ts" object that contains the co-variate, which will be partialled out |
method |
a character string indicating which correlation coefficient is to be computed. One of "pearson" (default) or "spearman", can be abbreviated. |
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.
An object of class "htest"
method |
a character string indicating the chosen test |
data.name |
a character string giving the name(s) of the data |
statistic |
the value of the test statistic |
estimate |
the partial correlation coefficient |
parameter |
the degrees of freedom of the test statistic in the case that it follows a t distribution |
alternative |
a character string describing the alternative hypothesis |
p.value |
the p-value of the test |
null.value |
The value of the null hypothesis |
Current Version is for complete observations only.
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.
cor
,
cor.test
,
partial.r
,
partial.mk.test
,
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.