trend.spatial: Builds the Trend Matrix

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Builds the trend matrix in accordance to a specification of the mean provided by the user.

Usage

1
trend.spatial(trend, geodata, add.to.trend)

Arguments

trend

specifies the mean part of the model. See DETAILS below.

geodata

optional. An object of the class geodata as described in as.geodata.

add.to.trend

optional. Specifies aditional terms to the mean part of the model. See details below.

Details

The implicity model assumes that there is an underlying process with mean mu(x), where x = (x1, x2) denotes the coordinates of a spatial location. The argument trend defines the form of the mean and the following options are allowed:

Denote by x_1 and x_2 the spatial coordinates. The following specifications are equivalent:

Search path for covariates
Typically, functions in the package geoR which calls trend.spatial will have the arguments geodata, coords and data.

When the trend is specifed as trend = ~ model the terms included in the model will be searched for in the following path sequence (modified in version 1.7-6, no longer attach objects):

  1. in the object geodata (coerced to data-frame)

  2. in the users/session Global environment

  3. in the session search path

The argument add.to.trend adds terms to what is specified in the argument trend. This seems redundant but allow specifications of the type: trend="2nd", add.trend=~other.covariates.

Value

An object of the class trend.spatial which is an n x p trend matrix, where n is the number of spatial locations and p is the number of mean parameters in the model.

Note

This is an auxiliary function typically called by other geoR functions.

Author(s)

Paulo J. Ribeiro Jr. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.

References

Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR.

See Also

The section DETAILS in the documentation for likfit for more about the underlying model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# a first order polynomial trend
trend.spatial("1st", sic.100)[1:5,]
# a second order polynomial trend
trend.spatial("2nd", sic.100)[1:5,]
# a trend with a covariate
trend.spatial(~altitude, sic.100)[1:5,]
# a first degree trend plus a covariate
trend.spatial(~coords+altitude, sic.100)[1:5,]
# with produces the same as
trend.spatial("1st", sic.100, add=~altitude)[1:5,]
# and yet another exemple
trend.spatial("2nd", sic.100, add=~altitude)[1:5,]

Example output

--------------------------------------------------------------
 Analysis of Geostatistical Data
 For an Introduction to geoR go to http://www.leg.ufpr.br/geoR
 geoR version 1.7-5.2.1 (built on 2016-05-02) is now loaded
--------------------------------------------------------------

Warning message:
no DISPLAY variable so Tk is not available 
     [,1]     [,2]      [,3]
[1,]    1 29.52739  80.71854
[2,]    1 33.77939  99.52954
[3,]    1 46.80639 102.58454
[4,]    1 48.71439 121.45354
[5,]    1 49.31639 113.65554
     [,1]     [,2]      [,3]      [,4]      [,5]     [,6]
[1,]    1 29.52739  80.71854  871.8668  6515.483 2383.408
[2,]    1 33.77939  99.52954 1141.0473  9906.130 3362.047
[3,]    1 46.80639 102.58454 2190.8382 10523.588 4801.612
[4,]    1 48.71439 121.45354 2373.0919 14750.963 5916.535
[5,]    1 49.31639 113.65554 2432.1064 12917.582 5605.081
     [,1] [,2]
[1,]    1  682
[2,]    1  813
[3,]    1  436
[4,]    1  833
[5,]    1  579
     [,1]     [,2]      [,3] [,4]
[1,]    1 29.52739  80.71854  682
[2,]    1 33.77939  99.52954  813
[3,]    1 46.80639 102.58454  436
[4,]    1 48.71439 121.45354  833
[5,]    1 49.31639 113.65554  579
     [,1]     [,2]      [,3] [,4]
[1,]    1 29.52739  80.71854  682
[2,]    1 33.77939  99.52954  813
[3,]    1 46.80639 102.58454  436
[4,]    1 48.71439 121.45354  833
[5,]    1 49.31639 113.65554  579
     [,1]     [,2]      [,3]      [,4]      [,5]     [,6] [,7]
[1,]    1 29.52739  80.71854  871.8668  6515.483 2383.408  682
[2,]    1 33.77939  99.52954 1141.0473  9906.130 3362.047  813
[3,]    1 46.80639 102.58454 2190.8382 10523.588 4801.612  436
[4,]    1 48.71439 121.45354 2373.0919 14750.963 5916.535  833
[5,]    1 49.31639 113.65554 2432.1064 12917.582 5605.081  579

geoR documentation built on Feb. 11, 2020, 1:11 a.m.

Related to trend.spatial in geoR...