[S] by() function

Weiguo Fan (fanwg@iscs.nus.edu.sg)
Wed, 6 May 1998 18:29:30 +0800 (GMT-8)


Dear S-PLUS users,

I once posted a message regarding applying regression function to
crosstabulated data set. For example, in data frame DATA, one factor A1
has 4 levels, another A4 has 6 levels, so in combination, there should be
24 levels.

Several people has suggested me to use the by() function.

I used by() to get the first result.

Then I manually split the DATA frame to 24 subsets and applyed the
function to each of them. I got the second result.

To my surprise, these two results are quite different.

Can anybody tell me how is by() implemented in S-PLUS? How to explain
such a difference? Which approach should be adopted in real practice?

Thanks for any suggestion!

Best,

Weiguo

----------------------------------------------------------------------
Mr. Weiguo Fan
Department of Information Systems and Computer Science
National University of Singapore
Lower Kent Ridge Road
Singapore 119260

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news