0

I am trying to score my scale,

key.list <- list(FinansalBilgi=c(25:34),
             Finansalihtiyat=c(37:40,42,43,44,45),
             borclanmaTutumu=c(35,36,41,46))
keys <- make.keys(23,key.list,item.labels = colnames(data)[24:46])

key.list is ok but when I run the function it "Error in[<-(tmp, abs(list.i), i, value = sign(list.i)) : subscript out of bounds" error what should I do ? please help

1 Answers1

0

There are two issues. First of all, let me type psych::make.keys function's closed form:

function (nvars, keys.list, item.labels = NULL, key.labels = NULL)

1- Value for nvars should be 22 in your list. Or you may consider adding 1 more item to key.list to make it 23 items.

2- After checking the function body, I saw that you need to start numbering items in your key.list from 1. Below script works fine.

key.list <- list(FinansalBilgi=c(1:10),
                 Finansalihtiyat=c(13:16,18:21),
                 borclanmaTutumu=c(11:12,17,22))

keys <- make.keys(22,key.list)

OR

keys <- make.keys(22,key.list, item.labels = colnames(data)[25:46])

I hope this helps.

Serkan
  • 1
  • 3