3

I would like to get cumulative data about opioid use after surgery on day 2 of use. I have the mean, SD for day 1 and for day 2.

My understanding for the means is I can add them together. When it comes to the SD I know I need to convert them to the variance, but given that this data is not independent, I am wondering if I am able to do this with mean, SD, and sample size?

EXAMPLE: Day 1 18.1 +/- 4.6 n=32 Day 2 16.6 +/- 5.5 n=32

  • Sample variance is $S^2 = \frac{1}{n-1}\sum_{i=1}^n X_i^2 - n\bar X^2.$ You can get the variance of total by solving for $\sum_{i=1}^n X_i^2$ in each sample separately, then combining these two sums of squares, combining means, combining sample sizes, and using first formula a third time to get $S^2$ for combined sample. // First formula is sensitive to rounding, so round **nothing** before your get combined $S^2.$ – BruceET Nov 04 '21 at 17:57
  • Here is simple example to try for practice: Using R as calculator: `set.seed(1234); a = round(rnorm(5, 20, 2));` `b = round(rnorm(10, 20, 2))`, then verify `var(a); var(b); var(c(a,b))` return $8.3, 1.788889, 3.52381.$ // Intermediate check: `sum(a^2); sum(b^2)` returns $1915, 3741$ – BruceET Nov 04 '21 at 18:21
  • Perhaps see [less-condensed version](https://math.stackexchange.com/questions/2971315/how-do-i-combine-standard-deviations-of-two-groups). – BruceET Nov 04 '21 at 18:36
  • In the less condensed version you posted it seems a bit different, i.e. that user wanted the mean age of the two groups where I would like to combine Day 1 and Day 2 from the same group together for a cumulative total (?cumulative of 34.7). Does this change anything, does this mean I need to add my variances together as well. – Vicki Archer Nov 04 '21 at 19:18
  • Why not try a toy example? Suppose you had two people who scored 2 and 1 before and 1 and 2 after. Cumulatively 3 and 3, mean 3 variance zero . Now suppose 2 and 1 before and 2 and 1 after, cumulative 4 and 2, again mean 3 but not zero variance. The time-point mean and variance are the same in both cases but the cumulative variance is different. Does that help or is your scenario different from what I assume? – mdewey Nov 05 '21 at 11:26

0 Answers0