similar to: bug report: inaccurate error message for stats::chisq.test

Displaying 20 results from an estimated 10000 matches similar to: "bug report: inaccurate error message for stats::chisq.test"

2010 Feb 09
1
Missing interaction effect in binomial GLMM with lmer
Dear all, I was wondering if anyone could help solve a problem of a missing interaction effect!! I carried out a 2 x 2 factorial experiment to see if eggs from 2 different locations (Origin = 1 or 2) had different hatching success under 2 different incubation schedules (Treat = 1 or 2). Six eggs were taken from 10 females (random = Female) at each location and split between the treatments,
2012 Oct 19
1
Looping survdiff
The number of recent questions from umn.edu makes me wonder if there's homework involved.... Simpler for your example is to use get and subset. dat <- structure(..... as found below var.to.test <- names(dat)[4:6] #variables of interest nvar <- length(var.to.test) chisq <- double(nvar) for (i in 1:nvar) { tfit <- survdiff(Surv(time, completion==2) ~
2012 Oct 18
1
looping survdiff?
Hello, I am trying to set up a loop that can run the survdiff function with the ultimate goal to generate a csv file with the p-values reported. However, whenever I try a loop I get an error such as "invalid type (list) for variable 'survival_data_variables[i]". This is a subset of my data: structure(list(time = c(1.51666666666667, 72, 72, 25.7833333333333, 72, 72, 72, 72, 72,
2020 Aug 20
2
utils::isS3stdGeneric chokes on primitives and identity
>>>>> Gabriel Becker writes: > I added that so I can look at the proposed fix and put it or something > similar in bugzilla for review final review. > Apologies for the oversight. Fixed now with - while(as.character(bdexpr[[1L]]) == "{") + while(is.call(bdexpr) && (as.character(bdexpr[[1L]]) == "{")) (the suggested fix does not work on
2020 Aug 28
2
utils::isS3stdGeneric chokes on primitives and identity
Trace adds something to the body of the function, so it does make sense that it doesn't. Whether traced functions still technically meet the definition of standard s3 generic or not is, I suppose, up for debate, but I would say that they should, I think. As before, if desired I can work on a patch for this if desired, or someone on R-core can just take care of it if that is easier. Best, ~G
2020 Aug 19
2
utils::isS3stdGeneric chokes on primitives and identity
Dear R-devel, utils::isS3stdGeneric tries to subset the body of the function it's fed, primitives don't like that because they don't have a body, identity doesn't like it either because it's body is a symbol. According to the doc, any function is a legal input. See below: identity #> function (x) #> x #> <bytecode: 0x0000000013d6da28> #> <environment:
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
2009 Jan 12
1
Determining variance components of classed covariates
Hi - I am interested in solving variance components for the data below with respect to the response variable, Expression within R. However, the covariates aren't independent and they also have a class (of which the total variance explained by covariates in that class I am most interested in). Very naively, I have tried to look at each individual covariates variance like this >
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
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
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 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
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
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
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,
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
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,
2014 May 07
3
historical significance of Pr(>Chisq) < 2.2e-16
Where does the value 2.2e-16 come from in p-values for chisq tests such as those reported below? > Anova(cm.mod2) Analysis of Deviance Table (Type II tests) Response: Freq LR Chisq Df Pr(>Chisq) B 11026.2 1 < 2.2e-16 *** W 7037.5 1 < 2.2e-16 *** Age 886.6 8 < 2.2e-16 *** B:W 3025.2 1 < 2.2e-16 *** B:Age 1130.4 8 < 2.2e-16 *** W:Age 332.9 8 < 2.2e-16 *** --- Signif.
2005 Oct 20
3
numerical issues in chisq.test(simulate=TRUE) (PR#8224)
Hi, This report deals with p-values coming from chisq.test using the simulate.p=TRUE option. The issue is numerical accuracy and was brought up in previous bug reports 3486 and 3896. The bug was considered fixed but apparently was only mostly fixed. Just the typical problem of two values that are mathematically equal not ending up numerically equivalent. Consider this series of three 2x2