small.test.dat: A small dataset for fast testing of functions

Description Usage Format Examples

Description

Simulated data for fast testing of the functions. A list contains integer responses, model matrix, distance matrix, and offset term.

Usage

1

Format

y

Integer vector, the response variable, which is count data.

X

Numeric matrix, the model matrix contains covariate information.

offset

Numeric vector, vector for offset values.

dist

Numeric matrix, a matrix for pairwise distance.

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
data("small.test")

#Here is a toy example for creating a data object that can be used for
#generating dat.obj for SpatialVS function
n=20
#simulate counts data
y=rpois(n=n, lambda=1)
#simulate covariate matrix
x1=rnorm(n)
x2=rnorm(n)
X=cbind(1, x1, x2)
#compute distance matrix from some simulated locations
loc_x=runif(n)
loc_y=runif(n)
dist=matrix(0,n, n)
for(i in 1:n)
{
  for(j in 1:n)
  {
    dist[i,j]=sqrt((loc_x[i]-loc_x[j])^2+(loc_y[i]-loc_y[j])^2)
  }
}

#assume offset is all zero
offset=rep(0, n)

#assemble the data object for SpatialVS

dat.obj=list(y=y, X=X, dist=dist, offset=offset)

SpatialVS documentation built on May 2, 2019, 2:14 p.m.