BookmarkSubscribeRSS Feed
knjohns0
Calcite | Level 5

I do not think I am coding for the right proc; I am trying to find the correlation of females who smoke and have moderate to high cholesterol. I can not figure out how to Isolate the females from the males?

 

proc glm data=sashelp.heart;
class cholesterol;
model smoking = cholesterol;
run;

 

proc univariate data=sashelp.heart plots;
class chol_status;
var smoking ;
run;


proc univariate data=sashelp.heart plots;
class smoking_status;
var cholesterol ;
run;

 

proc reg data=sashelp.heart plots(maxpoints=10000);
model cholesterol = smoking;
run;quit;

5 REPLIES 5
knjohns0
Calcite | Level 5

I do not think I am coding for the right proc; I am trying to find the correlation of females who smoke and have moderate to high cholesterol. I can not figure out how to Isolate the females from the males?

 

proc glm data=sashelp.heart;
class cholesterol;
model smoking = cholesterol;
run;

 

proc univariate data=sashelp.heart plots;
class chol_status;
var smoking ;
run;


proc univariate data=sashelp.heart plots;
class smoking_status;
var cholesterol ;
run;

 

proc reg data=sashelp.heart plots(maxpoints=10000);
model cholesterol = smoking;
run;quit;

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13
proc glm data=sashelp.heart;
class cholesterol;
model smoking = cholesterol;
where sex = 'Female';
run;
 
proc univariate data=sashelp.heart plots;
class chol_status;
var smoking ;
where sex = 'Female';
run;

proc univariate data=sashelp.heart plots;
class smoking_status;
var cholesterol ;
where sex = 'Female';
run;
 
proc reg data=sashelp.heart plots(maxpoints=10000);
model cholesterol = smoking;
Where sex = 'Female';
run;quit;

add  where sex = 'Female': 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

Try adding where sex = 'Female';

Reeza
Super User
FYI - I've updated your subject line. Please use a more relevant subject line in the future.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1845 views
  • 2 likes
  • 4 in conversation