In: Economics
This is an Economics Question
When using the SAS software for Economic calculations, write the code for 80th percentile for a data named Battle
Here, I am assuming 'Battle' is the name of the dataset and 'Battle_var' is the variable in Battle dataset for which we are required to calculate the 80th percentile. 'Battle_perc' is the output dataset or table that is created. 'Battle_var_80' is the table heading that will be shown in the Battle_perc table and will have the 80th percentile value.
In SAS, first we will have to write the data step to load the data in Work. Then using proc UNIVARIATE, we can find out the 80th percentile for the required variable. Finally, using proc print, we can print the output table.
Note: PCTLPTS will be assigned the pecentile that we want to compute.
This is shown in the following code:
/* Loading dataset */
data Battle;
set Battle;
run;
/* Computing 80th percentile for Battle_var */
proc univariate data=Battle noprint;
var Battle_var;
output out=Battle_Perc PCTLPTS=80 PCTLPRE=Battle_var_80;
run;
/* Printing the table with 80th percentile computed for Battle_var in Battle dataset */
proc print data=Battle_perc; run;