Skip to content

Commit

Permalink
Fix missing value handling in moderators
Browse files Browse the repository at this point in the history
  • Loading branch information
maltelueken committed Nov 8, 2023
1 parent 23e9834 commit 3aff05e
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/classicProcess.R
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,14 @@ ClassicProcess <- function(jaspResults, dataset = NULL, options) {
# Return matrix with dummy coding for each factor
return(conMat[, colIdx])
}
# If listwise missing value deletion, only use complete cases for quantiles
if (options$naAction == "listwise") {
isComplete <- complete.cases(dataset)
} else {
isComplete <- !logical(nrow(dataset))
}
# If not factor return quantiles of continuous moderator
return(quantile(dataset[[nms]], probs = probeVals))
return(quantile(dataset[[nms]][isComplete], probs = probeVals, na.rm = TRUE))
})

names(modProbes) <- modVars
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3aff05e

Please sign in to comment.