removeSTcovarMean: Mean-Centre the Spatio-Temporal Covariate

Description Usage Arguments Value Author(s) See Also Examples

Description

Removes the temporal mean at each location for the spatio-temporal covariares. The means are added to the covar field in the returned object and can be used as geographic covariates.

Usage

1

Arguments

STdata

A STdata object, see mesa.data.raw.

Value

Returns a modfied version of the input, where the spatio-temporal covariates have been expanded to include covariates where the site by site temporal average has been removed. The averages are seen as geographic covariates and added to STdata$covars.

Author(s)

Johan Lindstrom

See Also

Other STdata functions: c.STmodel, createDataMatrix, createSTdata, createSTmodel, detrendSTdata, estimateBetaFields, updateTrend.STdata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##load the data
data(mesa.data.raw)
##and create STdata-object
mesa.data <- createSTdata(mesa.data.raw$obs, mesa.data.raw$X, n.basis=2,
                          SpatioTemporal=mesa.data.raw["lax.conc.1500"])

mesa.data.mean0 <- removeSTcovarMean(mesa.data)

##compare the data structures
##geographic covariates
summary(mesa.data$covars)
summary(mesa.data.mean0$covars)

##mean of the spatio-temporal covariate, note that the new
##contains both mean-zero and original
cbind(colMeans(mesa.data$SpatioTemporal),
      colMeans(mesa.data.mean0$SpatioTemporal))

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