s-news
[Top] [All Lists]

Re: [S] ordinal outcomes

To: "Hui-Lin Hu" <huilin@u.washington.edu>, <s-news@wubios.wustl.edu>
Subject: Re: [S] ordinal outcomes
From: "Frank E Harrell Jr" <fharrell@virginia.edu>
Date: Mon, 23 Mar 1998 23:46:34 -0500
Reply-to: "Frank E Harrell Jr" <fharrell@virginia.edu>
Sender: owner-s-news@wubios.wustl.edu
Dear Hui-Lin,

S-news asks subscribers to try contacting the author of the add-on
library first.  -Thanks

lrm does not accept a frequency weight at present.
Be sure to give modeling functions the basic categorical predictors instead
of deriving dummy variables yourself.  So the answer to your question is
to build a data frame that repeats each row of your data up to the needed
frequency, then do lrm(response ~ cheese, data=newdataframe). I'll leave
it to someone else to devise an elegant way to expand the data frame
by the frequency variable.  Something along the lines of

  newdataframe <- original.data.frame[s,]

will do it once a very long vector s is created (using rep) that has duplicate
row
numbers.  The length of s will equal the sum of the frequencies.

lrm does not handle frequency weights because all of my datasets have at least
one continuous variable in them.

-Frank Harrell


-----Original Message-----
From: Hui-Lin Hu <huilin@u.washington.edu>
To: s-news@wubios.wustl.edu <s-news@wubios.wustl.edu>
Date: Monday, March 23, 1998 9:19 PM
Subject: [S] ordinal outcomes


>
>
>Hi there,
>
>This should be easy for those who has ever used Harrell's lrm function.
>It is the first time for me to use this function, but I have not been able
>to make it work. I am not sure what went wrong. Could any of you help me?
>What exactly should be written in () of lrm()?
>
>Here is the cheese data from page 175 of McCullagha and Nelder.
>How to use lrm() to get the logistic treatment effects on page 176 of this
>book?
>
>col 1 (x1) = 1 if Cheese = A
>col 2 (x2) = 1 if Cheese = B
>col 3 (x3) = 1 if Cheese = C
>col 4 (y)  : Response category
>col 5 (wt) : Count in each cell of the crosstable "Cheese * Categorical
>                                                           Response"
>
> 1 0  0 1  0
> 1 0  0 2  0
> 1 0  0 3  1
> 1 0  0 4  7
> 1 0  0 5  8
> 1 0  0 6  8
> 1 0  0 7 19
> 1 0  0 8  8
> 1 0  0 9  1
> 0 1  0 1  6
> 0 1  0 2  9
> 0 1  0 3 12
> 0 1  0 4 11
> 0 1  0 5  7
> 0 1  0 6  6
> 0 1  0 7  1
> 0 1  0 8  0
> 0 1  0 9  0
> 0 0  1 1  1
> 0 0  1 2  1
> 0 0  1 3  6
> 0 0  1 4  8
> 0 0  1 5 23
> 0 0  1 6  7
> 0 0  1 7  5
> 0 0  1 8  1
> 0 0  1 9  0
> 0 0  0 1  0
> 0 0  0 2  0
> 0 0  0 3  0
> 0 0  0 4  1
> 0 0  0 5  3
> 0 0  0 6  7
> 0 0  0 7 14
> 0 0  0 8 16
> 0 0  0 9 11
>
>
>
>
>
>
>
>-----------------------------------------------------------------------
>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
>

-----------------------------------------------------------------------
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

<Prev in Thread] Current Thread [Next in Thread>