Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation)Look and you shall find (a correlation) ; Permutation test for multiple correlation test statisticsPermutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) ; Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) ; Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)
Notice removed Draw attention by mvkorpel
Bounty Ended with Andrew M's answer chosen by mvkorpel
Tweeted twitter.com/#!/StackStats/status/534677304023064576
Notice added Draw attention by mvkorpel
Bounty Started worth 100 reputation by mvkorpel
added 3 characters in body
Source Link
inzl
  • 1.3k
  • 9
  • 18

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) ; Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) ; Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)
added 84 characters in body
Source Link
inzl
  • 1.3k
  • 9
  • 18

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case y and xnow. So I would permute y but keep X fixed. That would not simulate independent trials in C. If I break autocorrelations in X, then the concept of correlations over a time window is lost. Any advice?

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) Permutation test for multiple correlation test statistics .

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case y and xnow. So I would permute y but keep X fixed. That would not simulate independent trials in C. If I break autocorrelations in X, then the concept of correlations over a time window is lost. Any advice?

I have one variable measured once per time interval (say, once per year), and another variable measured periodically (say, once per day). The periodic measurements are autocorrelated.

I am interest in finding statistically significant correlations of the first variable with aggregates of the second variable over time periods. For example, the second variable could be aggregated as the arithmetic mean of observations over week3-week4. This setting is relevant, for instance, in tree growth analysis, where one variable could be annual width increment, and another variable - daily temperatures.

I was wondering how to account for multiple testing in this situation? I am aware of previous discussions focusing on permutation testing: Look and you shall find (a correlation) Permutation test for multiple correlation test statistics .

As I understand (How to choose the test statistic for permutation test?), in permutation testing one would like to break the relation between the potentially correlated variables, in my case - the yearly observation and an aggregate of daily observations. That would not simulate independent trials with respect to different time periods of aggregation. If I break autocorrelations in the daily observations, then the concept of correlations over a time window is lost. Any advice?

Here is a toy example in R. I measure correlations between the first variable, and an aggregate of the second variable over a time window. I would like to test, which of the correlations in C are significant.

# initialize
t <- 7 #length of time series
n <- 100 #number of observations
level <- 10 #magnitude parameter

#generate input data
X <- seq(1:t) #initialize dataset
for (j in 1:n)
{
  x <- rnorm(1)*level #starting point in time series
  for (i in 1:(t-1))
  {
    x <- c(x,x[i]+rnorm(1)) #one time series
  }
  X <-rbind(X,x) #a collection of time series
}  
X <- X[-1,] #remove extra line

#define target variable
y <- apply(X[,3:4],1,mean) +rnorm(n)

#compute correlations
C <- matrix(0,t,t)
for (start in 1:t)
{
  for (finish in start:t)
  {
    if ((finish-start)>0)
    {
      xnow <- apply(X[,start:finish],1,mean)
    }
    else
    {
      xnow <- X[,start:finish]
    }
    C[start,finish] <- cor(xnow,y)
  }
}

#resulting correlations
print(C)
added 351 characters in body; edited title
Source Link
inzl
  • 1.3k
  • 9
  • 18
Loading
Source Link
inzl
  • 1.3k
  • 9
  • 18
Loading