modgam(rdata, rgrid, permute = 0, m = "adjusted", sp = NULL, keep = F, verbose = T, ...)
gam
function (e.g., weights).modgam
uses a conditional permutation test which produces inflated type I error rates; Young et al. (2012) recommend using alpha=0.025 to limit the type I error rate to approximately 5%.Kelsall J, Diggle P. Spatial variation in risk of disease: a nonparametric binary regression approach. J Roy Stat Soc C-App 1998, 47:559-573.
Vieira V, Webster T, Weinberg J, Aschengrau A, Ozonoff D.
Webster T, Vieira V, Weinberg J, Aschengrau A.
Young RL, Weinberg J, Vieira V, Ozonoff A, Webster TF.
predgrid
,
optspan
,
colormap
,
readShapePoly
.# Load base map in SpatialPolygonsDataFrame format
# This map was read from ESRI shapefiles using the readShapePoly function
data(MAmap)
# Load data and create grid on base map
data(MAdata)
gamgrid <- predgrid(MAdata, MAmap) # requires PBSmapping package
# Fit crude GAM model to the MA data using span size of 50%
# and predict odds ratios for every point on gamgrid
fit1 <- modgam(MAdata, gamgrid, m="crude", sp=0.5)
# Get summary statistics for pointwise crude odds ratios
summary(fit1$OR)
# fit adjusted GAM model to the MA data using span size of 50%, and run a (too small) permutation test
fit2 <- modgam(MAdata, gamgrid, permute=25, m="adjusted", sp=0.5)
Run the code above in your browser using DataLab