BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6
Hello everyone,

I am using ranuni( ) to split my input file 50/50 into two letter_types: hybrid letter & example letter. Then I use a field called 'LTV' to calculate the offer_pct for the output.

In the output, I want the 'hybrid' letter_type to have one more offer_pct (0%) than the 'example' letter_type. When I use ranuni( ) this causes the 'hybrid' letter_type to have more than 50% of the original population.

How can I have one more 'offer_pct' entry in the 'hybrid' letter_type and still maintain a 50/50 split between the two letter_types?


This is how I want the output distribution to look:

offer_pct letter_type
0% NonResponder hybrid letter
4% NonResponder hybrid letter
8% NonResponder hybrid letter
18% NonResponder hybrid letter
4% NonResponder Example letter
8% NonResponder Example letter
18% NonResponder Example letter

Here is my code:

r1 = ranuni(1234);
if ltv >= 120 then offer_pct='4%';
else if 110 <= ltv < 120 then offer_pct='8%';
else if 95 <= ltv < 110 then offer_pct='18%';
else offer_pct = '0%';

if r1 < .5 then letter_type = 'hybrid';
else if r1 >= .5 then letter_type = 'example';
1 REPLY 1
KevinC_
Fluorite | Level 6
I have resolved this issue.
Thanks.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 646 views
  • 0 likes
  • 1 in conversation