BookmarkSubscribeRSS Feed
Manije72
Calcite | Level 5

Hi 

I would appreciate it if you could answer my question quickly.

I want to see the dietary iron among case (patient) and control (healthy). The variable for disease is risk factor. I want to adjust sex, alcohol (yes/no), drug (yes/no), and BMI. Is this the correct code?

proc glm data=SS;

   class risk factor sex alcohol drugs;

   model Iron= risk factor sex alcohol drugs BMI_A / solution;

   lsmeans risk factor/ stderr pdiff cov out=adjmeans;

run;

4 REPLIES 4
PaigeMiller
Diamond | Level 26

@Manije72 wrote:

Hi 

I would appreciate it if you could answer my question quickly.

I want to see the dietary iron among case (patient) and control (healthy). The variable for disease is risk factor. I want to adjust sex, alcohol (yes/no), drug (yes/no), and BMI. Is this the correct code?

proc glm data=SS;

   class risk factor sex alcohol drugs;

   model Iron= risk factor sex alcohol drugs BMI_A / solution;

   lsmeans risk factor/ stderr pdiff cov out=adjmeans;

run;


If you want to compare the dietary iron between case and control, this is a categorical variable which I do not see in your model.

 

Also "risk factor" is not a valid variable name in SAS, so it can't be used like that (although risk_factor is a valid variable name).

--
Paige Miller
Manije72
Calcite | Level 5

Hi 

Thank you for your response.

I named "patients/healthy) as "risk factor" in my data. It has 0(healthy) and 1(patients) code.

Manije72
Calcite | Level 5

Hi,

Thank you for your response.

I named case/control group "risk_factor" in my data. It has 0(control) and 1(case) codes. 

I used "risk_factor" in SAS.

PaigeMiller
Diamond | Level 26

When you have a variable name in your data such as risk_factor, please use that variable name in your text as well, possibly with other descriptions. Do not make us guess what variable you are referring to.

 

With that understanding, your code looks reasonable to me.

--
Paige Miller

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!

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
  • 4 replies
  • 608 views
  • 0 likes
  • 2 in conversation