I'm working on a program where I have a number of countries and a number of variables. For some variables for some countries the data is missing or unreported.
What I'd like to do (and am not sure how to program in Eviews) would be to include in the program coding is language that does the following :
-For countries with data available for variable X calculate the value of X for the 10th, 40th, 60th and 90th percentile
-Then based on a previously developed category scale, for countries where data for variable X is missing, assign one of the percentile variables in it place.
For example:
Zim = Category 1 (so want to assign the 10th percentile) value for variable X calculated from all other countries who have data present for variable X.
Thanks for any help on this.
Calculating and assigning percentiles as values
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Calculating and assigning percentiles as values
Since there hasn't been a reply, I'm wondering if I could break this down a bit:
-Are there any commands in programming that allow you to calculate percetile values within a group?
-Are there any commands in programming that allow you to calculate percetile values within a group?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Calculating and assigning percentiles as values
For percentiles by subgroup, try @quantilesby.
Re: Calculating and assigning percentiles as values
Thanks for the suggestion!For percentiles by subgroup, try @quantilesby.
I've never used that coding before, so how would I set up the arguments? Reading the help file I think it would be something like below, is that correct? Is it possible to name the @quantilesby result?
Code: Select all
@quantilesby(GDP,Group_A, 0.1)
Re: Calculating and assigning percentiles as values
I'm wondering if anyone can confirm for the the proper arguments to include in the @quantilesby command.
If I want to calculate the 10th percentile for the GDP variable of a group of countries should the command language be:
If I want to calculate the 10th percentile for the GDP variable of a group of countries should the command language be:
Code: Select all
@quantilesby(GDP,Group_A, 0.1)
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Calculating and assigning percentiles as values
Thanks for that. My issues is that I'm still having trouble programming to get the result. I'm getting errors about the arguments used. Maybe I'll re-explain how I've got the file set up in case I've done something wrong.
As an example of the data I have, I've uploaded this file ().
In reality I've got data for about 150 countries that I'm looking at.
What I want to figure out how to program is to take the individual GDP series and then after adding them into a group, is to program the way to calculate the percentiles for given years. So, looking at the example file say I want to add the series into a group (X) and then find the 80th percentile for that group. When I've tried doing this using the @quantilesby command I'm getting errors and not the result I'm looking for.
If the way I'm looking to do this isn't possible, what might be a better approach?
As an example of the data I have, I've uploaded this file ().
In reality I've got data for about 150 countries that I'm looking at.
What I want to figure out how to program is to take the individual GDP series and then after adding them into a group, is to program the way to calculate the percentiles for given years. So, looking at the example file say I want to add the series into a group (X) and then find the 80th percentile for that group. When I've tried doing this using the @quantilesby command I'm getting errors and not the result I'm looking for.
If the way I'm looking to do this isn't possible, what might be a better approach?
Who is online
Users browsing this forum: No registered users and 2 guests
