Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statistics - Two dimensional frequency analysis

Status
Not open for further replies.

GregLocock

Automotive
Apr 10, 2001
23,800
I have 250000 samples of data, in 2 dimensions (ie x,y). I need to plot the frequency distribution in two dimensions, ie split the xy plane up into little squares and count the number of points in each square. I have no problem plotting that, I just can't find a way of easily generating the 2 dimensional histogram.

This must be a common problem, yet Minitab, Scilab and R do not do it easily, that I can find. I can do it in Excel, but run into problems with the number of points, and it is messy anyway.

Is there a free program available for this? Failing that, what is the proper term for this sort of analysis? Another option would be to use Matlab if you know of a script. Cheers

Greg Locock
 
Replies continue below

Recommended for you

I would guess that the name for such a thing would be "discretization" or population density analysis, or something along those lines. I'd bet that there are GIS tools that can handle this sort of info. How about the excel "map" features (never used them)?

How many boxes are you splitting the data into? Is it in a text file? A VBA routine in excel would be easy enough to write, and it wouldn't require holding all the data simultaneously within a spreadsheet (although if you have few enough boxes, the spreadsheet might be a good place for the output).

 
Turns out it is a four liner in MathCad!

"You can read ASCII data separated with spaces into a two column vector,
V, of
x,y pairs, (250000 of them) then create, say, a 100 by 100 matrix by
saying
V:=READPRN(data)
i:=0;rows(V)
M sub 100,100 := 0

This will initialize all elements to 0 automatically.

M sub ( V sub 0,i, V sub 1,i) = M sub ( V sub 0,i,V sub1,i)+ 1"


Sneaky!

Excel bombs out if you try and fully populate a worksheet, as my solution needed to.

Cheers

Greg Locock
 
Hmm. I must not understand the problem. Glad to hear you got it done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor