Skip to contents

vhat_j = D Z_j' (Z_j D Z_j' + s2e I)^{-1} (y_j - X_j beta).

Usage

Blupslope(y, group, Z, D, s2e, X = NULL, beta = NULL)

Arguments

y

Response.

group

Group label per observation.

Z

Random-effect design, n x q.

D

Covariance of the random coefficients, q x q.

s2e

Residual variance, strictly positive.

X

Fixed-effect design, or NULL.

beta

Fixed-effect coefficients, required when X is given.

Value

List with v, levels, nj, fitted, J, q, n.

References

Henderson (1975), Biometrics 31(2), 423-447; Robinson (1991), Statistical Science 6(1), 15-32. Standard published form; neither article is in the local corpus and neither was read.

Examples

set.seed(1)
Blupslope(y = rnorm(30), group = rep(1:5, each = 6), Z = cbind(1, rnorm(30)),
          D = diag(2), s2e = 1)
#> $v
#> $v[[1]]
#> [1] -0.03283962 -0.27562816
#> 
#> $v[[2]]
#> [1]  0.5178355 -0.2289751
#> 
#> $v[[3]]
#> [1] -0.05200107 -0.46874722
#> 
#> $v[[4]]
#> [1] 0.1953010 0.7097498
#> 
#> $v[[5]]
#> [1] -0.2704539  0.3160452
#> 
#> 
#> $levels
#> [1] "1" "2" "3" "4" "5"
#> 
#> $nj
#> [1] 6 6 6 6 6
#> 
#> $fitted
#>  [1] -0.407329966 -0.004508423 -0.139692830 -0.018009431  0.346716782
#>  [6]  0.081544574  0.608118105  0.531416808  0.265957075  0.343087258
#> [11]  0.555507326  0.575849037 -0.378700713 -0.312935396  0.270851244
#> [16]  0.279635315 -0.222897851 -0.412248740  0.115563269  0.820666992
#> [21]  0.477856534 -0.239084635  0.437410598 -0.606264250  0.182446401
#> [26]  0.355442018 -0.386512438 -0.600447587 -0.090396704 -0.313137213
#> 
#> $J
#> [1] 5
#> 
#> $q
#> [1] 2
#> 
#> $n
#> [1] 30
#> 
#> $method
#> [1] "BLUP of random coefficients (Henderson 1975; Robinson 1991)"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"