Skip to content
Prev 318311 / 398503 Next

Converting code to R Question

If you do this sort of thing a lot you may find the psych package helpful:

# make example data
x <- 1:3
dat <- data.frame(expand.grid(Item1=x, Item2=x, Item3=x, Item4=x))

# make scoring ky
key <- c(Item1=1, Item2=2, Item3=1, Item4=1)

# load psych library
library(psych)

# score
(scores <- score.multiple.choice(key, dat, total=TRUE, short=FALSE))
dat$Variable <- scores$scores

Best,
Ista
On Mon, Feb 25, 2013 at 8:02 PM, Craig J <cjohns38 at gmail.com> wrote: