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.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 1630 views
  • 2 likes
  • 4 in conversation