Skip to contents

The B-HiTOP instrument has 45 items and yields 7 scale scores. To demonstrate the ability of the package to calculate these scale scores, we can use real example data (n=143) that was collected at the University of Kansas (KU) by Girard & Gray in 2024. This data is stored in the package under the name ku_bhitop.

First, we load the package into memory using the library() function. If this doesn’t work, make sure you installed the package properly (see the README on GitHub).

Next, we can load the example dataset from the package using the data() function. It is a large tibble that contains a participant column with a unique identifier for each participant, a biosex column indicating whether each participant is “female” or “male”, and then 45 columns numbered bhitop01 to bhitop45 containing each participant’s rating on each item of the B-HiTOP (on a numerical scale from 1 to 4).

data("ku_bhitop")
ku_bhitop
#> # A tibble: 143 × 47
#>    participant      biosex bhitop01 bhitop02 bhitop03 bhitop04 bhitop05 bhitop06
#>    <chr>            <fct>     <dbl>    <dbl>    <dbl>    <dbl>    <dbl>    <dbl>
#>  1 R_3KOxNF2JCWCT9… female        1        1        2        1        2        1
#>  2 R_1RLNDHA6qwM6v… female        1        1        1        1        2        1
#>  3 R_61bkFQweO6uye… female        2        2        2        1        3        1
#>  4 R_3kO0nXySSg3nW… female        2        1        2        1        4        1
#>  5 R_5yGEvYGy4YqwY… female        1        2        3        1        2        2
#>  6 R_3Pv6gPT8dxYkB… female        2        3        3        1        3        1
#>  7 R_3KBAdhGCugaGG… female        2        1        2        3        2        3
#>  8 R_5fkRaVh1ZiNvm… male          1        1        1        1        1        1
#>  9 R_5hbvtJ91lzoGS… male          2        2        3        1        2        2
#> 10 R_5dWEI8k79ahEZ… female        1        1        1        1        1        1
#> # ℹ 133 more rows
#> # ℹ 39 more variables: bhitop07 <dbl>, bhitop08 <dbl>, bhitop09 <dbl>,
#> #   bhitop10 <dbl>, bhitop11 <dbl>, bhitop12 <dbl>, bhitop13 <dbl>,
#> #   bhitop14 <dbl>, bhitop15 <dbl>, bhitop16 <dbl>, bhitop17 <dbl>,
#> #   bhitop18 <dbl>, bhitop19 <dbl>, bhitop20 <dbl>, bhitop21 <dbl>,
#> #   bhitop22 <dbl>, bhitop23 <dbl>, bhitop24 <dbl>, bhitop25 <dbl>,
#> #   bhitop26 <dbl>, bhitop27 <dbl>, bhitop28 <dbl>, bhitop29 <dbl>, …

Basic Scoring

To turn these item-level ratings into mean scores on the 7 scales, we can use the score_bhitop() function. It needs to know what object contains the data and which columns contain the item-level data. There are several ways we can specify the items. First, we can provide the column numbers and use the : shortcut. In this tibble, the items are from column 3 to column 47 so we can use items = 3:47. I am going to also set append = FALSE so that you can quickly see the scale scores.

scores <- score_bhitop(
  data = ku_bhitop,
  items = 3:47,
  append = FALSE
)
scores
#> # A tibble: 143 × 7
#>    bhitop_somatoform bhitop_antagonism bhitop_internalizing bhitop_disinhibition
#>                <dbl>             <dbl>                <dbl>                <dbl>
#>  1              1.12              1.33                 1.43                 1.22
#>  2              1.12              1                    1.43                 1.67
#>  3              1.62              1.33                 2                    1.11
#>  4              1.5               1.56                 2.57                 2.11
#>  5              2                 1.56                 1.29                 2.22
#>  6              2.25              1.22                 2.14                 1.33
#>  7              1.5               3.22                 1.86                 2.33
#>  8              1.25              2.11                 1.14                 1.44
#>  9              2.38              1.33                 2.14                 1.89
#> 10              1                 1.11                 1                    1   
#> # ℹ 133 more rows
#> # ℹ 3 more variables: bhitop_thoughtDisorder <dbl>, bhitop_detachment <dbl>,
#> #   bhitop_pFactor <dbl>

Appending

If I had instead set append = TRUE (or left it off, as that is the default), we would get back the ku_bhitop tibble with the scale scores added to the end as extra columns. Notice below how we now have 54 columns instead of 47.

scores <- score_bhitop(
  data = ku_bhitop,
  items = 3:47
)
scores
#> # A tibble: 143 × 54
#>    participant      biosex bhitop01 bhitop02 bhitop03 bhitop04 bhitop05 bhitop06
#>    <chr>            <fct>     <dbl>    <dbl>    <dbl>    <dbl>    <dbl>    <dbl>
#>  1 R_3KOxNF2JCWCT9… female        1        1        2        1        2        1
#>  2 R_1RLNDHA6qwM6v… female        1        1        1        1        2        1
#>  3 R_61bkFQweO6uye… female        2        2        2        1        3        1
#>  4 R_3kO0nXySSg3nW… female        2        1        2        1        4        1
#>  5 R_5yGEvYGy4YqwY… female        1        2        3        1        2        2
#>  6 R_3Pv6gPT8dxYkB… female        2        3        3        1        3        1
#>  7 R_3KBAdhGCugaGG… female        2        1        2        3        2        3
#>  8 R_5fkRaVh1ZiNvm… male          1        1        1        1        1        1
#>  9 R_5hbvtJ91lzoGS… male          2        2        3        1        2        2
#> 10 R_5dWEI8k79ahEZ… female        1        1        1        1        1        1
#> # ℹ 133 more rows
#> # ℹ 46 more variables: bhitop07 <dbl>, bhitop08 <dbl>, bhitop09 <dbl>,
#> #   bhitop10 <dbl>, bhitop11 <dbl>, bhitop12 <dbl>, bhitop13 <dbl>,
#> #   bhitop14 <dbl>, bhitop15 <dbl>, bhitop16 <dbl>, bhitop17 <dbl>,
#> #   bhitop18 <dbl>, bhitop19 <dbl>, bhitop20 <dbl>, bhitop21 <dbl>,
#> #   bhitop22 <dbl>, bhitop23 <dbl>, bhitop24 <dbl>, bhitop25 <dbl>,
#> #   bhitop26 <dbl>, bhitop27 <dbl>, bhitop28 <dbl>, bhitop29 <dbl>, …

Items as Strings

Alternatively, we could provide the item column names as a character string. Typing out all 45 item names would be a hassle, but luckily this dataset named them consistently so we can build the names automatically using sprintf(). If we use the “bhitop%02d” format and apply that across the numbers 1 to 45, that will create the zero-padded column names we need. If there was no zero-padding, we could have just used “bhitop%d”.

scores <- score_bhitop(
  data = ku_bhitop,
  items = sprintf("bhitop%02d", 1:45),
  append = FALSE
)
scores
#> # A tibble: 143 × 7
#>    bhitop_somatoform bhitop_antagonism bhitop_internalizing bhitop_disinhibition
#>                <dbl>             <dbl>                <dbl>                <dbl>
#>  1              1.12              1.33                 1.43                 1.22
#>  2              1.12              1                    1.43                 1.67
#>  3              1.62              1.33                 2                    1.11
#>  4              1.5               1.56                 2.57                 2.11
#>  5              2                 1.56                 1.29                 2.22
#>  6              2.25              1.22                 2.14                 1.33
#>  7              1.5               3.22                 1.86                 2.33
#>  8              1.25              2.11                 1.14                 1.44
#>  9              2.38              1.33                 2.14                 1.89
#> 10              1                 1.11                 1                    1   
#> # ℹ 133 more rows
#> # ℹ 3 more variables: bhitop_thoughtDisorder <dbl>, bhitop_detachment <dbl>,
#> #   bhitop_pFactor <dbl>

Scale Prefixes

Also note that each scale column has the prefix “bhitop_” in its name. You can change the prefix (e.g., setting it to "bh_") or even turn it off (e.g., setting it to "") using the prefix argument.

scores <- score_bhitop(
  data = ku_bhitop,
  items = sprintf("bhitop%02d", 1:45),
  prefix = "bh_",
  append = FALSE
)
scores
#> # A tibble: 143 × 7
#>    bh_somatoform bh_antagonism bh_internalizing bh_disinhibition
#>            <dbl>         <dbl>            <dbl>            <dbl>
#>  1          1.12          1.33             1.43             1.22
#>  2          1.12          1                1.43             1.67
#>  3          1.62          1.33             2                1.11
#>  4          1.5           1.56             2.57             2.11
#>  5          2             1.56             1.29             2.22
#>  6          2.25          1.22             2.14             1.33
#>  7          1.5           3.22             1.86             2.33
#>  8          1.25          2.11             1.14             1.44
#>  9          2.38          1.33             2.14             1.89
#> 10          1             1.11             1                1   
#> # ℹ 133 more rows
#> # ℹ 3 more variables: bh_thoughtDisorder <dbl>, bh_detachment <dbl>,
#> #   bh_pFactor <dbl>

Simple Standard Errors

Finally, in addition to calculating each scale score as the mean of its corresponding items, we can also calculate each scale score’s standard error as the SD of its corresponding items divided by the square root of its number of items. These standard errors are especially useful when plotting the scores as they can be converted into confidence intervals. We turn this on using calc_se.

scores <- score_bhitop(
  data = ku_bhitop,
  items = sprintf("bhitop%02d", 1:45),
  calc_se = TRUE,
  append = FALSE
)
scores
#> # A tibble: 143 × 14
#>    bhitop_somatoform bhitop_antagonism bhitop_internalizing bhitop_disinhibition
#>                <dbl>             <dbl>                <dbl>                <dbl>
#>  1              1.12              1.33                 1.43                 1.22
#>  2              1.12              1                    1.43                 1.67
#>  3              1.62              1.33                 2                    1.11
#>  4              1.5               1.56                 2.57                 2.11
#>  5              2                 1.56                 1.29                 2.22
#>  6              2.25              1.22                 2.14                 1.33
#>  7              1.5               3.22                 1.86                 2.33
#>  8              1.25              2.11                 1.14                 1.44
#>  9              2.38              1.33                 2.14                 1.89
#> 10              1                 1.11                 1                    1   
#> # ℹ 133 more rows
#> # ℹ 10 more variables: bhitop_thoughtDisorder <dbl>, bhitop_detachment <dbl>,
#> #   bhitop_pFactor <dbl>, bhitop_somatoform_se <dbl>,
#> #   bhitop_antagonism_se <dbl>, bhitop_internalizing_se <dbl>,
#> #   bhitop_disinhibition_se <dbl>, bhitop_thoughtDisorder_se <dbl>,
#> #   bhitop_detachment_se <dbl>, bhitop_pFactor_se <dbl>

Note how there are now 14 columns instead of 7. The extra columns aren’t shown in the preview above, but they are named with the _se suffix, e.g., bhitop_somatoform_se.