# How to calculate percental change of two time series?

I have the two sets of data;

$A =$ 1.5010, 1.3118, 1.4219, 1.1650, 1.2720, 1.5421, 1.4211, 1.1832, 1.5378 1.4357, 1.2707, 1.2411, 1.4833, 1.5578

and

$B =$ 1.4039, 1.1912, 1.3596, 1.4168, 1.6269, 1.4635, 1.2787, 1.5260, 1.8160, 1.6103, 1.5315, 1.7100, 1.5181, 1.4049

The data is meant to represent the amount of negative words people use on a discussion forum before and after a political election. The higher value, the more negative the forum post is. $A$ is two weeks before the event, and $B$ is two weeks after, where $A_7$ is day 7, for example.

So I made a two sampled paired t-test in R where $$H_0: \mu_{A} - \mu_{B} = 0$$ $$H_a: \mu_{A} - \mu_{B} < 0$$

And I get a p-value = $0.04325$, so I reject null with 95% certainty, since $\alpha$ = $.05$

With this, I claim to say that there has been an increase of negative words since the mean is different, and seems to be larger two weeks after the election.

How do I calculate the actual percental increase?

• Would I take the diffrence between $A_i$ and $B_i$ divided by $B_i$ and then cumulative their sum?

Any help would be wonderful!

• (1) Could you explain what a "percentual increase" is intended to represent, since (apparently) the data are some kind of abstract scores? (2) Your p-value would be more trustworthy if you would first establish that the series of $A-B$ values is not serially correlated and without trend.
– whuber
Jun 2 '16 at 12:23
• @whuber, I would if possible like to tell how many percentages B has increased compared to A. Like, "after the election" the usage of negative words increased with e.g 3.14% if possible? If I make a crosscorrelation test "ccf" in R, they dont seem to be correlated at all. And they seem to be trend stationary aswell? Jun 2 '16 at 12:34
• Your question is difficult to interpret because (1) we know nothing about what $A$ and $B$ measure--or even if they possibly could be negative; and (2) although you tested differences between them you are now asking to interpret the result in terms of ratios. That inconsistency tells me there must be some additional, essential information you haven't yet revealed.
– whuber
Jun 2 '16 at 12:38
• Okay am sorry. They just count the amount of negative words in a forum post in a certain way. They cannot be negative! If we just view them as two sets of raw data. What is the approach to calculate the increase decrease? I dont have any more information. Jun 2 '16 at 13:05
• Since they obviously aren't counts, we have to ask: do they represent counts or proportions (and exactly how do they represent them)? This is important because if they are not counts, it's plausible that some of the data will be based on much larger counts (or many more posts) than other data, which would indicate the need for an appropriate weighting of the values in any meaningful statistical test.
– whuber
Jun 2 '16 at 13:28

I would set it up as a regression with number of negative words as the dependent variable, post length and election-indicator as independent variables. To get a "percent change" interpretation, and to avoid nonsensical results (e.g. A model allowing for zero length and positive negative word count), take the natural log of the negative word count and the length.

The model would be:

ln("negative word count") = b0 + b1 * ln(length) + b2 * "Election-Indicator"

Where the third term equals 1 if the observation was taken during electionseason season, 0 otherwise.

Your null hypothesis is that b2=0, alt hypothesis is b2>0. Check the significance (both statistical and practical) of b2.

Interpreting this is easy. Because we took the log of the dependent variable, we can say that a 1 unit change in the election-indicator variable (I.e. If it is election season) roughly corresponds to a b2% increase in negative words, adjusted for length. Because we took the log of length, we can interpret b1 as a 1 % increase in length corresponds with a b1% increase in negative words.

• These are good ideas. The fact that a negative word count can be zero, though, suggests you haven't gone quite far enough. Why not propose a Binomial (or maybe Poisson) generalized linear model? Interpretation is straightforward, the model is more plausible for these kinds of data, and there will no longer be any problems at all with logarithms.
– whuber
Jun 2 '16 at 18:46
• Poisson would also be an excellent choice. Good thinking! The distribution more naturally fits the problem (a number of occurrences over a measurable interval I.e. length). I'm not sure about other binomial Jun 2 '16 at 18:52
• ...binomial models though. A model like a logistic regression (with election season as dependent) would rely on the Bayesian maximum likelihood, which assumes a relationship. Furthermore, if the goal is to test a hypothesis, I imagine be regression would suffice, though I could be wrong. As a predictive model, Poisson might make an excellent candidate. Jun 2 '16 at 18:55