Programming the statistical procedures from SAS

glm procedure

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

glm procedure

hello,

i am doing a glm procedure to determine the factors exposure on fetal growth. ( pesticides, season )

i have to adjust it with sex and diabetes (for example). ( i have make dummy variables for qualitatives variables and put it on class statement)

i don't know the right procedure :

is it

proc glm data = work;

class diabetes;

model weightnewborn = pesticides * sex*diabetes  season*sex*diabetes;

run;

OR

proc glm data = work;

class diabetes;

model weightnewborn = pesticides * season*sex*diabetes 

run;

 ?

thank you for your response


Accepted Solutions
Solution
‎02-24-2016 10:08 AM
SAS Super FREQ
Posts: 3,547

Re: glm procedure

Yes, that is correct. "Adjusting for a variable" or "controlling for a variable" means that those effects are in the model, even if they are not the primary quantity that you are investigating.

View solution in original post


All Replies
SAS Super FREQ
Posts: 3,547

Re: glm procedure

Both sex and diabetes are categorical, so both go on the CLASS statement:

CLASS Sex Diabetes;

 

If you want a model that uses only the main effects, use

MODEL weightnewborn = pesticides  season sex diabetes;

 

If you believe that there are interactions between the explanatory variables, then use the "*" operator to specify the interaction effects. For example,

MODEL weightnewborn = pesticides  season sex diabetes  sex*diabetes;

is a model that assumes that the birth weights depend on whether the females also have diabetes (or diabetic mothers?).

Occasional Contributor
Posts: 5

Re: glm procedure

thank you, so we mix exposition factors and confusion factors ?

SAS Super FREQ
Posts: 3,547

Re: glm procedure

There is a nice section of the GLM documentation that discusses how to specify effects by using the SAS "stars and bars" notation.

 

I've told you how to specify the syntax, but deciding on the correct model is more difficult because it involves the data. Many analysts start by fitting a main-effect model and then use graphical disgnostic plots and statistical techniques to investigate whether that initial model is sufficient, or whether the data support a more complex model.

Occasional Contributor
Posts: 5

Re: glm procedure

I read the documentation, so if i want to adjust a multiple regression on the sex, i have to put them on the model like others variables ?

Solution
‎02-24-2016 10:08 AM
SAS Super FREQ
Posts: 3,547

Re: glm procedure

Yes, that is correct. "Adjusting for a variable" or "controlling for a variable" means that those effects are in the model, even if they are not the primary quantity that you are investigating.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 368 views
  • 0 likes
  • 2 in conversation