partial.cor.trend.test: Partial Correlation Trend Test

View source: R/partial.cor.trend.test.R

partial.cor.trend.testR Documentation

Partial Correlation Trend Test

Description

Performs a partial correlation trend test with either Pearson's or Spearman's correlation coefficients (r(tx.z)).

Usage

partial.cor.trend.test(x, z, method = c("pearson", "spearman"))

Arguments

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.

Details

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.

Value

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 r(tx.z)

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

Note

Current Version is for complete observations only.

References

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.

See Also

cor, cor.test, partial.r, partial.mk.test,

Examples

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")


trend documentation built on Oct. 10, 2023, 9:06 a.m.