BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
serveoverice
Calcite | Level 5

I have a dataset (1.2 million records) and I am wanting to assign a score of 1 to 10 to each record depending on the position in a list. I'm sure this is quite simple to do but I am new to SAS and I can't find anything on the forums. I'm guessing I need to rank the dataset first but then I'm not sure where to go from there. Any help would be gratefully received.

1 ACCEPTED SOLUTION

Accepted Solutions
stat_sas
Ammonite | Level 13

Seems like you are trying to calculate lift based on a model. Try the following code that will split data into 10 groups based on descending values of Response_score variable. 

 

 

proc rank data=have groups=10 descending out=ranked;
var Response_score;
ranks decile;
run;

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

Some sample input and desired output helps you describe your issue.

Especially describe the concept of a position in a list.

Data never sleeps
serveoverice
Calcite | Level 5

Thanks Linus. The file is a response file. Each line has a propensity score and I am trying to see the response rate by decile. For example:

 

Person_Key | Response Score | Responded

1 | 900 | 1

2 | 600 | 0

3 | 750 | 0...

 

I want to split the volume into 10 equal segments so I can see if I can refine the model to go deeper into marginal segments.

 

Does that help?

stat_sas
Ammonite | Level 13

Seems like you are trying to calculate lift based on a model. Try the following code that will split data into 10 groups based on descending values of Response_score variable. 

 

 

proc rank data=have groups=10 descending out=ranked;
var Response_score;
ranks decile;
run;

serveoverice
Calcite | Level 5

That's correct. Thank you very much stat_sas.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 66703 views
  • 2 likes
  • 3 in conversation