"gss1990.original" <- structure(list(y = as.integer(c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27, 30, 50, 60)), Male = as.integer(c(65, 11, 13, 14, 26, 13, 15, 7, 21, 2, 24, 6, 3, 0, 3, 3, 0, 0, 7, 0, 0, 1, 1, 0, 3, 1, 1)), Female = as.integer(c(128, 17, 23, 16, 19, 17, 17, 3, 15, 2, 13, 10, 3, 1, 10, 1, 1, 1, 6, 1, 1, 0, 3, 1, 1, 0, 0))), .Names = c("y", "Male", "Female" ), class = "data.frame", row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27" )) x<-gss1990.original x1<-x[x[,2]>0,1] x2<-x[x[,2]>0,2] x3<-x[x[,3]>0,1] x4<-x[x[,3]>0,3] gss1990 <- list( y1=x1, counts.males=x2, y2=x3, counts.females=x4 ) # ungrouped data y1<-rep(x[,1],x[,2]) y2<-rep(x[,1],x[,3]) n1<-length(y1) n2<-length(y2) gss1990<- list( n=c(n1,n2), y=c(y1,y2), gender=c( rep(0,n1), rep(1,n2) ) ) dput(gss1990, control = "useSource")