Suppose we have `dat` shown below and we want to find the the `y` value
corresponding to the last value in `x` equal to the corresponding component
of `seek` and we wish to return an output the same length as `seek` using
`findInterval` to perform the search. This returns the correct result:
d
To be more specific, this replicates the computations that t.test is
doing (stripped of all the different cases that stats:::t.test.default
handles)
z <- err1-err2
se <- sqrt(var(z)/length(z))
mz <- mean(z)
tstat <- mz/se
2*pt(tstat, df= length(z)-1, lower.tail = FALSE)
On 2024-09-16 10:54 a
Dear Toby
I see no problem there. If you compute the mean and variance of err1 -
err2 which is what the paired test is working on then that might help to
see what is going on.
Michael
On 16/09/2024 15:47, Toby Hocking wrote:
Hi! I expected that t.test should report a very large p-value (clo
Hi! I expected that t.test should report a very large p-value (close
to 1), even when using paired=TRUE, for the data below (which are very
similar). However, I observe p-value = 0.02503 which indicates a
significant difference, even though there is none. Can this be fixed
please? This is with R-4.