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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1972 views
  • 0 likes
  • 2 in conversation