-2

I am trying to calculate sd using formula shew<-(sum((x-kl)^2))/(t-1) but result is wrong. I have tried calculating sd using SD function and result is different. can anyone help.

IndexStart <- 1
x <- seq(IndexStart, 6, 1)
x
t<-6
xm <- 1
kl<-mean(x)
kl
n<-sd(x)
n
shew<-(sum((x-kl)^2))/(t-1)
Jals
  • 29
  • 8
  • 1
    @李哲源 Zheyuan Li is correct , look [formula](https://www.mathsisfun.com/data/standard-deviation-formulas.html) – parth Jun 15 '17 at 04:21

1 Answers1

2

This does not seem like a typo question so I answer it.

You missed a square root: sqrt(shew), otherwise you get sample variance not standard error.

Zheyuan Li
  • 71,365
  • 17
  • 180
  • 248
  • It's is giving me this reply. Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score. – Jals Jun 22 '17 at 05:03