That seems great to me. Thank you very much!
-Thomas
On Sat, Feb 23, 2019 at 11:14 AM Martin Maechler
wrote:
>
> > peter dalgaard
> > on Fri, 22 Feb 2019 12:38:14 +0100 writes:
>
> > It's not a problem per se to put additional information
> > into class htest objects (hey, it
> peter dalgaard
> on Fri, 22 Feb 2019 12:38:14 +0100 writes:
> It's not a problem per se to put additional information
> into class htest objects (hey, it's S3 after all...) and
> there is a precedent in chisq.test which returns $observed
> and $expected.
It seems th
It's not a problem per se to put additional information into class htest
objects (hey, it's S3 after all...) and there is a precedent in chisq.test
which returns $observed and $expected.
Getting such information printed by print.htest is more tricky, although it
might be possible to (ab)use the
> Thomas J Leeper
> on Thu, 21 Feb 2019 22:21:21 + writes:
> Hi John,
> Thanks for your reply. Of course I could write a package and of course I
> would find that trivial to do. The point is this is a main entry point to
R
> for probably (at this point) hundreds o
Hi John,
Thanks for your reply. Of course I could write a package and of course I
would find that trivial to do. The point is this is a main entry point to R
for probably (at this point) hundreds of thousands of students. I’d like
them to be able to get a basic quantity of interest from a t-test w
Hello,
Something like this?
t.test2 <- function(...) {
ht <- t.test(...)
class(ht) <- c("htest_tjl", class(ht))
ht
}
print.htest_tjl <- function(x, ...) {
NextMethod(x, ...)
se <- as.vector(abs(diff(x$estimate)/x$statistic))
cat("Standard error of the difference:", se, "\n\n")
in
Dear Thomas,
it is, unfortunately, not that simple. t.test() returns an object of class
"htest" and not all such objects have standard errors. I'm not entirely sure
what the point is since it's easy to compute the standard error of the
difference from the information in the object (adapting an