I am trying to understand if my model treat ndvi
like the coordinates
(i.e. does it fit a spline to the relationship between ndvi
and the outcome
) or fit a spline to longitude
and latitude
, and a simple linear term for ndvi
? I don’t know if the p-value indicates that adding the ndvi
term to the model significantly improves the fit, or whether this is a p-value for a simple linear association.
> library(mgcv)
>
> summary.gam(m2)
>
> Family: binomial Link function: logit
>
> Formula: Outcome ~ lo(Xcoord, Ycoord, ndvi, span = 0.95)
>
> Parametric coefficients:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) -2.870e+02 2.213e+02 -1.297 0.1947
> lo(Xcoord, Ycoord, ndvi, span = 0.95)Xcoord 1.496e-05 3.649e-05 0.410 0.6818
> lo(Xcoord, Ycoord, ndvi, span = 0.95)Ycoord 3.559e-05 2.863e-05 1.243 0.2138
> lo(Xcoord, Ycoord, ndvi, span = 0.95)ndvi 1.906e+00 7.801e-01 2.444 0.0145 *
>
> Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> R-sq.(adj) = 0.00111 Deviance explained = 0.26%
> UBRE = -0.3706 Scale est. = 1 n = 5254
>
> anova.gam(m2)
> Family: binomial
> Link function: logit
> Formula:
> Outcome ~ lo(Xcoord, Ycoord, ndvi75, span = 0.95)
> Parametric Terms:
> df Chi.sq p-value
>
> lo(Xcoord, Ycoord, ndvi, span = 0.95) 1 5.971 0.0145
```
lo()
) which isn't advisable aslo()
comes from the gam package. $\endgroup$