Let's say I want to test whether the average performance of two individuals who work together (let's say in the same room) is different to their performance when they would not have worked together.
I thought of using the following randomization procedure:
1) Calculate the average performance over the performances of the first $p_{i}$ and the second $p_{j}$ individual of a pair. Compute the test statistic as: \begin{equation}\widehat{\Delta}= \dfrac{1}{N}\sum\limits_{i=1}^{N} \dfrac{p_{i} + p_{j}}{2}\end{equation},
where $N$ is the number of pars.
2) Create counterfactual pairs by randomly creating pairs (which were never realized). Recompute the test statistic $\Delta_r$.
3) Repeat the second many, i.e., $R=5,000$, times. This generates a distribution of the test statistic with $5,000$ values.
In a next step, I want to calculate a $p$-value. I see how I can do this for a one sided test. If I, for example, want to test whether the average performance increased (due to the fact that individuals worked together), I can calculate the p-value as the share of permutations that result in a value of the test statistic that is greater than the actual (realized) test statistic. However, how do I calculate the p-value for a two sided test!
Your help is highly appreciated! Thank you!