> From: Winfred Lambert <winnie@ccb.ensco.com>
> Date: Thu, 28 Sep 2000 11:16:56 -0400
>
>
> All,
>
> I have a binary predictand and 27 predictors that are mostly binary (4
> are continuous). I tried to put them in lm() but I get an error:
>
> Error in lm.fit.qr(x, y): computed fit is singular, rank 26
>
> I tried it again and got a different rank number. Before I go nuts and
> look in every S book I have, can someone tell me if my approach is
Depending which books you have, I might suggest that you look in
them before going nuts?
> flawed and, if so, what direction I should go? I tested lm() with my
> continous data and it worked fine with 2 predictors and a continous
> predictand. My goal is to forecast probabilities of an event happening.
Probabilities by lm? Should you not be using a logistic regression
to predict probabilities, which are usually regarded as being bounded by
0 and 1?
You can probably just use lm(..., singular.ok=T). The message means
that the variables are collinear. My bet is that two of your binary
variables are true on exactly the same set of cases, or one binary
variable is always or never true. If you use lm(..., singular.ok=T)
the fit will have an NA coefficient, and that will tell you which
column is linearly dependent on those before it.
--
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
|