User Tools

Site Tools


r:standard_error

Standard deviation:

plot(seq(-3.2,3.2,length=50),dnorm(seq(-3,3,length=50),0,1),type="l",xlab="",ylab="",ylim=c(0,0.5))
segments(x0 = c(-3,3),y0 = c(-1,-1),x1 = c(-3,3),y1=c(1,1))
text(x=0,y=0.45,labels = expression("99.7% of the data within 3" ~ sigma))

arrows(x0=c(-2,2),y0=c(0.45,0.45),x1=c(-3,3),y1=c(0.45,0.45))
segments(x0 = c(-2,2),y0 = c(-1,-1),x1 = c(-2,2),y1=c(0.4,0.4))
text(x=0,y=0.3,labels = expression("95% of the data within 2" ~ sigma))

arrows(x0=c(-1.5,1.5),y0=c(0.3,0.3),x1=c(-2,2),y1=c(0.3,0.3))
segments(x0 = c(-1,1),y0 = c(-1,-1),x1 = c(-1,1),y1=c(0.25,0.25))
text(x=0,y=0.15,labels = expression("68% of the data within 1" * sigma),cex=0.9)

see this blog for about layout of figures

par(mfrow=c(2,2)) 
x1 <- rnorm(100)
x2 <- rnorm(1000)
x3 <- rnorm(10000)
x4 <- rnorm(100000)
hist(x1)
hist(x2)
hist(x3)
hist(x4)
par(mfrow=c(1,1))
x <- norm(1000, mean=0, sd=10)
sex1 <- sd(x) / sqrt(1)
sex4 <- sd(x) / sqrt(4)
sex25 <- sd(x) / sqrt(25)
sex100 <- sd(x) / sqrt(100)
sex900 <- sd(x) / sqrt(900)
sex1600 <- sd(x) / sqrt(1600)

sex1
sex4
sex25
sex100
sex900
sex1600
r/standard_error.txt · Last modified: 2017/09/14 08:42 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki