Dear friends,

I have a data set with 23 columns and 38000 rows. It is a panel running from 
the years 1991 through 2005. I want to aggregate the data and get the medians 
of each of the 23 columns for each of the years. In other words my output 
should be like this

Year     Median

1991        123
1992        145
1993        132

etc.

The sample lines of code to do this operation is

set1 <- subset(as.data.frame(dataset),rep1==1)
set2 <- subset(as.data.frame(dataset),rep1==0)
lst <- list(unique(yeara))

y1 <- aggregate(set1,lst,median)
y2 <- aggregate(set2,lst,median)

However I'm getting an error as follows
Error in FUN(X[[1]], ...) : arguments must have same length

Can somebody please help me with what I'm doing wrong here?

Thanks in advance
Regards

Anup



       
---------------------------------

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to