0
$\begingroup$

I am new to statistics with R. While doing a one sample t-test with R with population mean specified, I find the results on confidence levels given by R are misleading. Instead of giving confidence intervals on the basis of population mean, R is showing confidence intervals on the basis of sample mean (even when mu is specified). This is wrong and could mislead the user. The confidence levels given by R for t.test are applicable only when population mean is not known and the sample mean is taken as estimator for population mean. I am wondering why this is yet not corrected in R?

(I learnt business statistics 10-20 years back, but I have anyway verified now by bootstrapping t-statistics distribution and finding out and testing the t.test confidence levels manually to be sure about this misleading output. Though this should be obvious to learnt user, I still believe it should be documented in help page of R for t.test)

$\endgroup$
  • $\begingroup$ How do you know the population mean? $\endgroup$ – kjetil b halvorsen Feb 11 '19 at 10:51
  • 1
    $\begingroup$ I am voting to leave this open because, while it asks about R, it's really about the nature of a one sample t-test. $\endgroup$ – Peter Flom Feb 11 '19 at 11:36
  • $\begingroup$ It is also related to the concept of "distribution of confidence intervals" about which several books talk about while explaining t.test which is wrong, it is, like CLT, distribution of sample mean only, although through the distribution of t-statistic (standardized) and not distribution of confidence intervals. Also, we make inference about samples and cannot conclude on population parameter as some books seem to explain. Wikipedia on student's t distribution (section titled "Uses") could also be misleading in this respect $\endgroup$ – Murugesan Narayanaswamy Feb 11 '19 at 13:39
1
$\begingroup$

R is doing the right thing (and other programs do similarly). You have misunderstood what a one sample t test does.

In a one sample t-test, the population mean is the mean to which you are comparing your sample. By default, this will be 0, but you can specify other values.

It is meaningless to talk about the "confidence interval around the population mean" - if you know the mean of the whole population, you don't need a confidence interval.

As to the R documentation - well, I am not a fan of R's terse documentation style. I agree the documentation could be clearer.

So, suppose you wish to see if the mean of your sample is different from 40. Then you would specify mu = 40.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ When you specify mu=40, and if t.test gives a p value x less than 5%, then you can conclude this way: "If I take every possible sample of this size(<30) from population and calculate sample mean, only x% of samples will have a mean outside the 95% confidence range (while they also belong to same population of mu=40). What is this conf range? It is 40 +/- standard erroralpha and NOT the sample mean +/- sealpha. So, R is wrong. The quantum of p does not matter here as it is used only for accept/reject decision, but confidence range is important for decision making $\endgroup$ – Murugesan Narayanaswamy Feb 11 '19 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.