2

I have a data set I am trying to normalize with a mean of 0 and a standard deviation of 0.5.

Standardize data columns in R

This question seemed to be similar to my needs but I am not sure how to change the standard deviation from 1 to 0.5.

Thank you for any help!

Community
  • 1
  • 1
Mar
  • 21
  • 2

1 Answers1

6

If you have a Normal(0,sd=1) distribution and you want a Normal(0,sd=.5), just multiply by .5. See

# x ~ Normal(0,1)
x<-rnorm(10000)
mean(x)
# [1] 0.003044746
sd(x)
# [1] 0.9987472

#transform
y <- .5*x
mean(y)
# [1] 0.001522373
sd(y)
# [1] 0.4993736
MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • 1
    Also note that this really has nothing to do with the normal distribution and this advice holds for any distribution with a finite standard deviation. – Dason Feb 19 '15 at 15:47