# Compare two (or more?) groups of regression coefficients

Short version: I need to compare two small (~10) groups of numbers, usual setup for a non-paired t-test, or Mann-Whitney. But -- the numbers come each with its own SE, and since the groups are small, this is presumably relevant. Question -- how do I take the individual SEs into account?

Longer version: There are two groups of patients, treatment and placebo. The test to assess the influence of the treatment involves making many (~100) measurements for a period of time, for each patient. Then an exponential decay curve is fitted into these measurements; the relevant outcome is the time constant of the decay. Since it's estimated from noisy measurements, it has a SE. How do I take the individual SEs into account when comparing the two groups?

Artificial example: is the mean of the (approximately estimated with given SEs) numbers in group A different from the mean of group B? $A=\{13\pm2,15\pm4,10\pm2\}$, $B=\{12\pm4,10\pm3,16\pm3,14\pm5\}$.

Follow-up: What if there are more than two groups?

The t-test can compare groups with different standard deviations. This is apparently also called Welch's t-test according to Wikipedia.

First, the calculate the combined means and variances of each group. Assuming two sets of observations of size $n_1$ and $n_2$ with means and variances $\mu_1,\mu_2,s_1^2,s_2^2$, the combined mean is simply

$$\mu = \frac{n_1\mu_1+n_2\mu_2}{n_1+n_2}$$

The combined variance becomes

$$s^2 = \frac{n_1(s_1^2+(\mu_1-\mu)^2)+n_2(s_2^2+(\mu_2-\mu)^2)}{n_1+n_2}$$

After which you can compare the means of the two groups with the t-test. The test statistic is $$T=\frac{\bar{X_1}-\bar{X_2}}{\sqrt{s_1^2/n_1+s_2^2/n_2}}$$ Which follows t distribution under the null hypothesis with degrees of freedom : $$\frac{ (s_1^2/n_1+s_2^2/n_2)^2}{\frac{s_1^4}{N_1^2(N_1-1)}+\frac{s_2^4}{N_2^2(N_2-1)})}$$ Where $N_1,N_2$ represent the degrees of freedom for each group, and $s_1,s_2$ their standard deviations.

For comparing multiple groups, you'll need to be more specific. What hypothesis do you want to test? That the estimations of the parameters (1/means for an exponential distribution) are all equivalent? Perhaps an F-test.

• Drew - the "$-$" in the denominator of that "$T$" statistic ... I'm pretty sure that should be a "$+$". – Glen_b -Reinstate Monica Mar 4 '14 at 6:46
• I know, but this is not related to my question -- I have a different SD for each element of each group. – AVB Mar 4 '14 at 16:19
• @Glen_b: yep, so I changed it. – AVB Mar 4 '14 at 16:22
• You're right, I forgot the + sign. – Drew75 Mar 5 '14 at 5:59
• @AVG the variance changes between each mesurement on the same patient? From the description it sounds like an exponential curve is fitted to each patient, then you're trying to see if the parameter of the two patients are the same (two variances). If you have multiple estimations with multiple variances, then you want an F-test from an ANOVA. – Drew75 Mar 5 '14 at 6:06