flag.by.sds | R Documentation |
Identifies which elements of x are a certain number of standard deviations from the mean (e.g., values more than 3 standard deviations from the mean).
flag.by.sds(x, sds = 3, print = TRUE, na.rm = FALSE)
x |
vector of values. |
sds |
number of standard deviations away from the mean at which "extreme" values should be identified. |
print |
a logical value indicating whether to display the number and percentage of identified elements. |
na.rm |
a logical value indicating whether NA values should be ignored when computing the mean and standard deviation. |
logical vector indicating whether each element of x is more than the specificed number of deviations away from the mean.
trim
to treat such elements as missing data.
fence
to replace such elements with the
threshold value.
flag.by.group
to identify values a certain number of
standard deviations away from a group mean (e.g., the mean within a condition
or the mean for a research participant) rather than the overall mean.
my.data <- data.frame(RT=rnorm(300, mean=789, sd=150)) my.data$OutlyingRT <- flag.by.sds(my.data$RT, sds=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.