mesa.data.raw: Data used in the examples

Description Format Source References See Also Examples

Description

The raw data that was used to create the mesa.model structures.
The data structure contains raw data from the MESA Air project. The example below describes how to create the mesa.model structure from raw data.

Format

The structure contains observations, temporal trends, locations, geographic covariates, and spatio-temporal covariates. The data is stored as a list with elements:

X

A data.frame containing names, locations, and (geographic) covariates for all the (observation) locations.

obs

A time-by-location matrix for the observed data, missing data marked as NA

lax.conc.1500

A time-by-location matrix of a spatio-temporal covariate based on output from Caline3QHC.

Source

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

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

createSTdata for creation of STdata objects.

Other data matrix: SVDmiss, SVDsmooth, createDataMatrix, estimateBetaFields

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
##load the data
data(mesa.data.raw)

##extract matrix of observations (missing marked by NA)
obs.mat <- mesa.data.raw$obs
head(obs.mat)

##optionally observations can be given as a data.frame
obs <- data.frame(obs=c(obs.mat),
                  date=rep(rownames(obs.mat), dim(obs.mat)[2]),
                  ID=rep(colnames(obs.mat), each=dim(obs.mat)[1]))
##force date-format
obs$date <- as.Date(obs$date)

##drop unobserved
obs <- obs[!is.na(obs$obs),,drop=FALSE]

##create a 3D-array for the spatio-temporal covariate
ST <- array(mesa.data.raw$lax.conc.1500, dim =
            c(dim(mesa.data.raw$lax.conc.1500),1))
dimnames(ST) <- list(rownames(mesa.data.raw$lax.conc),
                     colnames(mesa.data.raw$lax.conc),
                     "lax.conc.1500")
##or use a list of matrices
ST.list <- list(lax.conc.1500=mesa.data.raw$lax.conc.1500)

###########################
## create STdata object ##
###########################
##Create the data-object
mesa.data <- createSTdata(obs.mat, mesa.data.raw$X, n.basis=2,
                          SpatioTemporal=ST)
mesa.data.2 <- createSTdata(obs, mesa.data.raw$X, n.basis=2,
                            SpatioTemporal=ST.list)

##This should yield equal structures,
##which are also the same as data(mesa.data)
all.equal(mesa.data, mesa.data.2)

###########################
## create STmodel object ##
###########################
##define land-use covariates, for intercept and trends
LUR <- list(~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=~type, 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, ST="lax.conc.1500",
                            cov.beta=cov.beta, cov.nu=cov.nu,
                            locations=locations)

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

Example output

Loading required package: Matrix
           60370002 60370016 60370030 60370031 60370113 60371002 60371103
1999-01-13 4.577684 4.131632       NA       NA 4.727882 5.352608 5.281452
1999-01-27 3.889091 3.543566       NA       NA 4.139332 4.876832 4.846044
1999-02-10 4.013020 3.632424       NA       NA 4.054051 4.717611 4.665429
1999-02-24 4.080691 3.842586       NA       NA 4.392799 4.877139 4.830275
1999-03-10 3.728085 3.396944       NA       NA 3.960577 4.252480 4.163820
1999-03-24 3.751913 3.626161       NA       NA 3.958741 4.180627 4.240120
           60371201 60371301 60371601 60371602 60371701 60372005 60374002
1999-01-13 4.984585 5.463134 5.316398       NA 5.081886 4.900640 4.995868
1999-01-27 4.100073 5.213077 5.010987       NA 4.674858 4.381561 4.785056
1999-02-10 4.056365 5.037477 4.770632       NA 4.715861 4.247208 4.493267
1999-02-24 4.382803 5.127157 4.960104       NA 4.905827 4.450186 4.440054
1999-03-10 3.808937 4.656825 4.205851       NA 4.403685 3.792204 4.035339
1999-03-24 3.794791 4.583794 4.383694       NA 4.472207 3.836844 3.995005
           60375001 60375005 60590001 60590007 60591003 60595001 L001 L002
1999-01-13 5.165070       NA 4.847385       NA 4.603461 4.834629   NA   NA
1999-01-27 4.784252       NA 4.517424       NA 4.414679 4.576023   NA   NA
1999-02-10 4.685089       NA 4.217816       NA 4.104592 4.337169   NA   NA
1999-02-24 4.676942       NA 4.565771       NA 4.288501 4.573462   NA   NA
1999-03-10 4.030772       NA 3.816688       NA 3.374445 3.936019   NA   NA
1999-03-24 4.200838       NA 3.795629       NA 3.412111 3.914319   NA   NA
           LC001 LC002 LC003
1999-01-13    NA    NA    NA
1999-01-27    NA    NA    NA
1999-02-10    NA    NA    NA
1999-02-24    NA    NA    NA
1999-03-10    NA    NA    NA
1999-03-24    NA    NA    NA
[1] TRUE

SpatioTemporal documentation built on May 2, 2019, 8:49 a.m.