3
$\begingroup$

I have two data series (not stationary) and I would like to see if the mean of series 1 is significantly different when a certain condition (on the other series) is met. The theory is that when series 2 reaches a value greater than 100, the value of series 1 declines.

I've done the following: I've broken the data down into chunks, where each chunk represents a time period during which all the data in series 2 were either below or above 100. I then compare the means of series 1 in each chunk with the mean in the next chunk using the two sample T test to see if the mean of series 1 is lower when series 2 is greater than 100, and higher when series 2 is less than 100.
For example:

Obs Series1 Series2  
1    0.05     50  
2    0.03     80  
3    -0.4     30  
4    0.1      110  
5    0.03     105  
6    0.12     90  
7    -0.3     92  
8    0.11     100 
9    0.2      120

The first chunk would be the first 3 observations (all less than 100, and the second chunk the next 2 (both greater than 100). I would compare the means of series 1 in these two chunks to one another to see if they are different using the two sample t test. I would then compare the mean of series 1 from observations 6&7 with the mean from observations 8&9.

Then, if I find that in the majority of the chunks the means are significantly different, I can conclude that series 1 is significantly lower when series 2 exceeds 100.

Does this methodology even make any sense? I'm sure there is a much better way, if anyone has suggestions for me, I'm just fairly new to this kind of analysis.

Thanks

Mike

$\endgroup$

1 Answer 1

5
$\begingroup$

First, a comment on your approach. The standard setting in which a t-test is used would require independence across observations. Meanwhile, your observations may have some time patterns (autocorrelations etc), if I understand it correctly. Then you would need some adjustment to account for that instead of using the plain-vanilla t-test.

Second, here is how I would try solving this problem. Call the first series $y$ and the second series $x$. I would build a model for $y$ incorporating a feature that you are interested in. Then I would test whether the estimated feature is statistically significant.

From the limited information you have provided, I am not able to suggest what kind of model that would be. But for the sake of an example, let me assume two things:
(1) $x$ is exogenous to $y$ ($y$ does not determine $x$);
(2) $y$ follows an ARIMA(p,d,q) model with an exogenous regressor.

Since you say that $y$ (and $x$) is not stationary, let $y$ ~ $I(1)$ as an example. Then $y$ ~ ARIMA(p,1,q) with an exogenous regressor. Here is how you incorporate the feature of interest: make the exogenous regressor the indicator of $x$ being above/below 100.

Now choose suitable AR and MA orders for your model (by using AIC, BIC, looking at model residuals etc. – follow the standard guidelines). Once done, you only need to look at the coefficient on the exogenous regressor and the associated p-value. This should answer you question of interest.

If $x$ is not exogenous to $y$, you would need to model $y$ and $x$ jointly. However, the logic is still the same. Once you have built a decent model that incorporates the feature of interest, just check the relevant coefficient and its significance.

$\endgroup$
6
  • $\begingroup$ Hi Richard, thanks for the reply. I have checked my data for autocorrelation and found none, indicating that they are, in fact, independent across time. That should be sufficient to allow me to use the two sample t-test, right? Thanks again! $\endgroup$
    – Mike
    Commented Oct 20, 2014 at 8:46
  • $\begingroup$ Absence of autocorrelations does not guarantee independence across time (there might still be dependence in higher order moments, for instance) but it gives some encouragement. And if your observation are truly independent across time, then I guess you could do the following. Gather all observations corresponding to $x<100$ in one subsample, all the other observations in another subsample and test whether the means of the two subpopulations (that correspond to the two subsamples) are equal using a t-test that allows for a different number of observations in the two subsamples. $\endgroup$ Commented Oct 20, 2014 at 12:53
  • $\begingroup$ The important idea is that you would like to account for any other systematic differences between the two subsamples so that your t-test result would indeed reflect the effect of the difference in means rather than some other effects (e.g. due to difference in variances etc.). $\endgroup$ Commented Oct 20, 2014 at 12:55
  • $\begingroup$ Ok, I undestand. Yes, that's exactly what I'm doing. I am using the two sample t-test, which allows for different standard deviations and sample sizes across the two sub samples. Cool, thanks Richard! $\endgroup$
    – Mike
    Commented Oct 20, 2014 at 13:45
  • $\begingroup$ One more thought: if you believe that the only difference between the $y$'s is due to $x$'s being above of below 100, then why do you allow for different standard deviations between the two subsamples when doing the t-test? I would only allow for different standard deviations if I believed that the variance of $y$ depends on whether $x<100$. $\endgroup$ Commented Oct 20, 2014 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.