Ipsatize circumplex items using deviation scoring across variables
Source:R/tidying_functions.R
ipsatize.Rd
Rescore each circumplex item using deviation scoring across variables. In other words, subtract each observation's mean response from each response. This effectively removes the presence of a general factor, which can make certain circumplex fit analyses more powerful.
Arguments
- data
Required. A data frame or matrix containing at least circumplex scales.
- items
Required. A character vector containing the column names, or a numeric vector containing column indexes, of item variables in
data
to be ipsatized.- na.rm
Optional. A logical that determines whether missing values should be ignored during the calculation of the mean during ipsatization (default = TRUE).
- prefix
Optional. A string that will be added to the start of each
items
name in the output (default = "").- suffix
Optional. A string that will be added to the end of each
items
name in the output (default = "_i").- append
Optional. A logical that determines whether to append the ipsatized scores to
data
in the output or just return the ipsatized scores alone (default = TRUE).
Value
A data frame that matches data
except that the variables specified
in items
have been rescored using ipsatization.
See also
Other tidying functions:
norm_standardize()
,
score()
Examples
data("raw_iipsc")
ipsatize(raw_iipsc, items = 1:32)
#> IIP01 IIP02 IIP03 IIP04 IIP05 IIP06 IIP07 IIP08 IIP09 IIP10 IIP11 IIP12
#> 1 0 0 0 0 1 0 1 0 2 1 0 0
#> 2 1 1 0 0 3 2 2 1 0 1 0 1
#> 3 1 0 1 0 1 1 1 3 0 1 0 0
#> 4 3 2 3 NA 2 3 2 3 2 3 2 4
#> 5 0 0 0 1 0 0 1 1 0 1 0 2
#> 6 0 0 0 0 0 0 1 1 0 0 0 0
#> 7 1 0 0 0 2 1 1 0 1 0 0 0
#> 8 1 0 1 0 1 1 2 1 1 0 0 0
#> 9 0 0 2 2 0 1 3 0 1 0 1 1
#> 10 0 0 0 0 0 0 2 0 0 0 0 0
#> IIP13 IIP14 IIP15 IIP16 IIP17 IIP18 IIP19 IIP20 IIP21 IIP22 IIP23 IIP24
#> 1 0 1 4 3 2 4 2 0 1 0 0 0
#> 2 4 3 3 1 0 0 1 0 1 2 0 0
#> 3 2 3 3 2 2 1 1 0 3 2 3 1
#> 4 2 1 2 3 1 2 2 1 3 2 3 2
#> 5 1 1 3 1 0 1 0 1 1 0 1 1
#> 6 0 0 2 1 1 0 0 0 0 0 1 1
#> 7 1 1 1 0 1 0 0 0 0 1 1 1
#> 8 1 NA 2 1 1 0 1 0 0 0 1 1
#> 9 0 2 2 2 1 2 2 0 0 0 3 0
#> 10 0 2 2 1 0 0 0 0 0 0 0 0
#> IIP25 IIP26 IIP27 IIP28 IIP29 IIP30 IIP31 IIP32 IIP01_i IIP02_i
#> 1 3 3 3 0 0 0 1 0 -1.0000000 -1.0000000
#> 2 0 0 0 1 0 0 0 2 0.0625000 0.0625000
#> 3 1 1 1 0 3 2 3 2 -0.4062500 -1.4062500
#> 4 1 2 3 2 3 2 3 2 0.7096774 -0.2903226
#> 5 2 1 0 0 0 0 0 0 -0.6250000 -0.6250000
#> 6 0 0 0 0 0 0 0 1 -0.2812500 -0.2812500
#> 7 1 0 0 0 1 1 0 0 0.5000000 -0.5000000
#> 8 1 1 1 0 0 1 2 1 0.2580645 -0.7419355
#> 9 1 0 1 0 0 1 3 0 -0.9687500 -0.9687500
#> 10 0 0 0 0 0 0 0 0 -0.2187500 -0.2187500
#> IIP03_i IIP04_i IIP05_i IIP06_i IIP07_i IIP08_i IIP09_i
#> 1 -1.0000000 -1.0000000 0.0000000 -1.0000000 0.0000000 -1.0000000 1.0000000
#> 2 -0.9375000 -0.9375000 2.0625000 1.0625000 1.0625000 0.0625000 -0.9375000
#> 3 -0.4062500 -1.4062500 -0.4062500 -0.4062500 -0.4062500 1.5937500 -1.4062500
#> 4 0.7096774 NA -0.2903226 0.7096774 -0.2903226 0.7096774 -0.2903226
#> 5 -0.6250000 0.3750000 -0.6250000 -0.6250000 0.3750000 0.3750000 -0.6250000
#> 6 -0.2812500 -0.2812500 -0.2812500 -0.2812500 0.7187500 0.7187500 -0.2812500
#> 7 -0.5000000 -0.5000000 1.5000000 0.5000000 0.5000000 -0.5000000 0.5000000
#> 8 0.2580645 -0.7419355 0.2580645 0.2580645 1.2580645 0.2580645 0.2580645
#> 9 1.0312500 1.0312500 -0.9687500 0.0312500 2.0312500 -0.9687500 0.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 1.7812500 -0.2187500 -0.2187500
#> IIP10_i IIP11_i IIP12_i IIP13_i IIP14_i IIP15_i IIP16_i
#> 1 0.0000000 -1.0000000 -1.0000000 -1.0000000 0.000000 3.0000000 2.0000000
#> 2 0.0625000 -0.9375000 0.0625000 3.0625000 2.062500 2.0625000 0.0625000
#> 3 -0.4062500 -1.4062500 -1.4062500 0.5937500 1.593750 1.5937500 0.5937500
#> 4 0.7096774 -0.2903226 1.7096774 -0.2903226 -1.290323 -0.2903226 0.7096774
#> 5 0.3750000 -0.6250000 1.3750000 0.3750000 0.375000 2.3750000 0.3750000
#> 6 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.281250 1.7187500 0.7187500
#> 7 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.500000 0.5000000 -0.5000000
#> 8 -0.7419355 -0.7419355 -0.7419355 0.2580645 NA 1.2580645 0.2580645
#> 9 -0.9687500 0.0312500 0.0312500 -0.9687500 1.031250 1.0312500 1.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 1.781250 1.7812500 0.7812500
#> IIP17_i IIP18_i IIP19_i IIP20_i IIP21_i IIP22_i IIP23_i
#> 1 1.0000000 3.0000000 1.0000000 -1.0000000 0.0000000 -1.0000000 -1.0000000
#> 2 -0.9375000 -0.9375000 0.0625000 -0.9375000 0.0625000 1.0625000 -0.9375000
#> 3 0.5937500 -0.4062500 -0.4062500 -1.4062500 1.5937500 0.5937500 1.5937500
#> 4 -1.2903226 -0.2903226 -0.2903226 -1.2903226 0.7096774 -0.2903226 0.7096774
#> 5 -0.6250000 0.3750000 -0.6250000 0.3750000 0.3750000 -0.6250000 0.3750000
#> 6 0.7187500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 0.7187500
#> 7 0.5000000 -0.5000000 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.5000000
#> 8 0.2580645 -0.7419355 0.2580645 -0.7419355 -0.7419355 -0.7419355 0.2580645
#> 9 0.0312500 1.0312500 1.0312500 -0.9687500 -0.9687500 -0.9687500 2.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500
#> IIP24_i IIP25_i IIP26_i IIP27_i IIP28_i IIP29_i IIP30_i
#> 1 -1.0000000 2.0000000 2.0000000 2.0000000 -1.0000000 -1.0000000 -1.0000000
#> 2 -0.9375000 -0.9375000 -0.9375000 -0.9375000 0.0625000 -0.9375000 -0.9375000
#> 3 -0.4062500 -0.4062500 -0.4062500 -0.4062500 -1.4062500 1.5937500 0.5937500
#> 4 -0.2903226 -1.2903226 -0.2903226 0.7096774 -0.2903226 0.7096774 -0.2903226
#> 5 0.3750000 1.3750000 0.3750000 -0.6250000 -0.6250000 -0.6250000 -0.6250000
#> 6 0.7187500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500
#> 7 0.5000000 0.5000000 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.5000000
#> 8 0.2580645 0.2580645 0.2580645 0.2580645 -0.7419355 -0.7419355 0.2580645
#> 9 -0.9687500 0.0312500 -0.9687500 0.0312500 -0.9687500 -0.9687500 0.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500
#> IIP31_i IIP32_i
#> 1 0.0000000 -1.0000000
#> 2 -0.9375000 1.0625000
#> 3 1.5937500 0.5937500
#> 4 0.7096774 -0.2903226
#> 5 -0.6250000 -0.6250000
#> 6 -0.2812500 0.7187500
#> 7 -0.5000000 -0.5000000
#> 8 1.2580645 0.2580645
#> 9 2.0312500 -0.9687500
#> 10 -0.2187500 -0.2187500
ipsatize(raw_iipsc, items = sprintf("IIP%02d", 1:32))
#> IIP01 IIP02 IIP03 IIP04 IIP05 IIP06 IIP07 IIP08 IIP09 IIP10 IIP11 IIP12
#> 1 0 0 0 0 1 0 1 0 2 1 0 0
#> 2 1 1 0 0 3 2 2 1 0 1 0 1
#> 3 1 0 1 0 1 1 1 3 0 1 0 0
#> 4 3 2 3 NA 2 3 2 3 2 3 2 4
#> 5 0 0 0 1 0 0 1 1 0 1 0 2
#> 6 0 0 0 0 0 0 1 1 0 0 0 0
#> 7 1 0 0 0 2 1 1 0 1 0 0 0
#> 8 1 0 1 0 1 1 2 1 1 0 0 0
#> 9 0 0 2 2 0 1 3 0 1 0 1 1
#> 10 0 0 0 0 0 0 2 0 0 0 0 0
#> IIP13 IIP14 IIP15 IIP16 IIP17 IIP18 IIP19 IIP20 IIP21 IIP22 IIP23 IIP24
#> 1 0 1 4 3 2 4 2 0 1 0 0 0
#> 2 4 3 3 1 0 0 1 0 1 2 0 0
#> 3 2 3 3 2 2 1 1 0 3 2 3 1
#> 4 2 1 2 3 1 2 2 1 3 2 3 2
#> 5 1 1 3 1 0 1 0 1 1 0 1 1
#> 6 0 0 2 1 1 0 0 0 0 0 1 1
#> 7 1 1 1 0 1 0 0 0 0 1 1 1
#> 8 1 NA 2 1 1 0 1 0 0 0 1 1
#> 9 0 2 2 2 1 2 2 0 0 0 3 0
#> 10 0 2 2 1 0 0 0 0 0 0 0 0
#> IIP25 IIP26 IIP27 IIP28 IIP29 IIP30 IIP31 IIP32 IIP01_i IIP02_i
#> 1 3 3 3 0 0 0 1 0 -1.0000000 -1.0000000
#> 2 0 0 0 1 0 0 0 2 0.0625000 0.0625000
#> 3 1 1 1 0 3 2 3 2 -0.4062500 -1.4062500
#> 4 1 2 3 2 3 2 3 2 0.7096774 -0.2903226
#> 5 2 1 0 0 0 0 0 0 -0.6250000 -0.6250000
#> 6 0 0 0 0 0 0 0 1 -0.2812500 -0.2812500
#> 7 1 0 0 0 1 1 0 0 0.5000000 -0.5000000
#> 8 1 1 1 0 0 1 2 1 0.2580645 -0.7419355
#> 9 1 0 1 0 0 1 3 0 -0.9687500 -0.9687500
#> 10 0 0 0 0 0 0 0 0 -0.2187500 -0.2187500
#> IIP03_i IIP04_i IIP05_i IIP06_i IIP07_i IIP08_i IIP09_i
#> 1 -1.0000000 -1.0000000 0.0000000 -1.0000000 0.0000000 -1.0000000 1.0000000
#> 2 -0.9375000 -0.9375000 2.0625000 1.0625000 1.0625000 0.0625000 -0.9375000
#> 3 -0.4062500 -1.4062500 -0.4062500 -0.4062500 -0.4062500 1.5937500 -1.4062500
#> 4 0.7096774 NA -0.2903226 0.7096774 -0.2903226 0.7096774 -0.2903226
#> 5 -0.6250000 0.3750000 -0.6250000 -0.6250000 0.3750000 0.3750000 -0.6250000
#> 6 -0.2812500 -0.2812500 -0.2812500 -0.2812500 0.7187500 0.7187500 -0.2812500
#> 7 -0.5000000 -0.5000000 1.5000000 0.5000000 0.5000000 -0.5000000 0.5000000
#> 8 0.2580645 -0.7419355 0.2580645 0.2580645 1.2580645 0.2580645 0.2580645
#> 9 1.0312500 1.0312500 -0.9687500 0.0312500 2.0312500 -0.9687500 0.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 1.7812500 -0.2187500 -0.2187500
#> IIP10_i IIP11_i IIP12_i IIP13_i IIP14_i IIP15_i IIP16_i
#> 1 0.0000000 -1.0000000 -1.0000000 -1.0000000 0.000000 3.0000000 2.0000000
#> 2 0.0625000 -0.9375000 0.0625000 3.0625000 2.062500 2.0625000 0.0625000
#> 3 -0.4062500 -1.4062500 -1.4062500 0.5937500 1.593750 1.5937500 0.5937500
#> 4 0.7096774 -0.2903226 1.7096774 -0.2903226 -1.290323 -0.2903226 0.7096774
#> 5 0.3750000 -0.6250000 1.3750000 0.3750000 0.375000 2.3750000 0.3750000
#> 6 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.281250 1.7187500 0.7187500
#> 7 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.500000 0.5000000 -0.5000000
#> 8 -0.7419355 -0.7419355 -0.7419355 0.2580645 NA 1.2580645 0.2580645
#> 9 -0.9687500 0.0312500 0.0312500 -0.9687500 1.031250 1.0312500 1.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 1.781250 1.7812500 0.7812500
#> IIP17_i IIP18_i IIP19_i IIP20_i IIP21_i IIP22_i IIP23_i
#> 1 1.0000000 3.0000000 1.0000000 -1.0000000 0.0000000 -1.0000000 -1.0000000
#> 2 -0.9375000 -0.9375000 0.0625000 -0.9375000 0.0625000 1.0625000 -0.9375000
#> 3 0.5937500 -0.4062500 -0.4062500 -1.4062500 1.5937500 0.5937500 1.5937500
#> 4 -1.2903226 -0.2903226 -0.2903226 -1.2903226 0.7096774 -0.2903226 0.7096774
#> 5 -0.6250000 0.3750000 -0.6250000 0.3750000 0.3750000 -0.6250000 0.3750000
#> 6 0.7187500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 0.7187500
#> 7 0.5000000 -0.5000000 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.5000000
#> 8 0.2580645 -0.7419355 0.2580645 -0.7419355 -0.7419355 -0.7419355 0.2580645
#> 9 0.0312500 1.0312500 1.0312500 -0.9687500 -0.9687500 -0.9687500 2.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500
#> IIP24_i IIP25_i IIP26_i IIP27_i IIP28_i IIP29_i IIP30_i
#> 1 -1.0000000 2.0000000 2.0000000 2.0000000 -1.0000000 -1.0000000 -1.0000000
#> 2 -0.9375000 -0.9375000 -0.9375000 -0.9375000 0.0625000 -0.9375000 -0.9375000
#> 3 -0.4062500 -0.4062500 -0.4062500 -0.4062500 -1.4062500 1.5937500 0.5937500
#> 4 -0.2903226 -1.2903226 -0.2903226 0.7096774 -0.2903226 0.7096774 -0.2903226
#> 5 0.3750000 1.3750000 0.3750000 -0.6250000 -0.6250000 -0.6250000 -0.6250000
#> 6 0.7187500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500 -0.2812500
#> 7 0.5000000 0.5000000 -0.5000000 -0.5000000 -0.5000000 0.5000000 0.5000000
#> 8 0.2580645 0.2580645 0.2580645 0.2580645 -0.7419355 -0.7419355 0.2580645
#> 9 -0.9687500 0.0312500 -0.9687500 0.0312500 -0.9687500 -0.9687500 0.0312500
#> 10 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500 -0.2187500
#> IIP31_i IIP32_i
#> 1 0.0000000 -1.0000000
#> 2 -0.9375000 1.0625000
#> 3 1.5937500 0.5937500
#> 4 0.7096774 -0.2903226
#> 5 -0.6250000 -0.6250000
#> 6 -0.2812500 0.7187500
#> 7 -0.5000000 -0.5000000
#> 8 1.2580645 0.2580645
#> 9 2.0312500 -0.9687500
#> 10 -0.2187500 -0.2187500