recode_nr: Recognize and recode not-reached responses

Description Usage Arguments Value Author(s) See Also Examples

View source: R/recode_nr.R

Description

recode_nr() function recognizes and recodes not-reached responses, i.e., missing responses to items such that all subsequent items are missed as well by the respondent.

Usage

1
recode_nr(Data, nr_code = 99, df)

Arguments

Data

matrix or data.frame: object to be recoded, must include only items columns and no additional information

nr_code

single character, integer or numeric: specifying how should be recognized not-reached responses coded (default is 99)

df

deprecated. Use argument Data instead.

Value

A data.frame object.

Author(s)

Jan Netik
Institute of Computer Science of the Czech Academy of Sciences
netik@cs.cas.cz

Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz

See Also

ItemAnalysis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(HCI, package = "ShinyItemAnalysis")
HCImissed <- HCI[, 1:20]

# simulate skipped (missed) and not-reached items in HCI dataset
set.seed(4211)
for (i in 1:150) {
  # not-reached (minimum at 10th item, maximum at 20th)
  HCImissed[sample(1:nrow(HCImissed), 1), seq(sample(10:20, 1), 20)] <- NA

  # missed with random location
  HCImissed[sample(1:nrow(HCImissed), 1), sample(1:20, 1)] <- NA
}

summary(HCImissed)

HCImissedNR <- recode_nr(HCImissed, nr_code = 99)
head(HCImissedNR)
summary(HCImissedNR)

netique/ShinyItemAnalysis documentation built on Dec. 22, 2021, 12:10 a.m.