Re: Binning a dependent variable
- To: mathgroup at smc.vnet.net
- Subject: [mg111987] Re: Binning a dependent variable
- From: Themis Matsoukas <tmatsoukas at me.com>
- Date: Mon, 23 Aug 2010 02:39:37 -0400 (EDT)
In addition to the solutions posted previously, you may also want to take a look at MovingAverage. If your x points are equidistant and each xi appears only once, then running MovingAverage[yourlist, n] on your list will give you the average x in the interval (xi, xi+(n-1)*deltax), i=1, ..., and the corresponding average of y in that interval: data = { {30, 0.0019}, {31, 0.0024}, {32, 0.0026}, {33, 0.0030}, {34, 0.0034} }; MovingAverage[data, 3] {{31, 0.0023}, {32, 0.00266667}, {33, 0.003}} This produces results in overlapping intervals, which you may or may not want. Themis