Displaying 20 results from an estimated 1000 matches similar to: "Displaying Counts of Unused Factors in Contingency Tables with table()"
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
2011 Jun 09
2
Coercing Output from mget() into Proper Data Frame
Hello R-philes:
I have the following function that gets the output of mget() and
converts it to a data frame to return. What I am finding is that the
dimensions are wrong. Basically, I get:
bridesmaid wed u see m gt lt like love X.0 dress pagetrack one go X3 get
1 56 35 27 30 24 20 20 23 28 17 25 16 16 28 15 26
Instead, I want something like:
[1] bridesmaid
2010 Jan 22
2
Computing Confidence Intervals for AUC in ROCR Package
Dear R-philes,
I am plotting ROC curves for several cross-validation runs of a
classifier (using the function below). In addition to the average
AUC, I am interested in obtaining a confidence interval for the
average AUC. Is there a straightforward way to do this via the ROCR
package?
plot_roc_curve <- function(roc.dat, plt.title) {
#print(str(vowel.ROC))
pred <-
2009 Oct 22
1
Converting a Vector into a 2-level Factor
Hello Everyone,
Let's say I have a vector as follows:
vowels = c("aa", "aa", "ah", "ao", "eh)
I want to make a factor consisting of two levels: the things that are
"aa" and those that are not "aa". How would I do that?
I tried using factor(vowels, levels=c("aa", "~aa"), exclude=NULL), but
this gives
2009 Nov 25
0
ROCR Issue: Averaging Across Multiple Classifier Runs in ROC Curve
Dear R-philes,
I am having some trouble averaging across multiple runs of a
classifier in an ROC Curve. I am using the ROCR package and the
plot() method.
First, I initialize a list with two elements where each element is a
list of predictions and labels:
vowel.ROC <- list(predictions=list(), labels=list())
For every run of the classifier, I append the scores and labels to
their
2006 Jul 18
2
A contingency table of counts by case
Here is an example of the data.frame that I have,
df<-data.frame("case"=rep(1:5,each=9),"id"=rep(1:9,times=5),"x"=round(runif(length(rep(1:5,each=9)))))
"case" represents the cases,
"id" the persons, and
"x" is the binary state.
I would like to know in how many cases any two persons
a. both have "1",
b. the first has
2006 Sep 22
3
Compiling a contingency table of counts by case
I have asked a similar question before but this time
the problem is somewhat more involved. I have the
following data:
case;name;x
1;Joe;1
1;Mike;1
1;Zoe;1
2;Joe;1
2;Mike;0
2;Zoe;1
2;John;1
3;Mike;1
3;Zoe;0
3;Karl;0
I would like to count the number of "case"
in which any two "name"
a. both have "x=1",
b. the first has "x=0" - the second has
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
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:
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
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
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 Apr 24
3
Detailed contingency tables
Is there any existing function for creating contingency tables that will
display counts, row, column, and cell percentages in the same
tables....anything similar to crosstabs in S?
Marc W. Zodet, MS
Health Statistician
Center for Cost and Financing Studies
Division of Statistical Research and Methods
2101 East Jefferson Street, Suite 500
Rockville, Maryland 20852
Phone: 301-594-7072
Fax:
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
2008 Mar 18
1
ask for help how to get accumulate contingency table?
Hi, I post the question again.
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 tr
2 1 1
4 0 1
3 1 1
2 1 1
4 1 1
3 1 1
2 0 1
4 0 1
3 0 1
2 0 1
4 0 1
3 1 1
3 0 2
2 0 2
>table(data1)
tr = 1
y
x 0 1
2 2 2
3 1 3
4 3 1
tr = 2
y
x 0 1
2 2 2
3 2 2
4 1 3
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]]
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]]
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"