Re: [S] Summary: GUI subset, log.regression prediction

Prof Brian D Ripley (ripley@stats.ox.ac.uk)
Sun, 14 Jun 1998 09:10:34 +0100 (BST)


On Sat, 13 Jun 1998, Falk Huettmann wrote:

> Hello,
>
> Thanks for everybody who replied on my two questions (Stephen Smith,
> Ann York, John Thaden and others):
>
> 2. Log.regression prediction:
>
> names(kyphosis)
> [1] "Kyphosis" "Age" "Number" "Start"
>
> kyphosis$Kyphosis[1:10]
> [1] absent absent present absent absent
> absent absent absent absent present
>
> To find out what present and absent are:
> as.numeric(kyphosis$Kyphosis[1:10])
> [1] 1 1 2 1 1 1 1 1 1 2
>
> I thought it would be 0 and 1, but compared with above we see
> that presence =2 and absence=1 !!

I think there is a misunderstanding here. When you use a binomial glm
with a factor response, this is interpreted as failure = first level,
success = any other level. As factor levels are normally sorted
alphabetically, in this example presence= success, absence = failure.
(The as.numeric is not very useful with factors.) The fitted values
and the predictions are the probability of success.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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