Displaying 20 results from an estimated 300 matches similar to: "Simulating contingency table (Basic question, help please)"
2004 Feb 17
2
Generating 2x2 contingency tables
Hello R-users,
I would like to generate two-way contingency tables with zero in one cell. I tried to use the function r2dtable but I could not force one cell to have zero value.
Any Idea?
Best regards..
Mahmoud
[[alternative HTML version deleted]]
2009 Jan 20
1
Poisson GLM
This is a basics beginner question.
I attempted fitting a a Poisson GLM to data that is non-integer ( I believe
Poisson is suitable in this case, because it is modelling counts of
infections, but the data collected are all non-negative numbers with 2
decimal places).
My question is, since R doesn't return an error with this glm fitting, is it
important that the data is non-integer. How does
2008 Sep 17
1
Exact test in nxm contingency table
Hello,
I am trying to find a permutation test that works on a general nxm table. The data set is small enough to have cells with too small counts to make chi2-approximation invalid. If the table was a 2x2 contingency table I would like to use a Fsher exact test (fisher.test) but that wont work in this general table.
Does there exist a general function for this test.
Best regards,
Magnus
2011 Jul 07
4
Simulating from the null distribution of a 2 x 3 table
Dear all,
I want to simulate from the null distribution of the following 2 x 3 table,
2 5 10
4 8 5
I am using a chi-squared test.
Anyone has any idea how to do this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2017 Aug 24
3
Are r2dtable and C_r2dtable behaving correctly?
Hello,
While doing some enrichment tests using chisq.test() with simulated
p-values, I noticed some strange behaviour. The computed p-value was
extremely small, so I decided to dig a little deeper and debug
chisq.test(). I noticed then that the simulated statistics returned by the
following call
tmp <- .Call(C_chisq_sim, sr, sc, B, E)
were all the same, very small numbers. This, at first,
2017 Aug 25
2
Are r2dtable and C_r2dtable behaving correctly?
It is not about "really arge total number of observations", but:
set.seed(4711);tabs <- r2dtable(1e6, c(2, 2), c(2, 2)); A11 <- vapply(tabs, function(x) x[1, 1], numeric(1));table(A11)
A11
0 1 2
166483 666853 166664
There are three possible matrices, and these come out in proportions 1:4:1, the one with all cells filled with ones being
most common.
Cheers, Jari
2003 Apr 22
4
fisher exact vs. simulated chi-square
Dear All,
I have a problem understanding the difference between the outcome of a
fisher exact test and a chi-square test (with simulated p.value).
For some sample data (see below), fisher reports p=.02337. The normal
chi-square test complains about "approximation may be incorrect",
because there is a column with cells with very small values. I
therefore tried the chi-square with
2006 Sep 28
0
mx2 contingency tables or (2^(m-1)-1)'s 2x2 contingency tables in the context of feature selection for random forest
Dear Listers:
I have a categorical feature selection problem for random forest.
Suppose I have a multiple-leveled category variable A, which has m=3
levels: red, green, and blue and the final target is binary
classification.
I want to evaluate its power in discrimination between 2 classes. We
know rf splits multiple-leveled category variable by considering all
combinations of its levels. So
2002 Aug 10
1
GLM Contingency table regressions
I have a contingency table with a 0/1 variable (fwr) that flags a particular
condition, a weight variable (cnt) and other variables (e.g. zz)
characterizing that observation of the table.
I am trying to use GLM. By converting the variables to factors and running
the following regression:
fwr1<-factor(fwr)
zz1<-factor(zz1)
res1<-glm(fwr1 ~ zz1,weights=cnt)
Is that appropriate?
Paul M.
2006 Oct 17
1
Convert Contingency Table to Flat File
Hello All,
Is there any R function out there to turn a multi-way contingency table back to a flat file table of individual rows and attribute columns.?
Thanks!
marco
---------------------------------
[[alternative HTML version deleted]]
2011 Aug 29
1
Generating contingency tables from the null
Hi all,
I have a 3x4 contingency table with row totals all being 100. I want to
generate 3 x 4 tables from the null distribution. Which R function can do
this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2009 Dec 09
1
Exporting Contingency Tables with xtable
Dear R-philes:
I am having an issue with exporting contingency tables with xtable().
I set up a contingency and convert it to a matrix for passing to
xtable() as shown below.
v.cont.table <- table(v_lda$class, grps,
dnn=c("predicted", "observed"))
v.cont.mat <- as.matrix(v.cont.table)
Both produce output as follows:
observed
predicted uh uh~
uh 201
2010 Jun 22
1
Bayesian Code for contingency tables
Hello,
Is there anywhere I can find some Bayesian Code for 2 by 2 tables or even
the non-central hypergeometric distribution in R? Packages would be helpful
but the actual coding in R is much better.
Thanks,
Thanks Jim
[[alternative HTML version deleted]]
2009 Jun 10
1
Analisys in Multidimensional contingency tables
Dear R-list,
Hi everyone, Im trying to make an analysis of multidimensional contingency
tables using R. I' working with the Agresti example where you have the
data from 3 categories. The thing is how can I do the analisys using the
G2 statistics. Somebody can send me an Idea?
I attach the program where you can find the data.
Best Regards,
> prob1<-
2009 Jan 18
0
Singly ordered contingency tables with lbl_test (coin)
Hi all,
is it possible to perform a linear-by-linear association test (lbl_test, package coin) for a SINGLY ordered table ? And, if yes, how to manage the "scores" ?
Thanks in advance
Gilles - France
[[alternative HTML version deleted]]
2003 Jun 13
0
mca & contingency tables - error: "All variables must be factors"
Hi,
I would like to do a multiple correspondence analysis with the mca function in
the MASS library on data that I have as a contingency table (which I've tried
converting to a data frame).
For example,
=========
> data(HairEyeColor)
> hair.df <- as.data.frame(HairEyeColor)
> hair.df
Hair Eye Sex Freq
1 Black Brown Male 32
2 Brown Brown Male 38
3 Red
2008 Mar 17
1
how to get accumulate contingency table
Hi, all.
I got a lot of help from the this mailing list, it save me a lot of time. Here is my question.
x<-rep(c(2,3,4),20)
y<-sample(rep(c(0,1),30))
tr<-rep(c(1:5),6)
data1<-data.frame(x,y,tr)
data1<-data1[order(data1$tr),]
> data1 x y tr1 2 0 16 4 1 111 3 0 116 2 0 121 4 0 126 3 1 131 2 0 136 4 1 141 3 0 146 2 0 151 4 0 156 3 0 12 3 0 27 2 0
2000 Aug 23
1
3D perspective of a contingency table
How can I draw a 3D perspective of a contingency table, that is
showing 3D bars whose height is in proportion of the table cells?
---------------
Charles RAUX,
Laboratoire d'Economie des Transports
CNRS-Universit? Lumi?re Lyon 2-ENTPE
email : charles.raux at let.ish-lyon.cnrs.fr
http://www.ish-lyon.cnrs.fr/let
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 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)}