2

I have been using lppm (point pattern on a linear network) on spatstat with bunch of covariates and fitting a log-linear model but I couldn't see how to check over-fitting. Is there a quick way to do it?

iHermes
  • 314
  • 3
  • 12

1 Answers1

1

It depends on what you want.

What tool would you use to check overfitting in (say) a linear model?

To identify whether individual observations may have been over-fitted, you could use influence.lppm (from the spatstat.linnet package).

To identify collinearity in the covariates, currently we do not provide a dedicated function in spatstat, but you could use the following trick. If fit is your fitted model of class lppm, first extract the corresponding GLM using

g <- getglmfit(as.ppm(fit))

Next install the package faraway and use the vif function to calculate the variance inflation factors

library(faraway)
vif(g)
Adrian Baddeley
  • 2,534
  • 1
  • 5
  • 8
  • How about instead of individual covariates check, is there code for the goodness of fit for the model? – iHermes Sep 04 '22 at 18:51
  • See Chapter 11 of [the spatstat book](http://book.spatstat.org) for goodness-of-fit tests and model diagnostics. The functions described in the chapter are generic and can be applied to models on a network. – Adrian Baddeley Sep 05 '22 at 02:46
  • is it normal to have a negative McFadden's Pseudo-Rsquared value for lppm? How can I interpret it? according to [McFadden's Pseudo-2 Interpretation](https://stats.stackexchange.com/questions/82105/mcfaddens-pseudo-r2-interpretation) it is good to be around 0.2-0.4 but it does not say anything about being negative. – iHermes Sep 05 '22 at 20:46