Displaying 20 results from an estimated 1000 matches similar to: "Problem solved: extracting values from a "by" function"
2008 Jul 05
0
extracting values from a "by" function
Hello,
I am trying to extract t and pvalues from a 1000 ttests using the by-function but everythinhg I tried did not work. Unfortunately googling "by" is not very helpful. Any help will be very appreciated.
Cheers,
Danile Stall
*creating a data set
library(MASS)
dataset <- mvrnorm(160, mu, Sigma)
dataset <- as.data.frame(dataset)
dataset$GROUP <- rep(1:10, each=16)
data.uni
2007 Aug 14
4
Problem with "by": does not work with ttest (but with lme)
Hello,
I would like to do a large number of e.g. 1000 paired ttest using the by-function. But instead of using only the data within the 1000 groups, R caclulates 1000 times the ttest for the full data set(The same happens with Wilcoxon test). However, the by-function works fine with the lme function.
Did I just miss something or is it really not working? If not, is there any other possibility to
2011 Oct 03
2
extracting p-values in scientific notation
Dear all
How does print.htest display the p-value in scientific notation?
> (x <- cor.test(iris[[1]], iris[[3]]))
Pearson's product-moment correlation
data: iris[[1]] and iris[[3]]
t = 21.65, df = 148, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.8270 0.9055
sample estimates:
cor
0.8718
Above the p-value comes
2009 Jun 02
1
getting elements out of list automatically
o <- (structure(list(sand.silt = structure(list(statistic =
structure(185, .Names = "W"),
parameter = NULL, p.value = 0.0478835773838087, null.value =
structure(0, .Names = "location shift"),
alternative = "two.sided", method = "Wilcoxon rank sum test with
continuity correction",
data.name = ".column by site"), .Names =
2011 Dec 15
1
printing all htest class members
Hello,
I've posted a question about this subject yesterday, but since there was no
R code to comment,
no one did.
I'm trying to have the print method for class 'htest' print some extra
information common in some test, like the time series linearity related
tests. Many of them have an 'order' parameter, representing a lag or
embedding dimension, and it would be a nice
2004 Mar 31
1
R-1.9.0 Beta print.power.htest problem?
Hi all,
I just used power.t.test() in Version 1.9.0 beta (2004-03-31) today
under FC1.
The following is the output:
> power.t.test(delta = .5, power = .95, type = "paired")
$n
[1] 53.94062
$delta
[1] 0.5
$sd
[1] 1
$sig.level
[1] 0.05
$power
[1] 0.95
$alternative
[1] "two.sided"
$note
[1] "n is number of *pairs*, sd is std.dev. of *differences* within
2005 Mar 13
1
Use of htest class for different tests
Hello!
First of all I must appologize if this has been raised previously, but
search provided by Robert King at the University of Newcastle seems to
be down these days. Additionally let me know if such a question should
be sent to R-help.
I did a contribution to function hwe.hardy in package 'gap' during the
weekend. That functions performs Hardy-Weinberg equilibrium test using
MCMC. The
2004 May 20
2
Get Slot from a Class
Hello, everyone,
I don't quite understand the following message:
> TTT <- t.test(1:10, y=c(7:20))
> class(TTT)
[1] "htest"
> TTT@p.value
Error: Trying to get slot "p.value" from an object whose class ("htest") is not defined
> TTT$p.value
[1] 1.855282e-05
Why the message says the class of TTT is not defined while class(TTT) gets
1997 Aug 22
0
R-alpha: class for chisquare tests; Thoughts on print & summary
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: Kurt.Hornik@ci.tuwien.ac.at
CC: R-devel@stat.math.ethz.ch
Subject: Re: R-alpha: class for chisquare tests; Thoughts on print & summary
Kurt,
I think we hopefully are coming to an agreement that
1) your ctest collection should make its way into 'R core'
((and you are the one who can make it happen now ..))
By all
2008 Jan 09
3
likelihood from test result
Is there any automatic mechanism for extracting a likelihood or test
statistic distribution (PDF or CDF) from an object of class "htest" or
from another object of a general class encoding a hypothesis test
result?
I would like to have a function that takes "x", an object of class
"htest", as its only argument and that returns the likelihood or test
statistic
2019 Feb 22
0
Return/print standard error in t.test()
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 $estimate slot.
The further question is whether one would really want to do that (change the
2008 Jun 23
0
Documentation about htest?
Hello
I saw in many packages and functions a class "htest". I wanted to study
it and maybe use for a package instead of writing new classes, but did
not find any documentation about this class in the official manuals. Are
there some information available about it? How can I see how to use it?
As a second question, I also implemented some tests with bootstraped
distribution. Is the
2019 Feb 23
1
Return/print standard error in t.test()
>>>>> 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 the consent is to simply return the SE but *not*
2011 Aug 01
2
Errors, driving me nuts
Greetings all,
I am getting this error that is driving me nuts... (not a long trip, haha)
I have a set of files and in these files I want to calculate ttests on
rows 'compareA' and 'compareB' (these will change over time there I
want a variable here). Also these files are in many different
directories so I want a way filter out the junk... Anyway I don't
believe that this is
2011 Jun 20
1
requesting a mentor for R development
I'd like to learn the process of revising R functions & packages and
then submitting proposed patches to the R Core team. Would someone be
willing to mentor me through one example?
For starters, consider an example. I'd like to revise the t.test
function to return the stderr value to the user. We only need to
change the "rval" in the third-from-the end line of
2006 Oct 31
0
about mantelhaen.test (PR#7779)
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5A700CC15DEABD01445A1B70
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
I have modified the code originally posted to include capability for
arbitrary weightings for the rows and columns (which apply in the
nominal-ordinal and the ordinal-ordinal cases). The code is pasted
1997 Aug 21
2
R-alpha: new class for chisquare tests?
I sort of asked this before, but perhaps not explicitly enough.
In my ctest collection, there are several chisquare-based tests. For
some of them, it may be useful to also return information on expected
(and observed) counts. The question is, how should this be done. Of
course, there is no problem adding the corresponding components to the
list returned by the functions. However, as these are
2001 Jul 18
1
hypothesis testing in models
Dear all,
Being an economics student, I am trying to put together a little
tutorial/FAQ/... for those who have (more) background in econometrics rather
than in statistics -- just as I have. I'v been looking for a hypothesis
testing tool in R (just linear or also nonlinear) for model parameters, but
could not find anything so far. I did find a similar but unanswered question
in the archives,
2009 May 14
1
will one of you help me advocate a change in t.test (patch attached)
I wish the t.test function in stats would return the standard error.
It would be nicer for students if R simply reported the standard error
used to calculate the t value. I trolled for this in r-help and got
no answers, which I interpreted to mean that this is boring but
possibly not wrong. Hopefully.
I believe only simple changes are needed.
In the source code src/library/stats/t.test.R file:
2008 Oct 16
2
Saving results of Kruskal Walis test
Hello,
I am running Kruskal-Walis test in R. When I try to save results using
write.table it gives me the following error :
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors =
stringsAsFactors) :
cannot coerce class "htest" into a data.frame
The overall code is as follows :
>data_file = read.table("~/DATA.dir/data_file.txt", header=T)