Economics of Money and Banking / Perry G Mehrling / Ders 1

R Studio Statistics I

Sample Mean and Sample variance:




R unbiased variance :






Case:

I created one serie with the following code:


x= seq(1,20,2)

and the mean of this serie is as follow:


mean(x)

10


There are two ways to calculate sample variance:


mean((x-mean(x))^2)

or


mean(x^2)-(mean(x))^2

result is "33".

R unbiased variance is

var(x)

36.6

 and standart deviation is

sd(x)

6.05



Source:R Programming and Its Applications in Financial Mathematics







Yorumlar