Two sample t-test vs one sample t-test (use mean of another dataset) If I compare two dataset for difference using t-test. I am aware that I should use two sample t-test. However, what if I take the mean of one dataset and use one sample t-test instead?
From what I can see, it is conceptually valid in terms of the usage scenario of one sample t-test. However, I guess this is wrong (and this conversion yields different significance result).
I am a bit confused with this. Can someone share some insight? Thanks.
 A: In theory you could,  but your result would be imprecise since the mean you obtain from dataset 1 is not the real mean of the population, but rather an estimation.
You would also have to justify why you choose the mean of one of the datasets as a "true mean (whatever that refers to)" and you don't do the same with the other.
Anyway, for big enough samples there should not be too much of a difference, but I don't see any reason to avoid doing things properly! When working with Statistics, we already have to make a ton of "controversial" assumptions, so why make one more?
A: The hypothesis you're testing is about equality of two population means.
By replacing one population mean with a sample mean, you would treat as a known constant the random variable representing the mean of one of the samples, and would thereby substantially underestimate the variance of the difference.
As a result, you would inflate the significance level from the nominal one.
A quick example simulation in R suggests that for equal sample sizes and a nominal 5% significance level your true significance level (i.e. your actual type I error rate) is in the ballpark of 15-16% across a range of typical sample sizes between 20 and 200 -- triple what we  wanted it to be. It seems to be more than 5 times the desired level for a 1% test.
(We could compute the values these simulations estimate but it doesn't seem essential to discover their exact values)
To my astonishment, I have seen this same error made surprisingly frequently, even a few times by researchers. 

 n=20;rowMeans(replicate(10000;{x=rnorm(n);y=rnorm(n);c(t.test(x,y,var.equal=TRUE)$p.value,t.test(x,mu=mean(y))$p.value)})<.05)

(with only 10000 simulations I suggest running it multiple times to get a good sense of what the averages are -- or to increase the simulation size)
