[R] one sided t test

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Jan 14 17:34:44 CET 2011


No, all is fine, for this one-sided test, you want to calculate the 
upper part of the confidence interval. If it is less than zero you have 
shown that the alternative is probably right -> the true value is below 
the upper confidence interval boarder with probability 1-\alpha.

Uwe Ligges


On 14.01.2011 17:21, Ingo wrote:
> Dear R,
>
> I am using this R version:R version 2.11.1 (2010-05-31)(Cran Mirror Berlin)
>
>
>
> It seems to me, that R constructs a wrong confidence intervall if you try to get a one sided t-test.
>
> If the true mean is 1 and my alternative hypothesis (H1) says that mu is smaller ("less")than zero the conf. intervall should reach +∞ and not -∞ if it is constructed for the H0 saying that mu is greater or equal to zero.
>
>
>
>> rnorm(20,1)->n
>
>> mean(n)
>
> [1] 1.206958
>
>
>
>> t.test(n,mu=0,alternative="less")
>
>          One Sample t-test
>
>
>
> data:  n
>
> t = 9.3976, df = 19, p-value = 1        alternative hypothesis: true mean is less than 0
>
> 95 percent confidence interval:
>
>       -Inf 1.429035         sample estimates:
>
> mean of x
>
>   1.206958
>
>
>
> Hope I am right you can help me if I am wrong.
>
>
>
> Greetings,
>
>
>
> Ingo Meemken
>
> 	[[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list