This function will replace outliers based on a z-score cutoff

replace_outliers(
  x,
  variables = c(),
  cutoff = 3.5,
  with = "NA",
  pass = 1,
  id = "Subject",
  log_file = NULL
)

Arguments

x

dataframe

variables

variables c() to be trimmed

cutoff

z-score cutoff to use for trimming (default: 3.5)

with

What value should the trimmed values be replaced with. (default: with = "NA")

pass

How many times to do outlier replacement? ex. pass = 2 will do a two-pass outlier replacement. (default: 1)

id

If variables = "all", then need to supply the subject ID variable

log_file

the file path and name for where to save a log file to