Displaying 20 results from an estimated 3000 matches similar to: "Tests on contingency tables"
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
2006 Oct 03
1
Reshape into a contingency table/Fisher's test
Dear all,
how can I "reshape"/"cast" the following matrix
00;01;10;11
John.Mike;123;313;12;31
John.Jim;54;57;39;36
John.Steve;135;47;47;74
Mike.Jim;63;37;27;16
Mike.Steve;15;15;5;61
Jim.Steve;6;10;34;35
into a set of stacked 2x2 contingency tables
0;1
John;123;12
Mike;313;31
John;54;39
Jim;57;36
John;135;47
Steve;47;16
...
so that the "fisher.test" and
2009 Feb 24
2
Simulating contingency table (Basic question, help please)
I'd like to carry out a Monte Carlo simulation test where given data is a
contingency table. I think this is something to do with using rmultinonom(),
but I'm not sure how to code this, to simulate contingency tables. Could
anyone please help with how to use R to simulate contingency tables like
this?
-- 
View this message in context:
2001 Apr 15
1
contingency tables in R
Dear List:
Most of the analysis I do involves contingency tables.
 I am migrating to R from Stata and I have a number of
questions about using contingency tables in R.  I
suspect that most of the things I want to do are very
short R scripts that people on this list probably
have.  I wonder if you would be willing to share them.
 
First, the presentation of tables by table() is not
2012 Dec 01
4
Getting all possible contingency tables
Hello all,
Let say I have 2-way contingency table:
Tab <- matrix(c(8, 10, 12, 6), nr = 2)
and the Chi-squared test could not reject the independence:
 > chisq.test(Tab)
         Pearson's Chi-squared test with Yates' continuity correction
data:  Tab
X-squared = 1.0125, df = 1, p-value = 0.3143
However I want to get all possible contingency tables under this 
independence
2011 Mar 02
4
Contingency table in R
Hi,
 
I have a table in R with data I needed and need to create a contingency table out of it. The table I have so far looks like this:
 
 
                   Binger
r
DietType     No Yes
  Dangerous  15  12
  Healthy    52   9
  None      134  24
  Unhealthy  72  23
 
These are the error messages that I keep getting whenever I try to get a contingency table. I'm not sure why it won't work
2012 Aug 10
2
creating a contingency table from a data.frame automatically (NOT BY HAND)
Hello there!
I am still struggling with a binomial response over all categorical 
variables (some of them with 3 levels, most with 2 levels). After 
initial struggles with glm's (struggle coming from the data, not the 
actual analysis) I have decided to prefer contingency tables. I have my 
data such as:
response:
2012 May 19
1
Contingency table and mean(sd)
Hi All,
I have a question regarding contingency tables. I would like to calculate the mean and standard deviation of a continuous variable from my own dataset based on the percentages of a contingency table I obtained from a scientific article.
dataset<- data.frame(cbind(case=rep(0:1,5), x1=c(1:10), x2=c(0:9)))
contingency_table<- matrix(c(100, 75, 65, 85, 90, 87), nrow=3, ncol=3)
In
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 
2013 Mar 04
1
package ‘contingency.tables’ is not available (for R version 2.15.2)
I am trying to create contingency tables (to evaluate prior to performing
Pearson's Chi-Squared test for independence). I would like to see column
and row totals as well as expected and observed values and cell counts.
I tried to use the package "contingency. tables" but get the following
warning:
 package ‘contingency.tables’ is not available (for R versions 2.15.2)
Is there
2008 Feb 14
3
contingency table
Hello!
May you help me? I'm trying to do a contingency table using this
 > data(iris)
 > library(rpart)
 > modelo <- rpart(Species ~., iris)
 > prev <- predict(modelo, iris)
Finally the contingency table
 > table(iris$Species, prev)
But an error occurs:
Error in table(iris$Species, prev) :
  all arguments must have the same length
And I do not understand why, may you
2011 Feb 24
1
reshaping list into a contingency table
Hi all,
I have been struggling with this problem for a few days.  
I have a data table like this:
gene	     rpkm1	     diff1	     rpkm2	     diff2
gene1	23		50		13		120
gene2	111		220		827		1200
gene3	75		998		71		910
And I want to re-format it so that, for each gene, I have a 2x2 contingency
table, such as:
gene	      rpkm	       diff
gene1	23		50
gene1	13		120
gene2	111		220
gene2	827	
2010 Jul 08
1
mimic SPSS contingency table results
Dear all
Seems that puzzles always come in packs. I was asked to help with some 
statistics in blood analysis. (You can not refuse your wife's asks :-).
She has contingency table for values IgVH mutation and ZAP expression. I 
can do chi-square test (in R) and get a results, and with some literature 
I can try explain them. However she found an article in which they use 
SPSS and use
2005 Dec 06
3
Coefficient of association for 2x2 contingency tables
Hi,
Found no measure of association or correlation for 2x2 contingency tables in 
fullrefman.pdf or google. Can someone point to a package that implements such 
calculations?
Thanx.
-- 
        Alexandre Santos Aguiar
- consultoria para pesquisa em sa??de -
         R Botucatu, 591 cj 81
           tel 11-9320-2046
           fax 11-5549-8760
        www.spsconsultoria.com
2000 Sep 20
1
SV: sample from contingency table
I have had the same problem and I wrote this function
rmulti <- function(n, size, p)
{
  NrDim <- length(p)
  if(NrDim<2) stop("The simulated variabel has to be at least
2-dimensional")
  res <- matrix(data=NA, nrow=n, ncol=NrDim)
  p <- p/sum(p)
  TempSize <- size
  for(i in 1:NrDim)
  {
    TempP <- p[i]/sum(p[i:NrDim])
    TempBin <- rbinom(n=n, size=TempSize,
2012 May 28
2
import contingency table
hello everyone,
i often work on contingency table that I create from data.frame (with
table() function)
but a friend sent me an excel sheet wich *already is* a contingency
table (just a simple 2 way table !...)
any clue on how to import it in R (keeping row names and col names) ?
any tuto I come accross only mention the table transformation, but
never the import of such data
I only found
2010 May 24
1
high-dimensional contingency table
Dear Friends.
I am just starting to use R. And in this occasion I want to construct a
high-dimensional contingency table, because I want to crate a mosaic plot
with the vcd package.
My table is in this format:
    año ac.rep    cat.gru conteos
1  2005      R    parejas     253
2  2005      N    parejas      23
3  2006      R    parejas     347
4  2006      N    parejas      39
5  2007      R   
2007 Jan 09
1
contingency table analysis; generalized linear model
Dear List,
I would appreciate help on the following matter:
I am aware that higher dimensional contingency tables can be analysed using either log-linear models or as a poisson regression using a generalized linear model:
log-linear:
loglm(~Age+Site, data=xtabs(~Age+Site, data=SSites.Rev, drop.unused.levels=T))
GLM:
glm.table <- as.data.frame(xtabs(~Age+Site, data=SSites.Rev,
2011 Apr 06
1
Creating a symmetric contingency table from two vectors with different length of levels in R
Hello,
How can I create a symmetric contingency table from two categorical vectors
having different length of levels?
For example one vector has 98 levels
TotalData1$Taxa.1
 [1] "Aconoidasida"                     "Actinobacteria (class)"
"Actinopterygii"                   "Alphaproteobacteria"
 [5] "Amoebozoa"                       
2010 Jan 21
1
Factor contingency tables
Hello,
I know there must be a simple soluton to this problem but it eludes me
currently.
My data is partitioned into two subsets, each subset has a common column
factor but with varying levels:
levels(fdf_ghc$AgeDemo)
[1] "26TO35" "36TO45" "46TO55" "56TO65" "66TO75" "76TO85"
levels(fdf_ghcnull$AgeDemo)
[1] "26TO35"