MathGroup Archive 2009

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

Search the Archive

Aggregating data and graphing it

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101920] Aggregating data and graphing it
  • From: Parita <parita.patel at gmail.com>
  • Date: Thu, 23 Jul 2009 03:54:27 -0400 (EDT)

Hi

I am looking for a function that works similar to group by in SQL. I
have a data set with 3 columns (Metric1, Metric2, Height). This data
set can have multiple values of height by metric1 and metric2. I would
like to do the following
1) Sum height by metric1 and metric2. Generate a 3D histogram plot
with metric1 and metric2 on x and y axis and the summed up height on z axis
2) Sum height by metric1. Generate a histogram plot with metric1 on x
axis and summed up height on y axis

I am able to generate histograms or 3D histograms which counts the
instances of duplicates. However, I am not sure how to generate
histograms after summing the data

Following code counts the instances of duplicates by metric1 and
metric2 and generates a 3D histogram plot with metric1 and metric2 on
x and y axis and the count of height on z axis

data ={{10,1}, {20,5}, {30,7}, {10,1}, {20,7}, {10,1}, {20,7}, {30,7},
{40,5}, {10,1}};
Histogram3D[data]

Following is the data set that can be used to implement tasks 1 and 2
above
data ={{10,1,120}, {20,5,100}, {30,7,20}, {10,1,130}, {20,7,134},
{10,1,23}, {20,7,68}, {30,7,230}, {40,5,235}, {10,1,125}};

Thanks for your help


  • Prev by Date: Re: patterns
  • Next by Date: Re: Linking Manipulate to arrow keys?
  • Previous by thread: Re: documentation bug?
  • Next by thread: Re: Aggregating data and graphing it