This function wraps functions from the careless package to help inspect and diagnose careless participants. It is optimized for using in R Markdown files.

carelessReport(
  data,
  items = names(data),
  nFlags = 1,
  flagUnivar = 0.99,
  flagMultivar = 0.95,
  irvSplit = 4,
  headingLevel = 3,
  datasetName = NULL,
  responseTime = NULL,
  headingSuffix = " {.tabset}",
  digits = 2,
  missingSymbol = "Missing"
)

Arguments

data

The dataframe.

items

The items to look at.

nFlags

How many indicators need to be flagged for a participant to be considered suspect.

flagUnivar

How extreme a score has to be for it to be flagged as suspicous univariately.

flagMultivar

This has not been implemented yet.

irvSplit

Whether to split for the IRV, and if so, in how many parts.

headingLevel

The level of the heading in Markdown (the number of #s to include before the heading).

datasetName

The name of the dataset to display (to override, if desired).

responseTime

If not NULL, the name of a column containing the participants' response times.

headingSuffix

The suffix to include; by default, set such that the individual participants IRP plots are placed in separate tabs.

digits

The number of digits to round to.

missingSymbol

How to represent missing values.

Value

NULL, invisibly; and prints the report.

Examples

### Get the BFI data taken from the `psych` package
dat <- ufs::bfi;

### Get the variable names for the regular items
bfiVars <-
  setdiff(names(dat),
          c("gender", "education", "age"));

### Inspect suspect participants, very conservatively to
### limit the output (these are 2800 participants).
carelessReport(data = dat,
               items = bfiVars,
               nFlags = 5);
#> 
#> 
#> ### Careless Responding Report {.tabset}
#> 
#> 
#> 
#> |      |Longstring |IRV Total |IRV 1 |IRV 2 |IRV 3 |IRV 4 |Mahalanobis Distance |
#> |:-----|:----------|:---------|:-----|:-----|:-----|:-----|:--------------------|
#> |63467 |6          |2.43*     |0.38  |2.58* |2.58* |2.74* |106.33*              |
#> |65150 |7*         |2.55*     |1.89  |2.58* |2.58* |2.74* |10.09                |
#> |65311 |5          |2.55*     |2.44* |2.58* |2.58* |2.74* |56.01                |
#> 
#> 
#> For the Individual Response Pattern plot for each participant, see the following headings, which may appear as tabs above this section.
#> 
#> 
#> 
#> 
#> 
#> #### IRP-plot for participant 63467
#> 
#> 
#> 

#> 
#> 
#> 
#> 
#> 
#> 
#> #### IRP-plot for participant 65150
#> 
#> 
#> 

#> 
#> 
#> 
#> 
#> 
#> 
#> #### IRP-plot for participant 65311
#> 
#> 
#> 

#> 
#>