Dear list I have a response variable coded 0/1 i.e. a binary response. There are 20,000 individual responses that I would like to aggregate into numbers of each category (i.e. 0/1) by group called dn (350 different groups) and by month mth (there are several hundred responses per month. What is the simplest way to perform this operation in R?
?aggregate ? On Thu, Dec 24, 2009 at 7:56 AM, Graham Leask <grahamleask@btinternet.com>wrote:> Dear list > > I have a response variable coded 0/1 i.e. a binary response. There are > 20,000 individual responses that I would like to aggregate into numbers of > each category (i.e. 0/1) by > group called dn (350 different groups) and by month mth (there are several > hundred responses per month. > > What is the simplest way to perform this operation in R? > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
may be ?table ? On Thu, Dec 24, 2009 at 7:56 AM, Graham Leask <grahamleask@btinternet.com>wrote:> Dear list > > I have a response variable coded 0/1 i.e. a binary response. There are > 20,000 individual responses that I would like to aggregate into numbers of > each category (i.e. 0/1) by > group called dn (350 different groups) and by month mth (there are several > hundred responses per month. > > What is the simplest way to perform this operation in R? > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
?tapply ------------------------- cuncta stricte discussurus ------------------------- -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Graham Leask Sent: Thursday, December 24, 2009 7:57 AM To: r-help at r-project.org Subject: [R] aggregate binary response data Dear list I have a response variable coded 0/1 i.e. a binary response. There are 20,000 individual responses that I would like to aggregate into numbers of each category (i.e. 0/1) by group called dn (350 different groups) and by month mth (there are several hundred responses per month. What is the simplest way to perform this operation in R? ______________________________________________ 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.