Re: Mean
- To: mathgroup at smc.vnet.net
- Subject: [mg48169] Re: Mean
- From: drbob at bigfoot.com (Bobby R. Treat)
- Date: Sat, 15 May 2004 03:56:28 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
You've apparently used Mean without (or before) loading the package that contains it. It's in the System context in 5.0.1, but in earlier versions, you have to load a package such as Statistics`DescriptiveStatistics`. Look up Mean in Help, and you can find out which package to load, and how. Something like... <<Statistics`DescriptiveStatistics` or Needs["Statistics`"] The latter is simplest, especially if you put it in your Init.m file. It means you never have to manually load a Statistics package. Bobby per.ronne at doesnt.work.spam.filter.invalid wrote in message news:<c81hen$4sd$1 at smc.vnet.net>... > 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?