BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Geo-
Quartz | Level 8

How to understand weight variable here?what is it for?redm_flag=0 means negative samples.

 

proc surveyselect  data=lg.develop_original(where=( redm_flag =0)) noprint
method=srs rate=0.1  out=lg.develop_sury ;
run;
data lg.develop_final;
set lg.develop_ original(where=( redm_flag =1)) lg.develop_sury;
if redm_flag=1 then weight=1;
else weight=10;
run;
proc freq data= lg.develop_final;
weight weight;
table redm_flag/missing;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The first proceu\dure extracts 1/10th of the observations where redm_flag=0. Each observation gets a weight of 10 to indicate that it represents 10 observations.

 

The DATA step merges that sample with all observations where redm_flag=1. Those observations get a weight of 1 to indicate that they represent 1 obs.

 

The PROC FREQ step estimates the proportions from the weighted sample. 

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

The first proceu\dure extracts 1/10th of the observations where redm_flag=0. Each observation gets a weight of 10 to indicate that it represents 10 observations.

 

The DATA step merges that sample with all observations where redm_flag=1. Those observations get a weight of 1 to indicate that they represent 1 obs.

 

The PROC FREQ step estimates the proportions from the weighted sample. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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