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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 346 views
  • 0 likes
  • 2 in conversation