# How to find the Mean of results given as a list of Rules?

How can we find the mean of the following type of data?

{{β -> 0.516819}, {β -> 0.499907},
{β -> 0.494064}, {β -> 0.472742},
{β -> 0.537485}, {β -> 0.478291},
{β -> 0.523855}, {β -> 0.483624},
{β -> 0.50126},  {β -> 0.527267}}


Which command could be used to find the mean of this data?

• Welcome to SE! It will help those might answer if you would please post code that is syntactically correct and properly formatted. See editing help. Jan 23, 2014 at 12:49
• This should be helpful: Using the result of Solve in subsequent calculations, together with Mean. Jan 23, 2014 at 12:51
• @JacobAkkerboom Sorry, it was involuntary. Please rollback my edit to yours if think it better. (or merge both!) Jan 23, 2014 at 13:08

Mean[beta /. {{beta -> 0.516819}, {beta -> 0.499907}, {beta ->
0.494064}, {beta -> 0.472742}, {beta -> 0.537485}, {beta ->
0.478291}, {beta -> 0.523855}, {beta -> 0.483624}, {beta ->
0.50126}, {beta -> 0.527267}}]


Considering the votes, I think Timings are in order.

Double semicolons are intentional, they prevent extra memory use when \$HistoryLength > 1

nn = 1*^6;
rands = RandomReal[1, nn]; ;
data = {b -> #} & /@ rands; ;

Mean@data[[All, 1, 2]] // Timing
Mean@(b /. data) // Timing


Outputs

{0.069164, 0.500199}
{0.983088, 0.500199}


Perhaps also noteworthy

<<Developer
data[[All, 1, 2]] // PackedArrayQ
(b /. data) // PackedArrayQ


Outputs

False
False


[Beta] is bad syntax, so i replaced all by beta

Mean[{{beta->0.516819},{beta->0.499907},{beta->0.494064},{beta->0.472742},
{beta->0.537485},{beta->0.478291},{beta->0.523855},{beta->0.483624},{beta->0.50126},
{beta->0.527267}}[[All,1,2]]]
`

If you want the variance, try opening the documentation and search for it