Skip to content

one sample t-test

2 messages · Karsten Rincke, Jim Lemon

#
Hello,
I am reasoning about a question concerning the t-test for one sample. My
data includes 150 values (mean 10.07) which I want to compare to mu=9. A
tow-sided t-test yields
One Sample t-test

data:  data
t = 3.0099, df = 149, p-value = 0.00307
alternative hypothesis: true mean is not equal to 9
95 percent confidence interval:
  9.368676 10.777991
sample estimates:
mean of x
 10.07333

The result would be interpreted as being significant. Furthermore it can
be said that the true mean is greater than 9 because of the confidence
interval.
*My question is*: Why does it seem to be not possible to conduct a
t-test with option "greater"? The result I get is:
Fehler in t.test.default(data, "greater", mu = 9) :
  nicht genug 'y' Beobachtungen

R complains about the amount of supplied data.

I'd like to understand this behavior.
Thank you for any hints!
Karsten
#
On 02/25/2013 06:04 AM, Karsten Rincke wrote:
Hi Karsten,
My guess is that it is due to "positional matching", where unlabelled 
arguments are interpreted relative to their position in the argument 
list. Try this:

t.test(data,alternative="greater",mu=9)

Jim