Change filtering of Finished and remove subject that was not in wave 1 from data
This commit is contained in:
parent
00ae79b876
commit
bbdb35559c
@ -13,7 +13,7 @@ anonymize_wave <- function(data, wave, sample = "sample1") {
|
||||
|
||||
df <- data |>
|
||||
dplyr::filter(Status != 1) |> # exclude Status not "Survey Preview"
|
||||
dplyr::filter(Finished != 0) |> # exclude survey not finished
|
||||
#dplyr::filter(Finished != 0) |> # exclude survey not finished
|
||||
dplyr::filter(informed_consent == 1) |> # exclude did not give consent
|
||||
dplyr::filter(truth_answer_check == 1) |> # exclude did not provide honest answers
|
||||
dplyr::filter(consent_use_of_data == 1) # exclude did not consent to data use
|
||||
|
||||
@ -32,6 +32,10 @@ dat3[dat3$subj_id == names(which(table(dat3$subj_id) > 1)),
|
||||
dat1 <- subset(dat1, !duplicated(dat1$subj_id))
|
||||
dat3 <- subset(dat3, !duplicated(dat3$subj_id))
|
||||
|
||||
# Remove subject that suddenly emerged in wave 3 (which should not be possible,
|
||||
# since only participants from wave 1 were invited for participation)
|
||||
dat3 <- subset(dat3, subj_id != "subj1009")
|
||||
|
||||
# Remove empty variables wave 1
|
||||
which(apply(dat1, 2, function(x) is.na(x) |> sum()) == nrow(dat1)) |> names()
|
||||
dat1 <- subset(dat1, select = !grepl("^Q1.*", names(dat1)))
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user