Description Usage Arguments Value Examples
The function simulates a data.frame including an id variable and the items of any questionnaire.
1 2 3 4 5 6 7  | simulate_items(
  num_cols = 10,
  num_rows = 100,
  item_name = "item",
  item_range = 0:3,
  prop_mis = 0.05
)
 | 
num_cols | 
 Number of items (default = 10)  | 
num_rows | 
 Number of rows (default = 100)  | 
item_name | 
 Abbreviated name of questionnaire (default = 'item')  | 
item_range | 
 Item Range (is the same for each item; default = 0 to 3)  | 
prop_mis | 
 Proportion of missing values to be put into each item (default = 0.05)  | 
The function returns the following variables:
id: Variable with identification numbers
item_1 to item_n Questionnaire items
1 2 3 4 5 6 7  | ## Not run: 
# Simulate Hospital Anxiety and Depression Scale
library(dplyr)
library(wakefield)
df <- simulate_items(num_cols = 14, num_rows = 100, item_name = "hads", item_range = 0:3, prop_mis = 0.05)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.