helna
November 23, 2021, 5:38pm
1
my x values in my table are "Control" or "Air" and I need to do the t-test with those variables up against each other
this is what I tried to do, but its giving me an error for my formatting for"(subset(fishjump,Treatment=="Control")$Time~(subset(fishjump,Treatment=="Air")$Time"
t.test(subset(fishjump,Treatment=="Control")$Time~(subset(fishjump,Treatment=="Air")$Time, mu=0, alt="two.sided", conf.level = 0.95, var.equal = F, paired = F)
Without the error messages I don't understand what is happening.
However here is a simple example that should work for you. Just change the names to your data.frames names.
dat1 <- data.frame(xx = sample(letters[1:2], 20, replace = TRUE),
yy = rnorm(20))
zz <- subset(dat1, xx == "a")
aa <- subset(dat1, xx == "b")
t.test(aa$yy, zz$yy)
helna
November 23, 2021, 6:25pm
3
its saying
Error in t.test.default(aa$Time, zz$Time) : not enough 'x' observations
because ist showing that there's o observations for aa and zz
this is what I wrote:
dat1 <- data.frame(Treatment= sample(letters[1:2], 20, replace = TRUE), Time=rnorm(20))
zz <- subset(dat1, Treatment == "Control")
aa <- subset(dat1, Treatment == "Air")
startz
November 23, 2021, 6:30pm
4
Treatment
is either "a" or "b". It never equals "Control" or "Air".
dat1 is just a mock dataset.
You need to work with your dataset fishjump .
Then you would need something like
zz <- subset(fishjump, Treatment == "Control")
aa <- subset(fishjump, Treatment == "Air")
t.test(aa$Time, zz$Time)
system
Closed
December 14, 2021, 8:42pm
6
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.