similar to: constructing a contingency table (ftable, table)

Displaying 20 results from an estimated 2000 matches similar to: "constructing a contingency table (ftable, table)"

2012 Jan 26
1
ftable.formula
I apologize in advance if this is the wrong forum for this report/request, and for the fact that I have not read the code for ftable.formula in any detail. >From reading the documentation for ftable.formula, I expected that the following two calls to ftable would produce the same results: data(UCBAdmissions) ftable(UCBAdmissions, row.vars = "Dept", col.vars = c("Gender",
2020 May 13
7
justify hard coded in format.ftable
Dear all, I haven't received any feedback so far on my proposal to make "justify" argument available in stats:::format.ftable Is this list the appropriate place for this kind of proposal? I hope this follow-up to my message won't be taken as rude. Of course it's not meant to be, but I'm not used to the R mailing lists... Thank you in advance for your comments, Best,
2010 Jun 01
1
loop
Can any one help it will be very kind, loop statements I have this table and some more records, I want to reshape it V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 TP53 Dis1 Dis2 Dis3 Dis4 Dis5 Dis6 DCI New1 New2 New3 New4 FDI Hi2 H3 H4 GHD I1 I3 I4 I5 I6 I7 I8 I want my new table or matrix to be some thing like this V1 V2 V3 Tp53 Dis1 Dis2 Tp53 Dis1 Dis3 Tp53 Dis1 Dis4 Tp53 Dis1 Dis5 Tp53 Dis1 Dis6 Tp53 Dis2
2011 Jun 24
1
Converting an ftable (contingency table) to a dataframe in R
I am generating an ftable (by running ftable on the results of a xtabs command) and I am getting the following. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Var1? Var2 date ? ? ? ? ? ? ? ? group? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2007-01-01? ? ? ? ? q1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1? ? 9 ? ? ? ? ? ? ? ? ? ? ?q2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
2007 May 05
1
How to latex tables?
Suppose I have a table constructed from structable or simply just an object of class table. How can I convert it to a latex object? I looked in RSiteSearch, but only found info about matrices or data frames. Steve For example, here is a table t2 > str(t2) table [1:2, 1:2, 1:2] 6 8 594 592 57 ... - attr(*, "dimnames")=List of 3 ..$ Hospital : chr [1:2] "A"
2012 Dec 17
2
Suggestion: 'method' slot for format.ftable()
Dear R-developers, I would like to suggest a 'method' slot for format.ftable() (see an adjusted 'format.ftable()' below, taken from the source of R-2.15.2). At the moment, format.ftable() contains several empty cells due to the way the row and column labels are printed. This creates problems (= unwanted empty columns/rows) when converting an ftable to a LaTeX table; see an
2012 Mar 19
1
Lag based on Date objects with non-consecutive values
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a variable against a Date formatted column. That is relatively easy to do. The problem arises when I
2010 Dec 02
1
latex tables for 3+ dimensional tables/arrays
I'm looking for an R method to produce latex versions of tables for table/array objects of 3 or more dimensions, which, of necessity is flattened to a 2D display, for example with ftable(), or vcd::structable, as shown below. I'd be happy to settle for a flexible solution for the 3D case. > UCB <- aperm(UCBAdmissions, c(2, 1, 3)) > ftable(UCB) Dept A B
2010 Jun 22
2
constructing a data frame from ftable
Dear R People: I have the following data set with the columns DATE, GENDER, and Co. Co has 8 possible options. > a.df[1:10,] DATE GENDER Co 1 2009-04-16 F Rash 2 2009-04-16 F Other 3 2009-04-16 M Botulinic 4 2009-04-16 M Other 5 2009-04-16 M Constitutional 6 2009-04-16 F Other 7 2009-04-16
2009 Oct 11
3
Error in family$family : $ operator is invalid for atomic vectors
Dear List, I'm having problem with an exercise from The R book (M.J. Crawley) on page 567. Here is the entire code upto the point where I get an error. data(UCBAdmissions) x <- aperm(UCBAdmissions, c(2, 1, 3)) names(dimnames(x)) <- c("Sex", "Admit?", "Department") ftable(x) fourfoldplot(x, margin = 2) dept<-gl(6,4) sex<-gl(2,1,24)
2001 Jun 12
1
cophenetic matrix
Hello, I analyse some free-sorting data so I use hierarchical clustering. I want to compare my proximity matrix with the tree representation to evalute the fitting. (stress, cophenetic correlation (pearson's correlation)...) "The cophenetic similarity of two objects a and b is defined as the similarity level at wich objects a and b become members of the same cluster during the course of
2006 Mar 17
1
Wishlist: 'append' argument for write.ftable()
I would like to suggest that an 'append' argument be added to write.ftable(). This would allow, for example, the user to append ftable() output to a text report. I have attached an svn patch to ftable.R that makes the proposed change to write.ftable(). [A very trivial change since 'append' is simply passed to cat().] I have also attached a patch to read.ftable.Rd which documents
2006 Jul 15
1
Some problems with latex(ftable)
The ftable structure is not an ordinary matrix. Instead, it has the body of the table with several cbind- and rbind-ed rows and columns of label information. The example in ?ftable has two row factors and two column factors. Continuing with the example in ?ftable, enter tmp <- ftable(mtcars$cyl, mtcars$vs, mtcars$am, mtcars$gear, row.vars = c(2, 4), dnn =
2008 Jul 02
1
exporting ftable
How can I export an ftable object in the same format that appears in R command window? For testing that i was using this example that is in help of this function. ## Start with a contingency table. ftable(Titanic, row.vars = 1:3) ftable(Titanic, row.vars = 1:2, col.vars = "Survived") ftable(Titanic, row.vars = 2:1, col.vars = "Survived") ## Start with a data frame. x <-
2011 May 27
1
How to convert an ftable object to a matrix including the row names?
Dear expeRts, What's the easiest way to convert an ftable object to a matrix such that the row names of the ftable object are shown in the first couple of columns of the matrix? This is (typically) required, for example, when the final goal is to print the matrix via xtable. Below is a rather complicated example of how to do it... Cheers, Marius ## Goal: convert an ftable() to a
2007 Jun 23
2
latex of ftable (Hmisc?)
Dear latexRs, I tried to make a latex printout of a simple categorial ftable. It should look like the output of print.ftable. Any ideas how to get the syntax of summary.formula right. Or some alternative? As far I see, xtable does not have method for ftable. Dieter library(Hmisc) n=500 sex <- factor(sample(c("m","f"), n, rep=TRUE)) treatment <-
2008 Mar 12
1
ftable and xtabs
Hoping someone can help me with xtabs and ftable. I'm trying to get a pair of ftables (possibly more) next to each other. For example: > dunhill_lights_xtab<-ftable(xtabs(grossedupobs ~ gender+age_group + dunhill_lights, data = ciggs)) > dunhill_lights_xtab dunhill_lights No Yes gender age_group Female
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
Further to the discussion between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
Further to the discussion between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp
2005 Jan 10
4
Graphical table in R
I would like R to produce some tabulated data in a graphical output. When I say tabulated data, what I mean is a table with rows and columns. This would be useful when reading in a big file, performing some analysis on it, and then wanting to display the results as a table. Something like plot(x,...) where x is a matrix For example, the result could look (approximatly) like...