Skip to content
Prev 24219 / 29559 Next

[FORGED] different models

On 06/04/16 22:00, Virginia Morera Pujol wrote:
(1) There is essentially no difference between fits 2 & 3.  The fit 2 
syntax is provided so that the user can have the relevant covariates 
bundled up in a list without any need to extract these covariates from 
that list.   With the fit 2 syntax you don't need to have all covariates 
present in your workspace.

E.g.: fit <- ppm(bei ~ elev + grad, data=bei.extra)

(2) The fit 2 syntax is essentially the same as that used by lm() and 
glm() and was designed in imitation thereof.

(3) The preferred structure of a call to ppm() is

     fit2 <- ppm(ppp ~ x + y + Z, data=list(Z=covariate))

Note:  "data" rather than "covariates"; no comma between the name of the 
response variable ("ppp") and the formula.

This makes the syntax identical to that of lm() and glm().

The syntax that you used is a remnant of earlier versions of spatstat 
and remains acceptable for reasons of backward compatibility.

(4) The difference between model 1 and models 2 and 3 is that models 2 
and 3 involve the Cartesian coordinates "x" and "y".  Model 1 is such 
that the model intensity takes the form

    exp(beta_0 + beta_1 * covariate)

In models 2 and 3 the model intensity takes the (more complex) form

    exp(beta_0 + beta_1 * x + beta_2 *y beta_3 * covariate)

Note that "x" and "y" are *reserved* names.  You cannot use these names 
for any covariates *other than* the Cartesian coordinates.

(5) The name "covariate" is probably *not* a good name for a covariate.
As fortune(77) puts it "Would you call your dog 'dog'?"

(6) Likewise (and even more so) "ppp" is *not* a good name for a point 
pattern, since it clashes the name of the creator function ppp().

cheers,

Rolf Turner