shakthydoss - 1 year ago 81

R Question

I have a vector of data and it is normally distributed.

I get a clear bell shape from the chart.

Question is how do I get data only belonging to 1sd (68% of data)

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

Suppose you vector is `x`

, you can use `x[abs(x - mean(x)) < sd(x)]`

to extract data distributed around 1 standard error of the mean.

An alternative method (maybe more preferred) is `x[abs(scale(x)) < 1]`

, where `scale(x)`

gives standardized / normalized `x`

.

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**