Skip to content
Prev 8166 / 29559 Next

point process panel regression?

Ted Rosenbaum <ted.rosenbaum at yale.edu> wrote:

            
In a forthcoming version of spatstat it will be possible to do this seamlessly. (The code already exists but is not yet released.)

For now, the simplest way to do this is to attach a mark to each point representing the year. Make sure that the mark is a factor. Then for each covariate, construct a function with arguments (x,y,year) that extracts the value of the covariate at location (x,y) in the given year. These functions should be in the global environment. Then fit a model using these covariate functions.

Example:
          # make some point data
          X2001 <- runifpoint(42)
          X2002 <- runifpoint(30)
          # make some covariate images
          pH2001 <- density(runifpoint(17))
          pH2002 <- density(runifpoint(20))
          # tweak
          X <- superimpose("2001"=X2001, "2002"=X2002)          
          pH <- function(x,y,year) { 
                 ifelse(year == "2001", pH2001[cbind(x,y)], pH2002[cbind(x,y)] )
          }
          # go
          ppm(X, ~marks + pH(x,y,marks))

In the model formula, the first term 'marks' gives you the fixed effect for each year. A typical result is:

..................................
Nonstationary multitype Poisson process
Possible marks: 
2001 2002

Trend formula: ~marks + pH(x, y, marks)

Fitted coefficients for trend formula:
    (Intercept)       marks2002 pH(x, y, marks) 
    3.852512251    -0.308405720    -0.006997323 

..................................

So the fixed effect estimates are 3.85 for 2001, and 3.85-0.31 = 3.54 for 2002, while the (year-independent) coefficient of the pH covariate is -0.007.

You can also do things like

         ppm(X, ~marks + polynom(pH(x,y,marks), 3))

to get a cubic function of the pH covariate.

Adrian Baddeley

--------------------------------

Prof Adrian Baddeley (UWA/CSIRO)
CSIRO Mathematics, Informatics & Statistics
Leeuwin Centre, 65 Brockway Road, Floreat WA 6014, Australia
Tel: 08 9333 6177 | Fax: 08 9333 6121 | Mob: 0410 447 821