Monday, July 11, 2016

linear Scale on standard deviation in R

scale = 10
x1 = rnorm(sd=1, n=1000)
x2 = rnorm(sd=scale,n=1000) #this probably only work when mean = 0
x2b = x1*scale

summary(x1)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -3.80100 -0.72600 -0.02927 -0.03594  0.66450  3.04300
summary(x2)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -33.0800  -6.8240  -0.4212  -0.0809   7.4640  31.5500
sd(x1)
## [1] 0.9787442
sd(x2)
## [1] 10.48616
sd(x2b)
## [1] 9.787442


No comments:

Post a Comment