if groups is missing, it returns the Dim attribute of object; otherwise, calculates the dimensions associated with the grouping factor.

# S3 method for class 'corSpatial'
Dim(object, groups, ...)

Arguments

object

an object inheriting from class "corSpatial", representing a spatial correlation structure.

groups

an optional factor defining the grouping of the observations; observations within a group are correlated and observations in different groups are uncorrelated.

...

further arguments to be passed to or from methods.

Value

a list with components:

N

length of groups

M

number of groups

spClass

an integer representing the spatial correlation class; 0 = user defined class, 1 = corSpher, 2 = corExp, 3 = corGaus, 4 = corLin

sumLenSq

sum of the squares of the number of observations per group

len

an integer vector with the number of observations per group

start

an integer vector with the starting position for the distance vectors in each group, beginning from zero

Author

José Pinheiro and Douglas Bates bates@stat.wisc.edu

See also

Examples

Dim(corGaus(), getGroups(Orthodont))
#> $N
#> [1] 108
#> 
#> $M
#> [1] 27
#> 
#> $spClass
#> [1] 3
#> 
#> $sumLenSq
#> [1] 432
#> 
#> $len
#> groups
#> M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 M13 M14 M15 M16 F01 F02 F03 F04 
#>   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4 
#> F05 F06 F07 F08 F09 F10 F11 
#>   4   4   4   4   4   4   4 
#> 
#> $start
#>     M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 M13 M14 M15 M16 F01 F02 F03 
#>   0   6  12  18  24  30  36  42  48  54  60  66  72  78  84  90  96 102 108 114 
#> F04 F05 F06 F07 F08 F09 F10 
#> 120 126 132 138 144 150 156 
#> 

cs1ARMA <- corARMA(0.4, form = ~ 1 | Subject, q = 1)
cs1ARMA <- Initialize(cs1ARMA, data = Orthodont)
Dim(cs1ARMA)
#> $N
#> [1] 108
#> 
#> $M
#> [1] 27
#> 
#> $maxLen
#> [1] 4
#> 
#> $sumLenSq
#> [1] 432
#> 
#> $len
#> groups
#> M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 M13 M14 M15 M16 F01 F02 F03 F04 
#>   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4   4 
#> F05 F06 F07 F08 F09 F10 F11 
#>   4   4   4   4   4   4   4 
#> 
#> $start
#>  [1]   0   4   8  12  16  20  24  28  32  36  40  44  48  52  56  60  64  68  72
#> [20]  76  80  84  88  92  96 100 104
#>