Statistical Median

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

I have data that are grouped by year and quarter. I
would
like to calculate a median value of a variable for each
year and quarter. I attempted to use the code on the
support website, but the openrecordset statement suggested
generates a "wrong number of arguments - expected 4" error
when executed.

So..I need help with two issues:

1. Is the median function suggested on the support site
the correct one to use for my purposes? If not, where can
I find the correct one or make modifications to produce a
median for each year and quarter in my dataseet?
2. Why doesn't it work?
 
If you'll repost the code you have here I'll look at it.

Lance
 
but the openrecordset statement suggested
generates a "wrong number of arguments - expected 4" error
when executed.

This nearly always means a misspelled field name somewhere: check it all
letter-by-letter.

But, as Lance says, you'll have to post the code for us to know what you
are referring to.

I usually use vba/dao to derive median values, but it should be possible to
do it with some pretty horrendous SQL...


Tim F
 
Doug:

Stop by our web and in the Code and design tips area, under queries there is
some pretty compact code to allow you to caculate medians and percentiles.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top