Calculates the number of respondents flagged with a flagging strategy. Also calculates the agreement between flagging strategies.
Usage
# S3 method for class 'flag_resp'
summary(object, normalize = F, ...)Arguments
- object
An object of type
flag_respwhich is created using theflag_resp()function.- normalize
A logical value indicating, whether to normalize the agreement estimates between flagging strategies. See details for more information.
- ...
Other arguments for summary functions (currently not supported).
Value
An object of class "summary_flag_resp". The object works like a list with four elements.
n_flagged: a named vector of the number of cases a flagging strategy flagged as positive.
agreement: a data frame which counts the number of cases two flagging strategies flagged as positive. If
normalized, the values are the percentage agreement in flagged respondents.normalized: Indicator if agreement values were normalized.
n: number of rows in
object.
Details
The agreement is either the count of respondents which two flagging strategies
flag (normalize = T) or the number of respondents that is flagged positive by
at least one flagging strategy.
In logical terms, the normalized agreement is sum(fs1 & fs2) / sum(fs1 | fs2).
Examples
resp_distributions(nep) |>
flag_resp(ii_mean > 3,
ii_sd > 1,
ii_mean > 3 & ii_sd > 1) |>
summary()
#>
#> ── Number of respondents flagged (Total N: 1222)
#> ii_mean > 3 ii_sd > 1 ii_mean > 3 & ii_sd > 1
#> 832 615 543
#>
#> ── Agreement between flagging strategies
#>
#>
#> Flag ii_mean > 3 & ii_sd > 1 ii_sd > 1 ii_mean > 3
#> ------------------------ ------------------------ ---------- ------------
#> ii_mean > 3 & ii_sd > 1 543
#> ii_sd > 1 543 615
#> ii_mean > 3 543 543 832
