This function computes some statistics for each person.

1 | ```
person.stat(obj, columns, weights = FALSE)
``` |

`obj` |
An object containing the data imported by function |

`columns` |
A vector containing which columns to use. Columns can be specified by name or number. |

`weights` |
Logical. If TRUE weights are used to compute the score. |

A data frame with the following variables.

`id` |
person label. |

`score` |
total score for each person. If |

`max` |
maximum score for each person. |

`perc` |
ratio between score and max. |

Michela Battauz

`person.stat`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
data(test)
data(key)
data(weights)
data(weights_multiple)
testk <- addkey(test, keydata = key)
testw <- addweights(testk, weightsdata = weights)
testwm <- addweights(test, weightsdata = weights_multiple)
# number of correct responses for each person (only 4 items)
pst <- person.stat(obj = testk, col = 2:5)
pst
# sum of weights of correct responses for each person
pst <- person.stat(obj = testw, col = 2:5, weights = TRUE)
pst
# sum of weights of every response for each person
pst <- person.stat(obj = testwm, col = 2:5, weights = TRUE)
pst
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.