Reputation: 1
I was given the mean: 62.4 and the standard deviation: 18.7. So given the mean and standard deviation, how do I find out the data points that are one standard deviation away from the given mean? Another question is asking for two standard deviation, but if I understand how to get the first standard, I believe I can handle that problem. I prefer using DPYLR.
Upvotes: 0
Views: 181
Reputation: 1277
A simple apporach is to utilize the following two R features:
c(1,2) > c(2,0)
yields c(FALSE,TRUE)
Thus, if x is the vector of your data points, you can count the number of datapoints in $\mu \pm \sigma$:
mu <- mean(x)
s <- sd(x)
sum( (x > mu - s) & (x < mu + s))
Upvotes: 1