MathGroup Archive 2004

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

Search the Archive

Re: Stats Pack and LocationReport

  • To: mathgroup at
  • Subject: [mg51376] Re: [mg51335] Stats Pack and LocationReport
  • From: Tomas Garza <tgarza01 at>
  • Date: Fri, 15 Oct 2004 02:47:29 -0400 (EDT)
  • References: <>
  • Sender: owner-wri-mathgroup at

You are doing nothing wrong. Mathematica is not following a consistent
approach when it evaluates LocationReport as compared to the evaluation of
Mean (and the other location parameters). The evaluation of Mean uses (or so
it seems) a simple application of Plus to a list and then divides by the
Length of the list. But Plus has attribute Listable, so that if the elements
of the list are themselves lists (as in your example), Plus computes first
the sum of each sublist and then goes on to compute the sum of the resulting
sums. However, LocationReport[lst] checks first whether lst is a vector of
numbers and if that is True then it goes on. In your case, the list is not a
vector (it is a list of lists), so that it returns False and stops right
there. You may use Trace to see what is going on internally. Evaluate

Trace[LocationReport[{2, 1, 3, 6}]]


Trace[LocationReport[{{2}, {1}, {3}, {6}}]]

Why does LocationReport has to check VectorQ on the list lst, but Mean
doesn't? A feature, I guess.

Tomas Garza
Mexico City
----- Original Message ----- 
From: "Gregory Lypny" <gregory.lypny at>
To: mathgroup at
Subject: [mg51376] [mg51335] Stats Pack and LocationReport

> Hello Everyone,
> Never know what I'm wrong...
> I loaded the stats pack as
> << Statistics`DescriptiveStatistics`
> I can compute various univariate statistics as
> Mean[Take[X, {t0, t1}, {6, 6}]]
> Median[Take[X, {t0, t1}, {6, 6}]]
> Variance[Take[X, {t0, t1}, {6, 6}]],
> where I am referring to a portion of one column of matrix X.
> But LocationReport[Take[X, {t0, t1}, {6, 6}]] and DisxpersionReport[.]
> do not work.  They simply return a listing of my data.  What am I doing
> wrong?
> Greg

  • Prev by Date: Re: histograms of identical distribution is different. maybe binnumber is the problem?
  • Next by Date: Re: Re: Very basic question: Zoom into a 2-D plot with the mouse
  • Previous by thread: Re: Stats Pack and LocationReport
  • Next by thread: One quesiton about Combinatorica