[R] log-linear

Thomas W Blackwell tblackw at umich.edu
Mon Apr 7 15:36:26 CEST 2003

The presence/absence nature of the outcome variable strongly supports
using logistic regression and nothing else.  I strongly encourage you
to stick with logistic regression.  The model formula and interaction
term capabilities in R are just the same for logistic regression as for
log-linear models.  (In some textbooks, log-linear models are used as
the motivation and example for introducing the ideas of interaction
terms, but once introduced, the ideas apply very generally.)

I would set up the data as you have, as a data frame or a matrix with
columns representing the number of landslide presence cells, the number
of landslide absence cells, and then one column for each predictor.

Then use  glm() with a call something like:

result <- glm(cbind(present, absent) ~ (a+b+c+d)^3,  family=binomial,
                 data = name.of.data.frame)

In  help("glm"), there's a sentence under "Details" which describes
the cbind() syntax I've used above, and  help("formula")  explains
the (.)^3 syntax.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Mon, 7 Apr 2003, orkun wrote:

> hello
> I have spatial data which contain number of landslide presence cells
> with respect to landslide predictors and number of landslide absence
> cells with respect to same predictors.
> predictors are essentially categorical data.
> I tried logistic regression. But because of providing interaction
> capability of predictors, I want to use log-linear method.
> I hesitate the way I should use landslide count as response variable.
> only landslide presence data should be regarded ? or both landslide
> presence and absent data should be regarded as response variable ?
> I will appreciate if anyone can supply information
> thanks in advance
> Ahmet Temiz
> Gen Dir of Disaster of Affairs

More information about the R-help mailing list