Programming the statistical procedures from SAS

Top_N Report is Brokeded! :(

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Top_N Report is Brokeded! :(

Hi all,

 

So, I'm trying to use the coding for the Top_N Report located at this link:

 

http://support.sas.com/kb/33/009.html

 

These are the tips stated in the comments at the beginning of the program:

 

/*************************************************/

/* TOPNCATEGORIES.SAS */

/* Top N report for data across categories */

/* Use macro variables to customize the data */

/* source. */

/* DATA - SAS library.member for input data */

/* REPORT - column to report on */

/* MEASURE - column to measure for the report */

/* MEASUREFORMAT - specify to preserve measure */

/* format in the report (currency, for example) */

/* STAT - SUM or MEAN */

/* N - The "N" in Top N - how many to show */

 /* CATEGORY - across which category? *

/*************************************************/

 

 

In the example on the SAS Support page,

report = Model (of car)

measure = MPG_City

category = Origin

Producing a Top_N Report of

 

Top Models by MPG_City for each region of Origin.

 

In my data, I have three variables

Location

Happiness

Confidence

 

Which of these are the measure, category and report variables? I am assuming that category = location but what about my other two variables? My variables are independent variables. What I would like is a table ranking the Top 10 scores of Happiness and Confidence by Location.


Accepted Solutions
Solution
4 weeks ago
Super User
Posts: 23,700

Re: Top_N Report is Brokeded! :(

How is the code broken? 

What is not working? What code did you actually use - there are 4 programs in that link. 

 

It sounds like you have one category and two measures so you would call it twice, once for each measure. If you want a top 10 based on both you would need a different algorithm. 

You can also try PROC RANK. 

 


@steva wrote:

Hi all,

 

So, I'm trying to use the coding for the Top_N Report located at this link:

 

http://support.sas.com/kb/33/009.html

 

These are the tips stated in the comments at the beginning of the program:

 

/*************************************************/

/* TOPNCATEGORIES.SAS */

/* Top N report for data across categories */

/* Use macro variables to customize the data */

/* source. */

/* DATA - SAS library.member for input data */

/* REPORT - column to report on */

/* MEASURE - column to measure for the report */

/* MEASUREFORMAT - specify to preserve measure */

/* format in the report (currency, for example) */

/* STAT - SUM or MEAN */

/* N - The "N" in Top N - how many to show */

 /* CATEGORY - across which category? *

/*************************************************/

 

 

In the example on the SAS Support page,

report = Model (of car)

measure = MPG_City

category = Origin

Producing a Top_N Report of

 

Top Models by MPG_City for each region of Origin.

 

In my data, I have three variables

Location

Happiness

Confidence

 

Which of these are the measure, category and report variables? I am assuming that category = location but what about my other two variables? My variables are independent variables. What I would like is a table ranking the Top 10 scores of Happiness and Confidence by Location.


 

 

 

View solution in original post


All Replies
Solution
4 weeks ago
Super User
Posts: 23,700

Re: Top_N Report is Brokeded! :(

How is the code broken? 

What is not working? What code did you actually use - there are 4 programs in that link. 

 

It sounds like you have one category and two measures so you would call it twice, once for each measure. If you want a top 10 based on both you would need a different algorithm. 

You can also try PROC RANK. 

 


@steva wrote:

Hi all,

 

So, I'm trying to use the coding for the Top_N Report located at this link:

 

http://support.sas.com/kb/33/009.html

 

These are the tips stated in the comments at the beginning of the program:

 

/*************************************************/

/* TOPNCATEGORIES.SAS */

/* Top N report for data across categories */

/* Use macro variables to customize the data */

/* source. */

/* DATA - SAS library.member for input data */

/* REPORT - column to report on */

/* MEASURE - column to measure for the report */

/* MEASUREFORMAT - specify to preserve measure */

/* format in the report (currency, for example) */

/* STAT - SUM or MEAN */

/* N - The "N" in Top N - how many to show */

 /* CATEGORY - across which category? *

/*************************************************/

 

 

In the example on the SAS Support page,

report = Model (of car)

measure = MPG_City

category = Origin

Producing a Top_N Report of

 

Top Models by MPG_City for each region of Origin.

 

In my data, I have three variables

Location

Happiness

Confidence

 

Which of these are the measure, category and report variables? I am assuming that category = location but what about my other two variables? My variables are independent variables. What I would like is a table ranking the Top 10 scores of Happiness and Confidence by Location.


 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 95 views
  • 0 likes
  • 2 in conversation