I've got two sets of data from some fluorescent cells.

The first set is when the cells don't have their fluorescence switched on, but they are still faintly glowing.

The second set is when they do have their fluorescence switched on.

I ran each of the two experiments three times, so n=3, and I therefore have a mean for each dataset and a SD.

I need to subtract the non-switched on set from the switched on set in order to determine the amount of fluorescence that arises as a result of being switched on.

How do I then calculate the SD of the final value?

I know that for discrete random variables,

$$ E[X+Y] = E[X] + E[Y] $$

So I assume that holds true for subtraction as well, but I can't find the rules for continuous random variables, as these are.

Example data for one data point:

```
ON OFF
MEAN: 33956.6666 3835.66667
SD: 457.47301 38.0905
```

## Best Answer

Basic properties of expectation and variance give us:

$$E[aX+bY] = aE[X]+bE[Y]$$

$$\text{Var}[aX+bY] = a^2\text{Var}[X]+b^2\text{Var}[Y]+2ab\text{Cov}[X,Y]$$

a) With $a=1,\,b=-1$ and assuming independence, we have

$$E[X-Y] = E[X]-E[Y]$$

$$\text{Var}[X-Y] = \text{Var}[X]+\text{Var}[Y]$$

Taking square roots yields the result for the standard deviation.

b) With $a=1,\,b=-1$ in the presence of dependence, we have

$$E[X-Y] = E[X]-E[Y]$$

$$\text{Var}[X-Y] = \text{Var}[X]+\text{Var}[Y]-2 \text{Cov}[X,Y]$$

It's not clear to me how the dependence is operating (your description doesn't make it clear which observations are correlated).

If two sets of means are dependent (as "pairs of means"), you could treat the means as paired data.

(Outside of that you might need to look at random effects/mixed effects models.)