search for: crosstabul

Displaying 20 results from an estimated 32 matches for "crosstabul".

Did you mean: crosstable
2006 Dec 03
2
Force "square" crosstabulation
Hello list members, I'm looking for a way to force the results of a crosstabulation to be square - that is, to include 0 values. For example: table(letters[1:4],letters[c(1:3,3)]) yields: a b c a 1 0 0 b 0 1 0 c 0 0 1 d 0 0 1 I would like to return: a b c d a 1 0 0 0 b 0 1 0 0 c 0 0 1 0 d 0 0 1 0 Any suggestions? Thanks! -- Manuel A. Morales htt...
2010 May 20
2
multiple 2 by 2 crosstabulations?
...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...
2008 Nov 13
2
CROSSTABULATION
I want to form a 3x3 crosstabulation for the signs of two vectors (i.e. Negative, Zero, Positive). The problem is that I am simulating the data so for some iterations one of the categories is absent. Thus the resulting table shrinks to 3x2. I want it to be 3x3 with zero column corresponding to the missing category. Moreover, I ha...
2009 Oct 12
1
crosstabulation and unlist function
...ello R-users, My toy example: aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") df<-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation between table(unlist(df[,1:3])) and df$dd? I want to find out when dd==A (or B, or C) how many times do the values 1, 2 ,3,.. appear in df[,1:3]? Thank you very much! Eugen Pircalabelu
2000 Sep 24
2
FW: Crosstabulation
how about this: tapply(vector,list(factor1,factor2),function)? -----Original Message----- From: owner-r-help at stat.math.ethz.ch [mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Murray Jorgensen Sent: 24. september 2000 02:46 To: R-help Subject: [R] Crosstabulation I can't seem to find a function in R similar to Splus crosstabs() for creating a multi-way table from factors and a count vector. Murray Jorgensen -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~...
2003 May 17
1
how to handle 'multiresponse' variable?
...tiple responses are elements of character vectors, like this: $ P124 :List of 2956 ..$ : chr "2" "4" ..$ : chr "1" "2" ..$ : chr "NA" ..$ : chr "3" "4" ..$ : chr "3" I need to compute crosstabulation on this variable, to make crosstabulation where this variable is a factor variable (responses of this variable are categories, in which i need to compute distributions of other variables). And i need to do crosstabulation with 'weights', like in xtabs(w~f1+f2). Is any way exists t...
2001 Sep 06
0
crosstabulation
Hi, I find difficult to read crosstabulated data without percentages, so I wrote this dirty function that may be useful to others. It only works up to 3 dimensions since I am not very good at programming in R. I would appreciate if someone else has a better similar function or can improve this one. As an example of use: > x<-rb...
2003 Aug 22
2
"subscript out of range" message
Hi All: I was recently working with a dataset on arsenic poisoning. Among the variables in the dataset, I used the following three variables to produce crosstabulations (variable names: FOLSTAT, GENDER, ASBIN; all three were categorical variables, FOLSTAT denoted follow up status for the subjects and had seven levels, GENDER denoted sex (two levels: male,female), and ASBIN denoted binarized arsenic concentrations (two levels: "<0.05", "&...
2002 Jul 12
2
Crosstabs in R
Before I reinvent the wheel, I have need for a relatively straightforward crosstabulation (2 x n) function. I know that R has table(), ftable(), xtabs(), and summary(xtabs()), but none of these produce a fully "tricked" out cross-tabulation with marginal totals, expected cell frequencies, and an array of statistics about the contingency table. Is there a more complet...
2002 May 23
2
crosstabulation of means
Hello, I am trying to print a crosttabulation of mean,sd,n for a continuous variable crossclassified by anoother/s grouping variables. I came up with: xtab2 <- function(x,g1,g2) { funy <- function(z) list(mean(z,na.rm=T),sd(z,na.rm=T),length(z)) aa <- by(x,list(g1,g2),funy) bb <- matrix(unlist(aa),nrow=3 ,dimnames=list(c("mean","sd","n"),
2017 Jul 03
2
R memory limits on table(x, y) (and bigtabulate)
I have two character vectors x and y that have the following characteristics: length(x) # same as length(y) # 872099 length(unique(x)) # 47740 length(unique(y)) # 52478 I need to crosstabulate them, which would lead to a table with 47740*52478 # 2505299720 cells, which is more than 2^31 # 2147483648 cells, which seems to be R's limit because I am getting the error message Error in table(x, y) : attempt to make a table with >= 2^31 elements Two questions: - is this really...
2006 Jun 14
4
could someone tell me how to implement a multiple comparison test for proportions in a 2xc crosstabulation
Dear all, I wanna to do multiple comparison test for proportions (multiple chi squre ?), could someone tell me how in R, thank you!
2011 Aug 28
4
How do I get a weighted frequency table?
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110828/d35f51a1/attachment.pl>
2006 Apr 26
3
Were to find appropriate functions for a given task in R
...his is a generic request concerning were to look for finding appropriate information on a precise procedure in R. I’m using R for teaching introductory statistics and my students are learning how to deal with it. However, I find it difficult to locate some of the procedures. For instance, for basic crosstabulation, it is obvious that basic functions as table, ftable, and prop.table can be used. But there is a CrossTable function that is very useful. This is hidden in gmodels and gregmisc, as far as I’ve been able to explore the packages. However, there is no way (unless I sit down to r-help for hours) t...
2006 May 02
1
Is there a bug in CrossTable (gmodels)
Library gmodels include a function CrossTable that is useful for crosstabulation. In the help, it is indicated that one can call this function as CrossTable(data), were data is a matrix. However, when I try to use this option, it doesn't help. Any idea? Is there a bug? Thanks for your help. Prof. Albert Sorribas Grup de Biomatem?tica i Bioestad?stica Departament de C...
2008 Sep 23
1
Generalising to n-dimensions
...a way of giving it every set without stating each set individually. Secondly and similarly, I want to get the table within crosstable that has the elements defined by the combinations given in expand above crosstable[,,expand[d,1],expand[d,2],expand[d,3],...expand[d,n]] where crosstable is just a crosstabulation of an n+2-dimensional dataset and I am trying to pick out those that are in combination 'd' of expand. So for example, using x[1]=2 and x[2]=3 as above example, if d =2 then the order is 2,1 so I take crosstable[,,2,1]. Can anyone suggest a way to give the code every set without stati...
1998 Oct 22
1
crosstab means
I would like to obtain a crosstabulation of means(var, quantiles...) i.e. I have a data frame with Var-i, Var-j, Var-k, Var-X, var-Y I like to have the mean of Var-X for each combination of Var-i,Var-j. One solution would be: by(var-i,Var-j,mean(Var-x)) but I would like it better formatted and with mean,S.Dev,n for each cell? Does a...
2008 Feb 19
3
simple usage of "for"
Hi list I have a data frame I would like to loop over. To begin with I would like crosstabulations using the first variabel in the data frame, which is called "meriter". > table(meriter[[1]], meriter[[3]]) ja nej Annan...
2006 Apr 25
1
by() and CrossTable()
I am attempting to produce crosstabulations between two variables for subgroups defined by a third factor variable. I'm using by() and CrossTable() in package gmodels. I get the printing of the tables first and then a printing of each level of the INDICES. For example: library(gmodels) by(warpbreaks, warpbreaks$tension, fun...
2004 Jan 29
3
Developmental version of Matrix package for R-1.9.0
...ustrates the performance of different ways of performing least squares calculations, using an example from Koenker and Ng's SparseM package. The results are, I think, impressive. Although not documented in this release, there are the beginnings of routines to represent large, sparse, pairwise crosstabulations as sparse matrices. I am using these in calculations for mixed-effects models and I understand that others may be interested in them for other applications. I would be happy to correspond off-list if you would like a preview of the capabilities. Metis is a package for partioning unstructur...