View source: R/util-make_FACTdata.R
make_FACTdata | R Documentation |
Generates FACT-like questionnaire answers for fake respondents.
make_FACTdata( namesAC = NULL, N = 8, AConly = FALSE, pmiss1 = 0.1, pmiss2 = 0.5, misscode = NA )
namesAC |
Character vector of the "Additional Concerns" item names. |
N |
An integer specifying how many fake respondents to generate. Default is 8. |
AConly |
Logical, if FALSE (the default) the 27 FACT-G items will be
generated in addition to items you supply to |
pmiss1 |
The proportion of items with missing answers in the first half of respondents. |
pmiss2 |
The proportion of items with missing answers in the second half of respondents. |
misscode |
The value used for missing answers. Default is |
This function is used to generate fake responses to FACT/FACIT
questionnaires. It is a utility to generate example data for testing the
functions and for demonstrating their usage. Missing item proportions can be
specified separately for the first and second half of respondents in the
generated data frame (using pmiss1
and pmiss2
, respectively).
If AConly = FALSE
, the default, then FACT-G items will automatically
be generated in addition to any "Additional Concerns" (AC) items given to
namesAC
. Set AConly = TRUE
to generate only the AC items. If
namesAC = NULL
(the default), then only FACT-G items will be
generated.
If AConly = TRUE
then at least 2 item names must be given to
namesAC
.
A data frame with N
fake respondents (8 by default). The first half
of respondents will have missing values (coded as 9
) for roughly 10\
of the items, and the last half will have missing values for roughly 50\
the items.
(exampleDat <- make_FACTdata()) itemNames <- c('B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'P2') (exampleDat <- make_FACTdata(namesAC = itemNames)) (exampleDat <- make_FACTdata(namesAC = itemNames, AConly = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.