Skip to contents

Centering of rows (constructs) and/or columns (elements).

Usage

center(x, center = 1, ...)

Arguments

x

repgrid object.

center

Numeric. The type of centering to be performed. 0= no centering, 1= row mean centering (construct), 2= column mean centering (elements), 3= double-centering (construct and element means), 4= midpoint centering of rows (constructs). of the scale(default FALSE). Default is 1 (row centering).

...

Not evaluated.

Value

matrix containing the transformed values.

Note

If scale midpoint centering is applied no row or column centering can be applied simultaneously. TODO: After centering the standard representation mode does not work any more as it remains unclear what color values to attach to the centered values.

Examples

center(bell2010) # no centering
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,] -0.3 -0.3  1.7  0.7 -1.3  1.7  0.7 -2.3 -2.3   1.7
#>  [2,]  0.1  1.1  0.1 -0.9  1.1 -1.9  0.1  1.1 -1.9   1.1
#>  [3,]  1.6 -1.4  2.6  1.6 -0.4 -0.4 -2.4 -1.4  1.6  -1.4
#>  [4,]  0.1  1.1 -0.9  0.1  0.1 -0.9  0.1  1.1  1.1  -1.9
#>  [5,]  0.8 -1.2 -0.2  1.8 -2.2  1.8  0.8 -0.2  0.8  -2.2
#>  [6,] -0.3  1.7  0.7 -0.3 -0.3  1.7  0.7 -1.3 -0.3  -2.3
#>  [7,]  0.2 -0.8 -0.8  1.2  0.2 -1.8  0.2  1.2  0.2   0.2
#>  [8,] -0.4  0.6  0.6 -1.4 -0.4  1.6  1.6 -2.4 -0.4   0.6
#>  [9,] -0.4 -0.4  0.6  1.6 -1.4 -1.4  0.6  1.6 -0.4  -0.4
center(bell2010, rows = T) # row centering of grid
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,] -0.3 -0.3  1.7  0.7 -1.3  1.7  0.7 -2.3 -2.3   1.7
#>  [2,]  0.1  1.1  0.1 -0.9  1.1 -1.9  0.1  1.1 -1.9   1.1
#>  [3,]  1.6 -1.4  2.6  1.6 -0.4 -0.4 -2.4 -1.4  1.6  -1.4
#>  [4,]  0.1  1.1 -0.9  0.1  0.1 -0.9  0.1  1.1  1.1  -1.9
#>  [5,]  0.8 -1.2 -0.2  1.8 -2.2  1.8  0.8 -0.2  0.8  -2.2
#>  [6,] -0.3  1.7  0.7 -0.3 -0.3  1.7  0.7 -1.3 -0.3  -2.3
#>  [7,]  0.2 -0.8 -0.8  1.2  0.2 -1.8  0.2  1.2  0.2   0.2
#>  [8,] -0.4  0.6  0.6 -1.4 -0.4  1.6  1.6 -2.4 -0.4   0.6
#>  [9,] -0.4 -0.4  0.6  1.6 -1.4 -1.4  0.6  1.6 -0.4  -0.4
center(bell2010, cols = T) # column centering of grid
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,] -0.3 -0.3  1.7  0.7 -1.3  1.7  0.7 -2.3 -2.3   1.7
#>  [2,]  0.1  1.1  0.1 -0.9  1.1 -1.9  0.1  1.1 -1.9   1.1
#>  [3,]  1.6 -1.4  2.6  1.6 -0.4 -0.4 -2.4 -1.4  1.6  -1.4
#>  [4,]  0.1  1.1 -0.9  0.1  0.1 -0.9  0.1  1.1  1.1  -1.9
#>  [5,]  0.8 -1.2 -0.2  1.8 -2.2  1.8  0.8 -0.2  0.8  -2.2
#>  [6,] -0.3  1.7  0.7 -0.3 -0.3  1.7  0.7 -1.3 -0.3  -2.3
#>  [7,]  0.2 -0.8 -0.8  1.2  0.2 -1.8  0.2  1.2  0.2   0.2
#>  [8,] -0.4  0.6  0.6 -1.4 -0.4  1.6  1.6 -2.4 -0.4   0.6
#>  [9,] -0.4 -0.4  0.6  1.6 -1.4 -1.4  0.6  1.6 -0.4  -0.4
center(bell2010, rows = T, cols = T) # row and column centering
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,] -0.3 -0.3  1.7  0.7 -1.3  1.7  0.7 -2.3 -2.3   1.7
#>  [2,]  0.1  1.1  0.1 -0.9  1.1 -1.9  0.1  1.1 -1.9   1.1
#>  [3,]  1.6 -1.4  2.6  1.6 -0.4 -0.4 -2.4 -1.4  1.6  -1.4
#>  [4,]  0.1  1.1 -0.9  0.1  0.1 -0.9  0.1  1.1  1.1  -1.9
#>  [5,]  0.8 -1.2 -0.2  1.8 -2.2  1.8  0.8 -0.2  0.8  -2.2
#>  [6,] -0.3  1.7  0.7 -0.3 -0.3  1.7  0.7 -1.3 -0.3  -2.3
#>  [7,]  0.2 -0.8 -0.8  1.2  0.2 -1.8  0.2  1.2  0.2   0.2
#>  [8,] -0.4  0.6  0.6 -1.4 -0.4  1.6  1.6 -2.4 -0.4   0.6
#>  [9,] -0.4 -0.4  0.6  1.6 -1.4 -1.4  0.6  1.6 -0.4  -0.4