[R] Contingency table and mean(sd)

2012-05-19 Thread Ross, Stephanie
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),

Re: [R] Contingency table and mean(sd)

2012-05-19 Thread David Winsemius
On May 19, 2012, at 7:46 AM, Ross, Stephanie wrote: 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

Re: [R] contingency table

2011-12-21 Thread Rolf Turner
Do you actually know what contingency table means? The tables in your example make no sense at all as contingency tables *especially if obs means observed and exp means expected. You can, however, extra the tables in the manner which you seem to desire, as follows: Let your data object be

[R] contingency table

2011-12-20 Thread reena
Hello, I want to create contingency table. The data which should be presented in contingency table look like this.(Its a very long list. I am copying small part of it) obs1obs2exp1 exp2 3 8 725 875 0 0 5870 3 7

Re: [R] contingency table

2011-12-20 Thread reena
This is my list. obs1obs2exp1 exp2 3 8 725 875 0 0 5870 3 7 435 525 10 7 754 910 0 1 145 175 and i want result in contingency table as obs 3

Re: [R] contingency table

2011-12-20 Thread Marc Schwartz
On Dec 20, 2011, at 12:36 PM, reena wrote: This is my list. obs1obs2exp1 exp2 3 8 725 875 0 0 5870 3 7 435 525 10 7 754 910 0 1 145 175 and i want

Re: [R] Contingency table in R

2011-03-05 Thread John Kane
...@msn.com wrote: From: Laura Clasemann violagirl...@msn.com Subject: [R] Contingency table in R To: r-help@r-project.org Received: Wednesday, March 2, 2011, 9:13 AM 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

Re: [R] Contingency table in R

2011-03-03 Thread Jim Lemon
On 03/03/2011 01:13 AM, Laura Clasemann wrote: 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 Healthy52 9 None 134

[R] Contingency table in R

2011-03-02 Thread Laura Clasemann
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 Healthy52 9 None 134 24 Unhealthy 72 23 These are the error

Re: [R] Contingency table in R

2011-03-02 Thread Ista Zahn
Hi Laura, On Wed, Mar 2, 2011 at 9:13 AM, Laura Clasemann violagirl...@msn.com wrote: 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

Re: [R] Contingency table in R

2011-03-02 Thread Antony Raj
Hi Laura and R users, I would like to know whether we can do siginificance test between Column Yes and Column No. Any one tried? I have seen it in Tabulaiton software packages from our vendors and in SPSS Custom Table. Thanks, On Wed, Mar 2, 2011 at 7:43 PM, Laura Clasemann

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-22 Thread Tsunhin John Wong
Dear David and the list, Thanks for your comment. Unfortunately, I don't have an instructor on R. And I usually don't deal with contingency table analysis. I have consulted more than two books on R already, but I found no good answer. Could you point me to some references about log linear

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-22 Thread Michael Friendly
If you want to *see* the contributions of the cells to the association between lang and cons, try library(vcd) mosaic(~lang+cons, data=langcons.table, shade=TRUE) Tsunhin John Wong wrote: Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C

[R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread Tsunhin John Wong
Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. langcons.table - table(lang, cons) langcons.table[cbind(lang,cons)] - freq langcons.table Adj Int Oth Pas Tra C 69 221

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 8:07 AM, Tsunhin John Wong wrote: Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. langcons.table - table(lang, cons) langcons.table[cbind(lang,cons)]

[R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Hi guys I'm hoping someone can help me with this. It should be easy but it seems to get stuck for no obvious reason! I am trying to set a report up in odfWeave so that we can re-run the same analysis at 3 time points as the data matures and provide an 'instant' report. To simplify the

Re: [R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Solved my own problem by using: odfTable.matrix( as.matrix ( with (mydata, table (site_id, reaction)) ) ) This message may contain confidential information. If

Re: [R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Max Kuhn
Polwart Calum, Although I cannot explain the root issue, it has nothing to do with odfWeave. See the second command below. I don't know your versions etc blah blah blah... class(with (mydata, table (site_id, reaction))) [1] table class(as.matrix(with (mydata, table (site_id, reaction [1]

[R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle
Hello R-Users! I need a little help to build up a contingency table out of several variables. A-c(F,M,M,F,F,F,F,M,F,M,F,F) B-c(0,0,0,0,0,0,1,1,1,1,0,1) C-c(0,1,1,1,1,1,1,1,1,0,0,0) ABC-as.data.frame(cbind(A,B,C)) ABC A B C 1 F 0 0 2 M 0 1 3 M 0 1 4 F 0 1 5 F 0 1 6 F 0 1 7

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Eik Vettorazzi
First of all your construction of ABC leads to a structure with 3 factor variables due to the way cbind processes the input variables - which is not intended I think. You can do sth like ABC-data.frame(A,B,C) aggregate(ABC[,2:3],by=list(A),sum) hth. Birgitle schrieb: Hello R-Users! I

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle
Thanks for your answer. It is intended, that the variables are treated as class factor, because these are binary variables with, for example, the presence or the absence of a plant organ. As far as I understood, I have to treat them for other calculations as factor. Therefore I classified these

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Eik Vettorazzi
Ok, then treat them as factors - but if they are really binary and coded 0 and 1, which kind of calculation would lead to different results for a factor instead of a numeric variable? Anyway, ABC-as.data.frame(cbind(A,B,C)) aggregate(ABC[,2:3],by=list(A),FUN=function(x)sum(x=='1')) # '1' is

Re: [R] contingency table, several variables from dataframe

2008-10-02 Thread Birgitle
I think it makes a difference if I want to use a classification method like rpart () or if I use a modelling approach like glm(). Many thanks for the kind and fast help. I am still very untrained and it is difficult for me to create such codes. B. Eik Vettorazzi wrote: Ok, then treat them

Re: [R] contingency table

2008-02-15 Thread John Kane
Have a look at length(iris$Species) length(prev) --- Carla Rebelo [EMAIL PROTECTED] wrote: 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

[R] contingency table

2008-02-14 Thread Carla Rebelo
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

Re: [R] contingency table

2008-02-14 Thread Henrique Dallazuanna
I don't know if this you want but, you can try: table(data.frame(prev, iris$Species)) On 14/02/2008, Carla Rebelo [EMAIL PROTECTED] wrote: Hello! May you help me? I'm trying to do a contingency table using this data(iris) library(rpart) modelo - rpart(Species ~., iris) prev

Re: [R] contingency table

2008-02-14 Thread Prof Brian Ripley
Try looking at 'prev' (it is a matrix) and then reading ?predict.rpart to see why. My guess is that you intended type=class. On Thu, 14 Feb 2008, Carla Rebelo wrote: Hello! May you help me? I'm trying to do a contingency table using this data(iris) library(rpart) modelo -

[R] contingency table on data frame

2008-01-22 Thread Karin Lagesen
I am sorry if this is a faq or tutorial somewhere, but I am unable to solve this one. What I am looking for is a count of how many different categories(numbers in this case) that appears for a given factor. Example: l - c(Yes, No, Perhaps) x - factor( sample(l, 10, replace=T), levels=l ) m

Re: [R] contingency table on data frame

2008-01-22 Thread Domenico Vistocco
Karin Lagesen wrote: I am sorry if this is a faq or tutorial somewhere, but I am unable to solve this one. What I am looking for is a count of how many different categories(numbers in this case) that appears for a given factor. Example: l - c(Yes, No, Perhaps) x - factor( sample(l,

Re: [R] contingency table on data frame

2008-01-22 Thread John Kane
It is not a good idea to use sample' when building an example like this! Running the code does not give the example dataframe. This is crude but it will do what you want. x - Z Y X 1 4 Yes 2 1 No 3 2 Perhaps 4 3 Yes 5 4 No 6 5 No 7 1 Yes