[R] defining number of samples
ehlers at ucalgary.ca
Mon Oct 26 08:29:23 CET 2009
> dear all
> i am trying to perform t-test (t.test) in R
> here i am putting the commands and answer i got
> Welch Two Sample t-test
> data: Ht_cm[from_treeline == "above"][type == "SD"] and Ht_cm[from_treeline == "below"][type == "SD"] t = 1.4181, df = 159.203, p-value = 0.1581alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -1.547018 9.426110 sample estimates:mean of x mean of y 21.34627 17.40672
>> t.test(Ht_cm[from_treeline=='above'][type=='SPB'],Ht_cm[from_treeline=='below'][type=='SPB'])Error in t.test.default(Ht_cm[from_treeline == "above"][type == "SPB"], : not enough 'x' observations>
> its ok with the first command, but it says 'not enough 'x' observations', in the later case i have 31 samples.
> how can i do t.test with my day for latter case, will it work by defining the number of samples, if yes, how can i define it.
Does this give you a clue:
x <- 4
y <- 1:5
#Error in t.test.default(x, y) : not enough 'x' observations
If you don't 'get' it, try calculating the test statistic
> thanking you in anticipation
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> 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