×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Statistics - Two dimensional frequency analysis

Statistics - Two dimensional frequency analysis

Statistics - Two dimensional frequency analysis

(OP)
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

RE: Statistics - Two dimensional frequency analysis

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).

RE: Statistics - Two dimensional frequency analysis

(OP)
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

RE: Statistics - Two dimensional frequency analysis

Hmm.  I must not understand the problem.  Glad to hear you got it done.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources