RE : Maen
- To: mathgroup at smc.vnet.net
- Subject: [mg48136] RE : [mg48119] Maen
- From: "Florian Jaccard" <florian.jaccard at eiaj.ch>
- Date: Fri, 14 May 2004 20:58:51 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello !
It works fine on my computer !
But you can use the << "Statistics`DescriptiveStatistics`" package... It
worked in previous versions...
In[1]:=
boys =
{192, 176, 178, 180, 189, 173, 177, 176, 176, 194,
178, 172, 175, 180, 170, 174, 180, 184, 177, 181,
190, 186, 187, 184, 190, 180, 178, 182, 181, 180,
175, 182, 182, 181, 179, 190, 173, 189, 173, 183,
172, 178, 182, 172, 190, 180, 176, 177, 181, 185,
174, 178, 178, 178, 170, 175, 178, 186, 185, 182,
179, 187, 183, 188, 191, 180, 193, 183, 185, 174,
174, 180, 191, 180, 177, 185, 192, 187, 170, 176,
170, 184, 179, 173, 184, 184, 190, 179};
In[2]:=
Mean[boys]//N
Out[2]=
180.705
And, if you want to look at other possibilities, use the packages
DataManipulation and DescriptiveStatistics.
For example, try the following inputs :
In[45]:=
<< "Statistics`DataManipulation`"
In[46]:=
effectifs = BinCounts[boys, {157.5, 207.5, 5}]
In[47]:=
BinLists[boys, {157.5, 207.5, 5}];
In[48]:=
centres = Table[i, {i, 160, 205, 5}]
In[49]:=
<< "Graphics`Graphics`"
In[50]:=
BarChart[Transpose[{effectifs, centres}],
AxesLabel -> {"height", "number of boys"}];
In[51]:=
BarChart[Transpose[{effectifs*(100/Plus @@ effectifs),
centres}], AxesLabel -> {"height", "%"}];
In[52]:=
effectifsCumulés = Table[Plus @@ Take[effectifs, i],
{i, 1, Length[effectifs]}]
In[53]:=
BarChart[Transpose[{effectifsCumulés, centres}],
AxesLabel -> {"height",
"number of boys with heigth at least..."}];
In[54]:=
<< "Statistics`DescriptiveStatistics`"
Mean :
In[55]:=
N[Mean[boys]]
Median :
In[56]:=
Median[boys]
Mode :
In[57]:=
Mode[boys]
Variances :
In[58]:=
N[VarianceMLE[boys]]
Or, using division by n-1 :
In[59]:=
N[Variance[boys]]
StandardDeviations :
In[60]:=
N[StandardDeviationMLE[boys]]
Using division by n-1 :
In[61]:=
N[StandardDeviation[boys]]
Greetings
F.Jaccard
-----Message d'origine-----
De : per.ronne at doesnt.work.spam.filter.invalid
[mailto:per.ronne at doesnt.work.spam.filter.invalid]
Envoyé : vendredi, 14. mai 2004 06:14
À : mathgroup at smc.vnet.net
Objet : [mg48119] Maen
I've just purchased Mathematica 5 but I've got some problems.
I write:
boys =
{192, 176, 178, 180, 189, 173, 177, 176, 176, 194,
178, 172, 175, 180, 170, 174, 180, 184, 177, 181,
190, 186, 187, 184, 190, 180, 178, 182, 181, 180,
175, 182, 182, 181, 179, 190, 173, 189, 173, 183,
172, 178, 182, 172, 190, 180, 176, 177, 181, 185,
174, 178, 178, 178, 170, 175, 178, 186, 185, 182,
179, 187, 183, 188, 191, 180, 193, 183, 185, 174,
174, 180, 191, 180, 177, 185, 192, 187, 170, 176,
170, 184, 179, 173, 184, 184, 190, 179}
But when I try to get their average height [it is the height of boys in
Danish upper grammar schools, grade 13 at the age of around 19], I get:
Mean[boys]
Mean[{192, 176, 178, 180, 189, 173, 177, 176, 176, 194, 178, 172, 175,
180,
170, 174, 180, 184, 177, 181, 190, 186, 187, 184, 190, 180, 178,
182, 181,
180, 175, 182, 182, 181, 179, 190, 173, 189, 173, 183, 172, 178,
182,
172, 190, 180, 176, 177, 181, 185, 174, 178, 178, 178, 170, 175,
178, 186,
185, 182, 179, 187, 183, 188, 191, 180, 193, 183, 185, 174, 174,
180,
191, 180, 177, 185, 192, 187, 170, 176, 170, 184, 179, 173, 184,
184, 190,
179}]
And it doesn't help to put on a //N:
Mean[boys] // N
Mean[{192., 176., 178., 180., 189., 173., 177., 176., 176., 194., 178.,
172.,
175., 180., 170., 174., 180., 184., 177., 181., 190., 186., 187.,
184.,
190., 180., 178., 182., 181., 180., 175., 182., 182., 181., 179.,
190.,
173., 189., 173., 183., 172., 178., 182., 172., 190., 180., 176.,
177.,
181., 185., 174., 178., 178., 178., 170., 175., 178., 186., 185.,
182.,
179., 187., 183., 188., 191., 180., 193., 183., 185., 174., 174.,
180.,
191., 180., 177., 185., 192., 187., 170., 176., 170., 184., 179.,
173.,
184., 184., 190., 179.}]
If I look up in the Stephen Wolfram's Mathematica book 5th Edition on
page 109, it should be possible to get:
data = {4.7, 7.2, 8.4, 5.8, 9.2, 3.9}
Mean[data]
6.46667
But instead I get:
Mean[{4.7, 7.2, 8.4, 5.8, 9.2, 3.9}]
What is wrong?
--
Per Erik Rønne