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

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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