Displaying 20 results from an estimated 6000 matches similar to: "Chisq test for truncated count data and estiamte the expectation value"
2010 Mar 16
2
How can I save the result for goodness of fit test
Dear All,
I run the goodness of fit test using goodfit() in vcd package.
The result is as follow:
Goodness-of-fit test for poisson distribution
X^2 df P(> X^2)
Pearson 1.053348 2 0.5905661
Warning message:
In summary.goodfit(gf) : Chi-squared approximation may be incorrect
I want to save the the test statistics(X^2), df, and p-value. How can I save
the result.
2008 Jan 08
1
A question on chisq.test
Dear all,
I would like to do a goodness-of-fit test on my data to see if they follow a mixture of 2 poisson distributions. I have small numbers for observed values. Most of them <5. The chisq.test gives warning message: Chi-squared approximation may be incorrect in: chisq.test(x , p = prob). However, the option sim=TURE would suppress the warning message. Does that mean with the option
2003 Jul 15
0
Why two chisq.test p values differ when the contingency
Hi Tao:
The P-values for 2x2 table are generated based on a random (discrete
uniform distribution) sampling of all possible 2x2 tables, conditioning
on the observed margin totals. If one of the cells is extremely small,
as in your case, you get a big difference in P-values. Suppose, you
changed the cell with value 1 to, say, 5 or 6, then the two P-values
are nearly the same. However, I
2003 Dec 09
2
p-value from chisq.test working strangely on 1.8.1
Hello everybody,
I'm seeing some strange behavior on R 1.8.1 on Intel/Linux compiled
with gcc 3.2.2. The p-value calculated from the chisq.test function is
incorrect for some input values:
> chisq.test(matrix(c(0, 1, 1, 12555), 2, 2), simulate.p.value=TRUE)
Pearson's Chi-squared test with simulated p-value (based on 2000
replicates)
data: matrix(c(0, 1, 1,
2005 Jun 22
1
chisq test and fisher exact test
Hi,
I have a text mining project and currently I am working on feature
generation/selection part.
My plan is selecting a set of words or word combinations which have
better discriminant capability than other words in telling the group
id's (2 classes in this case) for a dataset which has 2,000,000
documents.
One approach is using "contrast-set association rule mining" while the
2003 Aug 21
0
The two chisq.test p values differ when the contingency table (PR#3896)
>>>>> dmurdoch writes:
>> Date: Wed, 16 Jul 2003 01:27:25 +0200 (MET DST)
>> From: shitao@ucla.edu
>>> x
>> [,1] [,2]
>> [1,] 149 151
>> [2,] 1 8
>>> c2x<-chisq.test(x, simulate.p.value=T, B=100000)$p.value
>>> for(i in (1:20)){c2x<-c(c2x,chisq.test(x,
>> simulate.p.value=T,B=100000)$p.value)}
2013 Jul 09
0
probable bugs in stats::loglin calculation of pearson chisq
In running the following example of a loglinear model for the Titanic data,
I was surprised to see NaN reported for the
Pearson chisq
> loglin(Titanic, margin=list(1:3, 4))
2 iterations: deviation 2.273737e-13
$lrt
[1] 671.9622
$pearson
[1] NaN
$df
[1] 15
$margin
$margin[[1]]
[1] "Class" "Sex" "Age"
$margin[[2]]
[1] "Survived"
Tracing it back,
2003 Jul 16
1
The two chisq.test p values differ when the contingency table is transposed! (PR#3486)
Full_Name: Tao Shi
Version: 1.7.0
OS: Windows XP Professional
Submission from: (NULL) (149.142.163.65)
> x
[,1] [,2]
[1,] 149 151
[2,] 1 8
> c2x<-chisq.test(x, simulate.p.value=T, B=100000)$p.value
> for(i in (1:20)){c2x<-c(c2x,chisq.test(x,
simulate.p.value=T,B=100000)$p.value)}
> c2tx<-chisq.test(t(x), simulate.p.value=T, B=100000)$p.value
> for(i in
2008 Aug 21
0
how to use chisq.test with 2 row matrix having 0 in it?
Hi,
I am working on calculating X^2 for some matrix (most of them have either two rows or 2 columns) by using chisq.test in R. However when there are 0s in the matrix, chisq.test does not work. For example:
====================
> elements <- matrix( c( 0, 0, 9, 5, 71, 168), nr = 2 )
> elements
[,1] [,2] [,3]
[1,] 0 9 71
[2,] 0 5 168
> chisq.test( elements )
2000 Nov 26
1
Problem with NAs using chisq.test() (PR#748)
Full_Name: Kjetil Kjernsmo
Version: 1.1.1.1 (patched the rpois :-))
OS: osf4.0e
Submission from: (NULL) (129.240.28.227)
Dear all,
I have just gotten through a debugging session of my code, being confused
for a few days. I sent what I thought was a straightforward matrix to
chisq.test() and once in a while got the error message:
> chisq.test(t2)
Error in chisq.test(t2) : missing value where
2012 Aug 20
1
The difference between chisq.test binom.test and pbinom
Hello all,
I am trying to understand the different results I am getting from the
following 3 commands:
chisq.test(c(62,50), p = c(0.512,1-0.512), correct = F) # p-value = 0.3788
binom.test(x=62,n=112, p= 0.512) # p-value = 0.3961
2*(1-pbinom(62,112, .512)) # p-value = 0.329
Well, the binom.test was supposed to be "exact" and give the same results
as the pbinom, while the chisq.test
2006 Dec 02
1
Chi-squared approximation may be incorrect in: chisq.test(x)
I am getting "Chi-squared approximation may be incorrect in:
chisq.test(x)" with the data bleow.
Frequency distribution of number of male offspring in families of size 5.
Number of Male Offspring N
0 518
1 2245
2 4621
3 4753
4 2476
5
2018 Aug 21
1
bug report: inaccurate error message for stats::chisq.test
Hi,
`stats::chisq.test` checks that x and y each have at least 2 levels AFTER
filtering on complete cases.
It makes sense but the error message is misleading : ?'x' and 'y' must have
at least 2 levels?
Here?s how to reproduce the issue :
x <- structure(c(1L, 1L, 1L, 2L, 1L, 2L), .Label = c("0001", "0003"),
class = "factor")
y <-
2005 Aug 12
1
chisq warning
Hi
I am running chisq as below and getting a warning. Can anyone tell me
the significance or the warning?
> chisq.test(c(10 ,4 ,2 ,6 ,5 ,3 ,4 ,4 ,6 ,3 ,2 ,2 ,2 ,4 ,7 ,10 ,0 ,6
,19 ,3 ,2 ,7 ,2 ,2 ,2 ,1 ,32 ,2 ,3 ,10 ,1 ,3 ,9 ,4 ,10 ,2 ,2 ,4 ,5 ,7 ,6
,3 ,7 ,4 ,3 ,3 ,7 ,1 ,4 ,2 ,2 ,3 ,3 ,5 ,5 ,4 ), p =c(0.01704142
,0.017988166 ,0.018224852 ,0.017751479 ,0.017988166 ,0.018224852
,0.017278107
2008 Nov 16
3
chisq.test with simulate.p.value=TRUE (PR#13292)
Full_Name: Reginaldo Constantino
Version: 2.8.0
OS: Ubuntu Hardy (32 bit, kernel 2.6.24)
Submission from: (NULL) (189.61.88.2)
For many tables, chisq.test with simulate.p.value=TRUE gives a p value that is
obviously incorrect and inversely proportional to the number of replicates:
> data(HairEyeColor)
> x <- margin.table(HairEyeColor, c(1, 2))
>
2003 Mar 27
0
a statistic question about chisq.test() (aprilsun)
The Chisquare test is based upon a normal approx of the (essentially) binomial
distribution for the data in question. Small EXPECTED (not observed) values
(<5) suggest a asymetric distribution and potential errors in inferential
conclusions. The alternative is the exact test, which calculates the exact
probabilities of the observed distribution, or a more extreme one, given the
constraining
2017 Dec 27
0
Numerical stability in chisq.test
The chisq.test contains following code:
STATISTIC <- sum(sort((x - E)^2/E, decreasing = TRUE))
However, based on book Accuracy and stability of numerical algorithms <http://ftp.demec.ufpr.br/CFD/bibliografia/Higham_2002_Accuracy%20and%20Stability%20of%20Numerical%20Algorithms.pdf> Table 4.1 on page 89, it is better to sort the data in increasing order than in decreasing order, when the
2013 Mar 05
0
chisq.test
If you wanted to do a t.test
res1<-do.call(cbind,lapply(seq_len(nrow(m)),function(i) do.call(rbind,lapply(split(rbind(m[i,-1],n),1:nrow(rbind(m[i,-1],n))), function(x) {x1<- rbind(x,m[i,-1]); t.test(x1[1,],x1[2,])$p.value}))))
?res2<-do.call(cbind,lapply(seq_len(ncol(res1)),function(i) c(c(tail(res1[seq(1,i,1),i],-1),1),res1[-c(1:i),i])))
?attr(res2,"dimnames")<-NULL
?res2
2008 Aug 10
1
(Un-)intentional change in drop1() "Chisq" behaviour?
Dear List,
recently tried to reproduce the results of some custom model selection
function after updating R, which unfortunately failed. However, I
ultimately found the issue to be that testing with pchisq() in drop1()
seems to have changed. In the below example, earlier versions (e.g. R
2.4.1) produce a missing P-value for the variable x, while newer
versions (e.g. R 2.7.1) produce 0 (2.2e-16).
2003 Mar 26
3
a statistic question about chisq.test()
Hi,
In the chisq.test(), if the expected frequency for some categories is <5, there will be a warning message which says
Warning message:
Chi-squared approximation may be incorrect in: chisq.test(x, p = probs)
I am wondering whether there are some methods to get rid of this mistake... Seems the ?chisq.test() doesn''t provide more
options to solve this problem. Or, the only choice is