regent Posted March 28, 2007 Share Posted March 28, 2007 Anybody know how to calculate quartiles? Thanks. Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 28, 2007 Share Posted March 28, 2007 Yes. http://en.wikipedia.org/wiki/Quartile Assuming this is a question and not a poll, why don't you define your real problem. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted March 28, 2007 Share Posted March 28, 2007 I suspect you is going to have to roll your own... there are snippets out there on things like standard deviation and other statistical techniques so get looking... and rolling! Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 28, 2007 Share Posted March 28, 2007 I took the example provided here: http://www.vias.org/tmdatanaleng/cc_quartile.html You could easily turn this into a function.... $values = array(-20, -4, -1, -1, 0, 1, 2, 3, 4, 4, 7, 7, 8, 11, 11, 12, 12, 15, 18, 22); $count = count($values); $first = round( .25 * ( $count + 1 ) ) - 1; $second = ($count % 2 == 0) ? ($values[($count / 2) - 1] + $values[$count / 2]) / 2 : $second = $values[($count + 1) / 2]; $third = round( .75 * ( $count + 1 ) ) - 1; echo "<pre>" . print_r($values, true) . " first = $first<br /> values[first] = $values[$first]<br /> <br /> second = $second<br /> <br /> third = $third<br /> values[third] = $values[$third]"; Quote Link to comment Share on other sites More sharing options...
regent Posted March 28, 2007 Author Share Posted March 28, 2007 Thank you, hitman6003. That's exactly what I was looking for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.