makeFakeData {PROscorerTools} | R Documentation |
Make a data frame of fake item data
Description
makeFakeData
creates a data frame containing fake item
data to facilitate the writing and testing of new scoring functions. It is
also used to create data for examples of scoring function usage.
Usage
makeFakeData(
n = 20,
nitems = 9,
values = 0:4,
propmiss = 0.2,
prefix = "q",
id = FALSE
)
Arguments
n |
The number of respondents (rows) in the fake data. The default is
|
nitems |
The number of items in the fake data. The default is
|
values |
A vector of all possible values the items can take. The
default is |
propmiss |
The proportion of responses that will be randomly assigned to
be missing. The default is |
prefix |
A quoted character that will be used to prefix the item
numbers. The default is |
id |
Logical, if |
Details
The item responses in the first row are all the lowest possible
value and never NA
, and the responses on the second row are all the
highest possible value and never NA
. This makes it easier to check
if the scoring function is at least getting the scores correct for subjects
with no missing values. It also makes it easier in some cases to check
that the scoring function is properly reversing the items according to the
itemsrev
argument of the scoring function.
Although the resulting data frame can be customized using the arguments, the default values are sufficient for most generic testing purposes (see example).
Value
A data frame with n
rows, nitems
items, and possibly
with some missing values randomly inserted.
Examples
makeFakeData()