Skip to contents

MFI domain score calculator

Usage

mfi_domains(
  ds,
  reverse = TRUE,
  reverse.vars = c(2, 5, 9, 10, 13, 14, 16, 17, 18, 19)
)

Arguments

ds

data set of MFI scores, 20 columns

reverse

reverse scoring

reverse.vars

variables/columns to reverse

Value

tibble of domain scores

Examples

mfi_mess <- data.frame(matrix(
sample(c(" 1. ", "2. -A", "3.", " 4  ", "5.", NA),200,replace=TRUE),ncol=20))
mfi_mess |> mfi_domains()
#> # A tibble: 10 × 5
#>      act   gen   men   mot   phy
#>    <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1    15    13    NA    NA    10
#>  2    NA    NA    NA    12    NA
#>  3    NA    10    NA     9    10
#>  4    16    NA    14     9    13
#>  5    15    14    NA    NA    NA
#>  6     9    14    11    NA    NA
#>  7     9    13    12    17    NA
#>  8    12    NA    NA     9    NA
#>  9    10    12    NA    16     8
#> 10    18    NA    14    NA    20