at.level: Incidence Matrix of Levels within a Factor

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mterms.R

Description

Incidence matrix of levels within a factor

Usage

1
at.level(x, level)

Arguments

x

factor

level

factor level

Value

incidence matrix for level in x

Author(s)

Jarrod Hadfield [email protected]

See Also

at.set

Examples

1
2
3
fac<-gl(3,10,30, labels=letters[1:3])
x<-rnorm(30)
model.matrix(~at.level(fac,"b"):x)

Example output

Loading required package: Matrix
Loading required package: coda
Loading required package: ape
   (Intercept) at.level(fac, "b"):x
1            1           0.00000000
2            1           0.00000000
3            1           0.00000000
4            1           0.00000000
5            1           0.00000000
6            1           0.00000000
7            1           0.00000000
8            1           0.00000000
9            1           0.00000000
10           1           0.00000000
11           1          -0.75370546
12           1           0.01158195
13           1          -0.44526741
14           1           0.34458436
15           1           0.91700865
16           1           0.96916466
17           1           2.07210210
18           1           0.84217885
19           1           1.80546296
20           1          -1.30607923
21           1           0.00000000
22           1           0.00000000
23           1           0.00000000
24           1           0.00000000
25           1           0.00000000
26           1           0.00000000
27           1           0.00000000
28           1           0.00000000
29           1           0.00000000
30           1           0.00000000
attr(,"assign")
[1] 0 1

MCMCglmm documentation built on Oct. 5, 2017, 5:04 p.m.