Simulate Response Data Files From Longitudinal Illusory Truth Study
simulate_resp_files(
nsubj,
phase_eff = c(0, 0, 0, 0),
path,
overwrite = FALSE,
p_too_fast = 0.01,
p_too_slow = 0.01,
p_incomplete = 0.01,
p_cheat = 0.01,
p_no_consent_all = 0.01,
p_no_consent_phase = 0.01,
p_nonnative = 0.01,
p_repeater = 0.01,
duration_range_1 = c(180, 2400),
duration_range_all = c(60, 1800)
)
Number of subjects; must be a multiple of 8.
A four-element vector giving the size of the
illusory truth effect at each of the four phases (on the log odds
scale). Use rep(0, 4)
for testing Type I error rate. A
value of .14 gives an effect of approximately 1/10 of a scale
point.
Path to subdirectory where resulting files will be stored; will be created if it does not exist.
Whether to overwrite the subdirectory if it exists.
Probability that the respondent completed the
task faster than the cutoff time ('Duration (in seconds)' less
than duration_range_1[1]
for Phase 1, less than
duration_range_all[1]
for all other phases).
Probability that the respondent completed the
task slower than the cutoff time ('Duration (in seconds)' greater
than duration_range_1[2]
for Phase 1, greater than
duration_range_all[2]
for all other phases).
Probability that the respondent failed to complete the task ('Finished' = FALSE).
Probability that the respondent looked up answers ('cheat' = "Yes...")
Probability the respondent refused consent to the full study.
Probability the respondent refused consent to a phase of the study.
Probability the respondent is not a native English speaker.
Probability that the respondent just pressed the same key over and over for at least one phase.
Two-element vector giving the range of acceptable task durations for Phase 1.
Two-element vector giving the range of acceptable task durations for Phases 2, 3, and 4.
A character vector with the names of the data files.
Simulates response data and writes a set of CSV files out
to path
in Qualtrics format. The file names are of the
format PXLY.csv
, where X is the phase number (1-4) and Y
is the list number (1-8). So P2L6.csv is the file for phase 2 of
list 6. When we ran a pilot study, we discovered that the data
files had a somewhat different structure from this, but we
nevertheless opted to retain this function rather than rewriting
it to match the new format.
# NOT RUN {
td <- tempdir()
simulate_resp_files(40, path = td, overwrite = TRUE)
dir(td) # show the response files
unlink(td, TRUE, TRUE) # cleanup
# }
Run the code above in your browser using DataLab