what does this mean in R-1.8.1 release notes? o median() no longer `works' for odd-length factor variables.
median() has never worked for even-length factors but the error message was rather unclear (complained about sum not working for factors). But it did give an "answer" of sorts for odd-length factors. Now it doesn't work for either, which is a Good Thing, since there is no obvious extension of the idea of numeric median to factors. If you insist you can use median(as.numeric(myfactor)) but you should think very carefully what this actually means. Perhaps it has some kind of meaning for ordered factors, but mostly you'd be better off looking at a table().> -----Original Message----- > From: John Christie [mailto:jc at or.psychology.dal.ca] > Sent: 21 November 2003 13:23 > To: R-help at stat.math.ethz.ch > Subject: [R] what does this mean in R-1.8.1 release notes? > > > Security Warning: > If you are not sure an attachment is safe to open please contact > Andy on x234. There are 0 attachments with this message. > ________________________________________________________________ > > what does this mean in R-1.8.1 release notes? > > o median() no longer `works' for odd-length > factor variables. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >Simon Fear Senior Statistician Syne qua non Ltd Tel: +44 (0) 1379 644449 Fax: +44 (0) 1379 644445 email: Simon.Fear at synequanon.com web: http://www.synequanon.com Number of attachments included with this message: 0 This message (and any associated files) is confidential and\...{{dropped}}
John Christie <jc at or.psychology.dal.ca> writes:> what does this mean in R-1.8.1 release notes? > > o median() no longer `works' for odd-length factor variables.The median has always been undefined for factors, but nevertheless median() gave an answer. If the length was even, it would fail since it needed to average non-numeric values. This confused some and the answer you got for in the odd-length case was meaningless anyway (what's the median of three pears, four apples, and two bananas?). So now we check. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
> From: Peter Dalgaard [mailto:p.dalgaard at biostat.ku.dk] > > John Christie <jc at or.psychology.dal.ca> writes: > > > what does this mean in R-1.8.1 release notes? > > > > o median() no longer `works' for odd-length > factor variables. > > The median has always been undefined for factors, but nevertheless > median() gave an answer. If the length was even, it would > fail since it needed to average non-numeric values. This > confused some and the answer you got for in the odd-length > case was meaningless anyway (what's the median of three > pears, four apples, and two bananas?). So now we check.Why not just give an error if median is given an unordered factor? Andy> -- > O__ ---- Peter Dalgaard Blegdamsvej 3 > c/ /'_ --- Dept. of Biostatistics 2200 Cph. N > (*) \(*) -- University of Copenhagen Denmark Ph: > (+45) 35327918 > ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: > (+45) 35327907 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo> /r-help >