# Unequal variances but equal means

Assume the sample ${(x_i)}_{i=1}^{n_1} \sim_{\text{iid}} {\cal N}(\mu, \sigma_1^2)$ is independent of the sample ${(y_i)}_{i=1}^{n_2} \sim_{\text{iid}} {\cal N}(\mu, \sigma_2^2)$. What are the available methods to get a confidence interval about the common mean $\mu$ ? In my case I have $n_1=n_2$. I would be satisfied by an answer for this case but I'm also interested in the general case.

• You should answer your own quetion as an answer not only as edit to post, so it is possible to upvote it (so removing from unanswered queue). – kjetil b halvorsen Sep 22 '15 at 10:23

I finally found a solution in this paper: On exact confidence intervals for the common mean of several normal populations by Philip L.H. Yua, Yijun Sunb, Bimal K. Sinha.

And I found the old code I used to get the CI based on Fisher's inversion method, whose details are given in the paper.

# simulate data
set.seed(666)
y1 <- rnorm(100, 5, .1)
y2 <- rnorm(100, 5, .3)
ybar1 <- mean(y1)
ybar2 <- mean(y2)
v1 <- var(y1)
v2 <- var(y2)
n1 <- length(y1)
n2 <- length(y2)

# product of p-values (denoted by P_i in the paper)
f <- function(mu){
pf(n1*(ybar1-mu)^2/v1, df1=1, df2=n1-1, lower.tail=FALSE)*pf(n2*(ybar2-mu)^2/v2, df1=1, df2=n2-1, lower.tail=FALSE)
}
# the 95%-confidence interval is given by the intersection points
curve(f(x), from=4.95, to=5.04)
abline(h=exp(-qchisq(0.95,4)/2), col="red")


# bounds of the confidence interval
g <- function(mu) f(mu)-exp(-qchisq(0.95,4)/2)
uniroot(g, c(4.94, 4.98))$root [1] 4.966296 uniroot(g, c(5, 5.06))$root
[1] 5.014669


## EDIT

Another method, actually a generalized confidence interval is given in Iyer & Patterson, "A recipe for constructing generalized pivotal quantities and generalized confidence intervals.

Are you looking for combining them using the inverse variance method to weight each measure prior to getting a common variance?

• See my edit for the link. I have adopted Fisher's method. Very easy actually ! – Stéphane Laurent Oct 22 '12 at 10:53
• @Stéphane Laurent: Unfortunately the link is behind a paywall, but I noticed a later paper that addressed the Behrens–Fisher problem which makes it interesting theoretically. Wondering what Fisher method they/you are referring to? – phaneron Oct 22 '12 at 14:28
• @phaneron ?? The link works well for me. – Stéphane Laurent Oct 22 '12 at 14:33
• @Stéphane Laurent: The paywall is letting you through but not me. – phaneron Oct 22 '12 at 15:39
• @phaneron Ok. So type the title of the paper in Google and will find it for free. – Stéphane Laurent Oct 22 '12 at 16:50