Displaying 20 results from an estimated 115 matches for "htest".
Did you mean:
test
2005 Mar 13
1
Use of htest class for different tests
...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 return of the function does not have classical components for
htest class so I was afcourse not successfull in using it. However, I
managed to copy and modify some part of print.htest to accomplish the
same task.
Now my question is what to do in such cases? Just copy parts of
print.htest and modify for each test or anything else. Are such cases
rare? If yes, th...
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 feature to pass a vector of
orders and have all corresponding tests run.
It's e...
2004 Mar 31
1
R-1.9.0 Beta print.power.htest problem?
...062
$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
pairs"
$method
[1] "Paired t test power calculation"
attr(,"class")
[1] "power.htest"
The following is the output from Version 1.8.1 Patched (2004-03-31):
> power.t.test(delta = .5, power = .95, type = "paired")
Paired t test power calculation
n = 53.94062
delta = 0.5
sd = 1
sig.level = 0.05
power =...
2009 Jun 02
1
getting elements out of list automatically
...od = "Wilcoxon rank sum test with
continuity correction",
data.name = ".column by site"), .Names = c("statistic", "parameter",
"p.value", "null.value", "alternative", "method", "data.name"
), class = "htest"), gravel = structure(list(statistic =
structure(249.5, .Names = "W"),
parameter = NULL, p.value = 0.528568586705971, null.value =
structure(0, .Names = "location shift"),
alternative = "two.sided", method = "Wilcoxon rank sum test with
continuity cor...
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 "htest"?
I appreciate the explanations?
-Ming...
2008 Jul 05
0
extracting values from a "by" function
...c("V1","V2")), v.names="Y",direction="long")
*the actual tests:
test<-by(data.uni, data.uni$GROUP, function(x)t.test(Y ~ time, data = x, paired = TRUE))
*in case this will help you:
summary(test)
str(test)
> summary(test)
Length Class Mode
1 9 htest list
2 9 htest list
3 9 htest list
4 9 htest list
5 9 htest list
6 9 htest list
7 9 htest list
8 9 htest list
9 9 htest list
10 9 htest list
> str(test)
List of 10
$ 1 :List of 9
..$ statistic : Named num -4.26
.. ..- attr(*, "name...
2008 Jul 05
0
Problem solved: extracting values from a "by" function
...quot;V1","V2")),
v.names="Y",direction="long")
*the actual tests:
test<-by(data.uni, data.uni$GROUP, function(x)t.test(Y ~ time, data
= x, paired = TRUE))
*in case this will help you:
summary(test)
str(test)
> summary(test)
Length Class Mode
1 9 htest list
2 9 htest list
3 9 htest list
4 9 htest list
5 9 htest list
6 9 htest list
7 9 htest list
8 9 htest list
9 9 htest list
10 9 htest list
> str(test)
List of 10
$ 1 :List of 9
..$ statistic : Named num -4.26
.. ..- attr(*, "n...
2006 Mar 24
4
How to capture t-score and p-values from t.test
When I do t.test on two distributions (see example below), it outputs
numerous data about the t.test.
What I'd like to do is individually capture some of this data and assign
it to other variables.
However, I am unable to find anything in the help section.
In the example below, the t value is -4.0441 and the p-value is 0.006771
How can I assign these values to two variables, let's
2011 Jun 20
1
requesting a mentor for R development
...the third-from-the end line of
stats:::t.test.default.
Change this:
rval <- list(statistic = tstat, parameter = df, p.value = pval,
conf.int = cint, estimate = estimate, null.value = mu,
alternative = alternative, method = method, data.name = dname)
class(rval) <- "htest"
return(rval)
To this:
rval <- list(statistic = tstat, parameter = df, stderr=stderr, p.value = pval,
conf.int = cint, estimate = estimate, null.value = mu,
alternative = alternative, method = method, data.name = dname)
class(rval) <- "htest"
retu...
1997 Aug 21
2
R-alpha: new class for chisquare tests?
...quare-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 of class `htest',
the components don't show up in the printed output.
(Of course, one can easily obtain them if they are in the list, but I
think Peter is with me when I say that this is not the right thing in an
intro course.)
* Should we extend print.htest() to display info on expected and
observed cou...
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 distribution that was used to compute the p-valu...
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:...
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 wi...
2010 Sep 27
4
Fitting problem
...vol <- 4/3*pi*(d/2)^3
lognorm <- 1/(d*sig*sqrt(2*pi))*exp(-(log(d)-log(mu))^2/(2*sig^2))
lang <- 1/tanh(Ms*rho*vol*H/(kb*t))-1/(Ms*rho*vol*H/(kb*t))
S1 <- S1 + lognorm*vol*lang
S2 <- S2 + lognorm*vol
}
M[i] <- Ms*S1/S2 + chi*H
}
M
}
### I can calculate a set of data:
htest<- (-10:10)*200
dtest<- (5:15)*1e-7
mtest<- MH(field=htest,diameter=dtest)
### However when I try to reverse engineer to calculate the parameters mu,
sig, chi and Ms I run into problems. Could anyone shed some light on this
problem?
fit <- nls(M~MH(H,(5:15)*1e-7,mu,sig,Ms,chi),data=df...
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)
>attach(data_file)
>data_file.out <- krukal.test(data_file)
>write.table(data_file.out, "~/DATA/results/data_file_out.txt")
Error in as.dat...
2008 Feb 05
2
Incomplete ouput with sink and split=TRUE
...I am trying to get R's terminal output to a file and to the terminal
at the same time, so that I can walk through some tests and keep a log
concurrently. The function 'sink' with the option split=TRUE seems to
do just that. It works fine for most output but for objects of class
htest, the terminal output is incomplete (the lines are there but
empty). Here is an example session which shows the problem:
> sink("textout.txt", type="output", split=T)
> b=bartlett.test(runif(10),c(1,1,1,1,2,2,2,2,2,2))
> class(b)
[1] "htest"
> b
dat...
2019 Feb 21
5
Return/print standard error in t.test()
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 example from ?t.test):
> (res <- t.test(1:10, y = c(7:20)))
Welch Two Sample...
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* change
the print() method, and also be careful not to mess with
existing parts of the result.
So, a mini...
1997 Aug 22
0
R-alpha: class for chisquare tests; Thoughts on print & summary
...core if the core grows too
big.
2) it should remain S-plus downward compatible as much as
reasonably possible.
For functions which are not going to be building blocks such compatibility
is less important. Better to do it "right".
b2. Yes, add extra arguments to print.htest / summary.htest to
control this behavior.
[this is also done for the correlation matrix
in print.summary.lm in S (not yet in R ..)]
[ Actually I think that we just have a different default value for the
corr= argument. If you'd like this changed just say. I just don't
find th...
2003 May 20
2
what.is(object)
...y );
s$estimate$name = 'correlation' ; <- try to rename 'cor' to
'correlation' fails. obviously, name is not a part here.
s$newfield = c("another info field", 3.2 ) ; <- this is not congruous
so
what.is(s) #tells me that this is a class called htest
what.is(s$statistic) # helps me
would allow me to see how things are constructed. does S contain such
a feature?
regards,
/iaw