Page 1 of 1

About Calculating Quintiles

Posted: Mon Mar 19, 2012 2:12 am
by kinon902003
I am writing programmes to calculate quintiles for a matrix. I found that @quantile maybe useful.

May I confirm that the following command can calculate 20% quintile with the name "quintile_1"?

Code: Select all

scalar quintile_1 = @quantile(xxx, 0.2)
xxx is the name of the matrix

I am not sure what I have done is correct because the answer is not the same when I calculate it in Excel by the function "percentile".

Thank you very much for your help!

Re: About Calculating Quintiles

Posted: Mon Mar 19, 2012 7:50 am
by EViews Gareth
Yes, that's right, although note that the quantile will be calculated over every element in the matrix, not just the first column or row (as is the case with some other programs).

Re: About Calculating Quintiles

Posted: Mon Mar 19, 2012 10:46 am
by EViews Glenn
Note also that there are various options for defining the computation of the quantiles. The default may not line up with what Excel does, but there may be an option that will do so.

Re: About Calculating Quintiles

Posted: Mon Mar 19, 2012 8:49 pm
by kinon902003
Note also that there are various options for defining the computation of the quantiles. The default may not line up with what Excel does, but there may be an option that will do so.
Thank you so much for your confirmation.