Skip to content

Comparing the Means of Two Normal Distributions

3 messages · Lorenzo Isella, chuck.01, Greg Snow

#
Dear All,
A problem almost taken from a textbook: I have two independent samples  
(which are both assumed to come from a normal distribution).
The sample sizes are N1 and N2, the sample means are x1 and x2 and the  
sample standard deviations are s1 and s2 (the standard deviations are  
close).
I would like to conduct a two sample t-test with equal variances at  
alpha=0.05 (and then remove the assumption of equal variances).
I have come across several resources

http://bit.ly/WKGuHV
http://bit.ly/WKGwzG

but the difference here is that I have access only to the N,x and s for  
the two samples, NOT to the results of every observation (i.e I know for  
instance N1 x1 and s1, but I do not have the corresponding list of N1  
values).
Many thanks for any suggestions.
Best Regards

Lorenzo
#
I haven't put too much thought into this (and this has nothing to do with R),
but...

You have sufficient statistics, and are assuming a normal distribution,
therefore you can "recreate" the two samples using this information. 
Perhaps something like this: 

 N1 <- 100
 N2 <- 130
 x1 <- 30
 x2 <- 33
 s1 <- 1.01
 s2 <- 1.20
 X1 <- rnorm(n=N1, mean=x1, sd=s1)
 X2 <- rnorm(n=N2, mean=x2, sd=s2)

# then do a t.test
t.test(X1, X2)



Lorenzo Isella wrote

            
--
View this message in context: http://r.789695.n4.nabble.com/Comparing-the-Means-of-Two-Normal-Distributions-tp4650665p4650673.html
Sent from the R help mailing list archive at Nabble.com.