# How to derive p value of whether there exists a difference (given before and after correlation, averages, and standard deviations)?

I am trying to solve the following question:

A chemical refining process is monitored before and after the plant is shut down and cleaned. At 40 randomly selected outputs, before cleaning, contaminants are measured at an average of 210ppm (SD52); afterwards, at the same outputs, contaminant sare measured at an average of 196ppm (SD 56).The correlation between contaminants before and after cleaning is 0.15. What best describes the p-value for a hypothesis test, checking whether there was a difference in contaminant levels associated with the cleaning?

A. 0.2 < p−value < 0.32
B. 0.68 < p−value < 0.8
C. 0.32 < p−value < 0.68
D. 0.01 < p−value < 0.2
E. 0.8 < p−value < 0.99


This is what I have tried so far:

The null hypothesis is: There is not a difference in contaminant levels associated with the cleaning.

Z-score: This is the part I am totally confused about. I know the z-score formula is:

$$z = \frac{\bar{X} - \mu}{\frac{\sigma}{\sqrt(n)}}$$

However, what exactly do I put for $$\bar{X}$$, $$\mu$$, $$\sigma$$, and $$\sqrt{n}$$ given two different values (before and after) in the question? I am also confused as to what the correlation has to do with determining the p-value too.

You need to apply the formula

$$z = \frac{\bar X_1 - \bar X_2}{\sqrt{\frac{\sigma_1^2 + \sigma_2^2}{n}}}$$

where $$\bar X_1$$, $$\bar X_2$$ are the mean contamination before and after the cleaning and $$\sigma_1$$, $$\sigma_2$$ the corresponding standard deviation. Under the null hypothesis, this statistic follows a z-distribution. Correlation is irrelevant to the computation of p value.

The formula

$$z = \frac{\bar X - \mu}{\frac{\sigma}{\sqrt{n}}}$$

that you refer is correct and useful in case you have the entire data set. In that case you would be able to compute for each one plant the difference of contaminants before and after the cleaning. Then, $$\bar X$$ would be the mean of the differences, $$\mu$$ denotes the assumed difference before and after (set usually to 0) while $$\sigma$$ would be the standard deviation of the differences.

• For paired data, you would usually use a paired test, which is equivalent to a one-sample test for the differences between the measurements before and after. You don't estimate $\sigma^2_1$ and $\sigma^2_2$ separately for that, but only the standard deviation of the differences. – Frans Rodenburg Dec 8 '19 at 14:17