Learn R Programming

SpatioTemporal (version 1.1.2)

mesa.data: Example of a STdata Structure

Description

Example of a data structure holding observations, geographic covariates (including observation locations), smooth temporal trends, and spatio-temporal covariates.

Arguments

source

Contains monitoring data from the MESA Air project, see Cohen et.al. (2009) and mesa.data.raw for details.

Details

A STdata object consists of a list with, some or all of, the following elements: [object Object],[object Object],[object Object],[object Object],[object Object]

References

M. A. Cohen, S. D. Adar, R. W. Allen, E. Avol, C. L. Curl, T. Gould, D. Hardie, A. Ho, P. Kinney, T. V. Larson, P. D. Sampson, L. Sheppard, K. D. Stukovsky, S. S. Swan, L. S. Liu, J. D. Kaufman. (2009) Approach to Estimating Participant Pollutant Exposures in the Multi-Ethnic Study of Atherosclerosis and Air Pollution (MESA Air). Environmental Science & Technology: 43(13), 4687-4693.

See Also

createSTmodel for creation of STmodel objects. createSTdata for creation of STdata objects.

Other example data: est.cv.mesa, est.mesa.model, MCMC.mesa.model, mesa.data.raw, mesa.model, pred.mesa.model

Examples

Run this code
##load the data
data(mesa.data)

##Look at the number of observations/locations
print(mesa.data)

##Look at the summary of observations, covariates, etc.
summary(mesa.data)

##Lets look at the data
names(mesa.data)

##Study the structure of the covariates data
head(mesa.data$covars)

##...the smooth temporal trends
head(mesa.data$trend)

##...observations
head(mesa.data$obs)

##...and Spatio-temporal covariate
mesa.data$SpatioTemporal[1:5,1:5,,drop=FALSE]

##Let's plot the space-time monitoring locations
plot(mesa.data, "loc")

##Let's plot the observations as a function of time
plot(mesa.data, "loc.obs", legend.loc="bottomleft")

##plot observations and residuals from the temporal trends
par(mfcol=c(3,2),mar=c(2.5,2.5,2,.5))
plot(mesa.data, "obs", ID=5)
plot(mesa.data, "res", ID=5)
plot(mesa.data, "acf", ID=5)
plot(mesa.data, "obs", ID=18)
plot(mesa.data, "res", ID=18)
plot(mesa.data, "acf", ID=18)

##create STmodel object
##define land-use covariates, for intercept and trends
LUR = list(c("log10.m.to.a1", "s2000.pop.div.10000", "km.to.coast"),
  "km.to.coast", "km.to.coast")
##and covariance model
cov.beta <- list(covf="exp", nugget=FALSE)
cov.nu <- list(covf="exp", nugget=TRUE, random.effect=FALSE)
##which locations to use
locations <- list(coords=c("x","y"), long.lat=c("long","lat"), others="type")
##create object
mesa.model <- createSTmodel(mesa.data, LUR=LUR, cov.beta=cov.beta,
                            cov.nu=cov.nu, locations=locations)

##This should be the same as the data in data(mesa.model)

Run the code above in your browser using DataLab