View source: R/quality_report.R
| quality_report | R Documentation |
Evaluates collected response data against the instrument specification and produces a structured quality report. The report covers attention check performance, completion time, straight-lining within scale blocks, item-level missingness, respondent-level missingness, and duplicate respondent IDs where supplied.
quality_report(
data,
instrument,
respondent_id = NULL,
submitted_at = NULL,
started_at = NULL,
time_min = NULL,
straightline_scales = TRUE,
missing_threshold = 0.2
)
data |
A |
instrument |
An |
respondent_id |
Character or NULL. The column name holding unique respondent identifiers. Used for duplicate detection. |
submitted_at |
Character or NULL. The column name holding submission timestamps. Used for completion time analysis. |
started_at |
Character or NULL. The column name holding survey start
timestamps. When |
time_min |
Numeric or NULL. Minimum acceptable completion time in seconds. Respondents with a submission time below this threshold are flagged as speeders when timing data are available. |
straightline_scales |
Logical. Whether to check for straight-lining
within each defined scale block. Defaults to |
missing_threshold |
Numeric. The proportion of missing item responses
above which a respondent is flagged. Defaults to |
Timing analysis is available when the data contain a submission timestamp
column and either an explicit started_at column or one of the recognised
defaults: started_at, start_time, started, or .started_at.
An object of class sframe_quality_report, a named list with
elements: summary, attention, timing, straightline, missing,
and duplicates. Use print() for a formatted summary.
sf_check(), read_responses(), score_scales()
instr <- read_sframe(
system.file("extdata", "tourism_services_demo.sframe",
package = "surveyframe")
)
responses <- read_responses(
system.file("extdata", "tourism_services_responses.csv",
package = "surveyframe"),
instr,
respondent_id = "respondent_id",
submitted_at = "submitted_at",
meta_cols = "started_at"
)
qr <- quality_report(
responses,
instr,
respondent_id = "respondent_id",
submitted_at = "submitted_at",
started_at = "started_at",
straightline_scales = FALSE
)
print(qr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.