As my earlier email said I am not getting the maxcls. I do get numbers coded as 1,2,3 for BMIGRP(when I print BMIGRP) but not getting the max of (1,2,3) which should be 3, I guess. Thanks for your help Anamika
Anamika Chaudhuri <[EMAIL PROTECTED]> wrote: > dset1<-cbind(AGE,BMI,DEATH) > BMIGRP<-cut(BMI,breaks=c(14,20,25,57),right=TRUE) > levels(BMIGRP) [1] "(14,20]" "(20,25]" "(25,57]" > BMIGRP1<-as.numeric(BMIGRP) > AGEGRP<-floor(AGE/10)-2 > dset<-cbind(AGEGRP,BMIGRP1,DEATH) > maxage<-max(dset[,1]) > minage<-min(dset[,1]) > maxcls<-max(dset[,2]) > maxcls [1] NA Why doesnt it give me a no for maxcls then? Thanks. "Richard M. Heiberger" <[EMAIL PROTECTED]> wrote: > x <- rnorm(100) > xx <- cut(x,3) > levels(xx) [1] "(-2.37,-0.716]" "(-0.716,0.933]" "(0.933,2.58]" > as.numeric(xx) --------------------------------- --------------------------------- [[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