##load data
data(mesa.data)
mesa.data.mean0 <- remove.ST.mean(mesa.data)
##compare the data structures
##geographic covariates
summary(mesa.data$LUR)
summary(mesa.data.mean0$LUR)
##mean of the spatio-temporal covariate
cbind(colMeans(mesa.data$SpatioTemp),
colMeans(mesa.data.mean0$SpatioTemp))
##mean of the spatio-temporal covariate
##compared to the added mean covariate
plot(mesa.data.mean0$LUR$mean.lax.conc.1500,
colMeans(mesa.data$SpatioTemp))
if( max(abs(colMeans(mesa.data.mean0$SpatioTemp))) > 1e-10 ){
stop("remove.ST.mean 1: mean(centred ST) != 0")
}
if( max(abs(mesa.data.mean0$LUR$mean.lax.conc.1500 -
colMeans(mesa.data$SpatioTemp))) > 1e-10 ){
stop("remove.ST.mean 2: extracted mean != mean(ST)")
}
Run the code above in your browser using DataLab