[R] How to calculate variance on multiple numbers at once?

Luigi Marongiu marongiu.luigi at gmail.com
Wed Nov 11 12:26:25 CET 2015

Dear all,

if I have a sample set of the following numbers x1=0.09, x2=0.94,
x3=0.48, x4=0.74, x5=0.04 I can calculate the variance easily.
But if each x is actually a subset of multiple values, what would be
the formula to calculate the variance? and it is possible to implement
such mathematical function in R?

For instance if I have the following: x1=(0.77, 0.22, 0.44), x2=(0.26,
0.89, 0.58), x3=(0.20, 0.25, 0.91), x4=(0.06, 0.13, 0.26) and
x5=(0.65, 0.16, 0.72) how can i calculate the variance for each x?

Thank you

More information about the R-help mailing list