MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Basic Statistics in Mathematica 3.0



Jo Ann CAHN wrote in message <6jf6ev$4ao@smc.vnet.net>...
>The calculation of, for example, the mean and the variance of a
>statistical  series is staighforward in Mathematica but I don't know
>how to do it if,  instead of having the complete list of values of the
>statistical variable I  only have the set of different values that
>variable takes with their respective frequencies. I have trouble
>thinking Mathematica cannot handle such a basic task but I can't find
>a way to do it.


If the data is given in the form

{{2,3}, {1,1},{6,2}}

then we can use

Flatten[Apply[Table[#1,{#2}]&,{{2,3}, {1,1},{6,2}},1]]

{2,2,2,1,6,6}


--
Allan Hayes
Mathematica Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay@haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642





  • Prev by Date: Re: Pagination problems Mathematica 3.0
  • Next by Date: Re: how to replace...?
  • Prev by thread: Re: Basic Statistics in Mathematica 3.0
  • Next by thread: Solve for positive, real-valued solutions