Displaying 20 results from an estimated 8000 matches similar to: "how to use chisq.test with 2 row matrix having 0 in it?"
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
2005 Jun 26
2
chisq.test using amalgamation automatically (possible ?!?)
Dear List,
If any of observed and/or expected data has less than
5 frequencies, then chisq.test (Pearson's Chi-squared
Test for Count Data from package:stats) gives warning
messages. For example,
x<-c(10, 14, 10, 11, 11, 7, 8, 4, 1, 4, 4, 2, 1, 1, 2,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
y<-c(9.13112391745095, 13.1626482033341,
12.6623267638188, 11.0130706413029, 9.16415925139016,
2003 Jul 15
1
Why two chisq.test p values differ when the contingency table is transposed?
I'm using R1.7.0 runing with Win XP. Thanks,
...Tao
????????????????????????????????????????????????????????
>x
[,1] [,2]
[1,] 149 151
[2,] 1 8
>t(x)
[,1] [,2]
[1,] 149 1
[2,] 151 8
>chisq.test(x, simulate.p.value=T, B=100000)
Pearson's Chi-squared test with simulated p-value (based on 1e+05
replicates)
data: x
X-squared = 5.2001, df =
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
2012 Feb 20
1
chisq.test vs manual calculation - why are different results produced?
Hello,
I am trying to fit gamma, negative exponential and inverse power functions
to a dataset, and then test whether the fit of each curve is good. To do
this I have been advised to calculate predicted values for bins of data (I
have grouped a continuous range of distances into 1km bins), and then apply
a chi-squared test. Example:
> data <- data.frame(distance=c(1,2,3,4,5,6,7),
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
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,
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))
>
2005 Dec 20
2
2 x 2 chisq.test (PR#8415)
Full_Name: nobody
Version: 2.2.0
OS: any
Submission from: (NULL) (219.66.34.183)
2 x 2 table, such as
> x
[,1] [,2]
[1,] 10 12
[2,] 11 13
> chisq.test(x)
Pearson's Chi-squared test with Yates'
continuity correction
data: x
X-squared = 0.0732, df = 1, p-value = 0.7868
but, X-squared = 0.0732 is over corrected.
when abs(a*d-b*c) <= sum(a,b,c,d), chisq.value
2004 Mar 09
1
bug(?) in chisq.test
This is a message for whoever maintains "chisq.test": For an
outcome more extreme than 2000 simulations, a Monte Carlo p-value of "<
2.2e-16" was printed. Ripley said the proper p-value for such cases
should be 1/(B+1) = 1/2001. This can be easily fixed by adding
"if(PVAL==0)PVAL <- 1/(B+1)" right after the following line in the code
for chisq.test (in R
2007 Apr 06
0
translating sas proc mixed to lme()
Hi All
I am trying to translate a proc mixed into a lme() syntax. It seems that I was
able to do it for part of the model, but a few things are still different.
It is a 2-level bivariate model (some call it a pseudo-3-level model).
PROC MIXED DATA=psdata.bivar COVTEST METHOD = ml;
CLASS cluster_ID individual_id variable_id ;
MODEL y = Dp Dq / SOLUTION NOINT;
RANDOM Dp Dq / SUBJECT = cluster_ID
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
2012 May 04
2
Binomial GLM, chisq.test, or?
Hi,
I have a data set with 999 observations, for each of them I have data on
four variables:
site, colony, gender (quite a few NA values), and cohort.
This is how the data set looks like:
> str(dispersal)
'data.frame': 999 obs. of 4 variables:
$ site : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 2 2 ...
$ gender: Factor w/ 2 levels "0","1":
2003 Feb 28
0
chi square
Hi All,
I woul like to ask you a couple of questions on chisq.test.
First, I have 40 flies, 14 males and 26 females and I want to test for an a
priori hypothesis that the sex ratio is 1:1
sex<-c(14,26)
pr<-c(1,1)/2
chisq.test(se, p=pr, correct=TRUE)
Chi-squared test for given probabilities
data: sex
X-squared = 3.6, df = 1, p-value = 0.05778
If my calculations are correct, this is
2007 Feb 26
1
Chi Square with two tab-delimited text files
Hi,
I want to do a chi square test and I have two tab delimited text files with
Expected and Observed values to compare. Each file contains only the values
and are 48 rows by 116 columns. I have managed to do something with them,
but I don't think it is right as I got a p value of 1. In this case I used
the read.table() function to read the values from the files. But I don't
know if
2008 Aug 22
2
help needed for HWE.exact in library "genetics"
Hi,
I have a genotype data for both case and controls and would like to calculate the HW p-value. However, since the number of one genotype is 0, I got wired result. Would someone help me to figure it out? Or confirm it's right? Thanks a lot.
============
> library( "genetics" )
NOTE: THIS PACKAGE IS NOW OBSOLETE.
The R-Genetics project has developed an set of enhanced
2009 Nov 26
2
Testing for strength of fit using R
Dear all,
I am trying to validate a model by comparing simulated output values against observed values. I have produced a simple X-y scatter plot with a 1:1 line, so that the closer the points fall to this line, the better the 'fit' between the modelled data and the observation data.
I am now attempting to quantify the strength of this fit by using a statistical test in R. I am no
2005 May 26
1
Chi Square Test on two groups of variables
Dear R help
I have been trying to conduct a chi square test on two groups of variables
to test whether there is any relationship between the two sets of variables
chisq.test(oxygen, train)
Pearson's Chi-squared test
data: oxygen
X-squared = 26.6576, df = 128, p-value = 1
> chisq.test(oxygen)
Pearson's Chi-squared test
data: oxygen
X-squared = 26.6576, df = 128,
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 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