Hello, I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like sometimes to have the median (Q1 - Q3), or frequency and proportion, etc. CrossTable, xtab, etc... do not allow for multiple 2 by 2 crosstabulation. The table would look like this: var_1 var_2 var3, ... var_1 a b c var_2 d e f var_3 .. ... ... with a, b, c, ... the results of each crosstabulation. I have continuous and categorical variables. Any idea? Thank you very much, David. [[alternative HTML version deleted]]
On May 19, 2010, at 9:10 PM, Biau David wrote:> Hello, > > I have a dataframe (var_1, var_2, ..., var_n) and I would like to > export summary statistics to Latex in the form of a table. I want > specific summary statistics by crossing numerous variables 2x2 AT > ONCE. In each cell I would like sometimes to have the median (Q1 - > Q3), or frequency and proportion, etc. CrossTable, xtab, etc... do > not allow for multiple 2 by 2 crosstabulation. The table would look > like this: > > var_1 var_2 var3, ... > var_1 a b c > var_2 d e f > var_3 .. ... ... > > with a, b, c, ... the results of each crosstabulation. I have > continuous and categorical variables. > > Any idea?The problem I face is you have used too many "..."'s, and "etc"'s and not enough R code. You probably have a clear idea what "summary statistics by crossing numerous variables 2x2 AT ONCE" means but I do not. It is possible that the describe.formula in Hmisc or the summaryBy function in the doBy package may be helpful, but that is merely a guess.> > Thank you very much, > > David. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT
Hi,> >I am trying to describe a data.frame by obtaining multiple crosstable summary statistics at once. I have tried table, xtab, crosstable, summaryBy and describe but none of these functions seems to allow muliple conparisons at once. > Here, is what I would like to do: > >I have, for instance, age, sex (M and F), grade (1, 2, 3) and site (limb, trunk) and I want the, for instance, following summary statistics: >- age (mean, SD) for males and age for females >- age for grade 1, grade2, and grade 3 >- age for site limb, site trunk >- sex (count, proportions) for grade 1, grade2, and grade 3 >- sex (count, proportions) site limb, site trunk (already have sex/age above) >- grade (count, proportions) for site limb, site trunk (already have grade/sex and grade/age above) >a >lso, I want each of these not crossed by any others (mean overall age, numbers of males, etc) which could be seen as each crossed with its own. > >I have at least 10 variables, continuous, categorical ordered and non ordered. I don't want any tests. > >Any idea? > >David Biau. >[[alternative HTML version deleted]]