- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
so am running a univariate analyses by putting each variable alone in the model.
the outcome is acet;
the dependent variable is sex (coded Men=1 and Women=2)
the independent variables are; csa (coded as 1 or 0) and age (coded which is numeric i.e. 18, 32, 56, 89, etc)
For example below; i tried putting only sex in the model but i keep getting error from the SAS log. please any help?
proc genmod data=avia88 desc;
class sex;
model acet=csa sex*csa/link=logit dist=binomial type3;
estimate "M:" csa csa*sex 1 -1 0 0/exp;
estimate "W:" oral_cs csa*sex 0 0 -1 1/exp;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
made a mistake in the first one.
This is it below:
proc genmod data=avia88 desc;
class sex;
model acet=sex csa sex*csa/link=logit dist=binomial type3;
estimate "M:" csa csa*sex 1 -1 0 0/exp;
estimate "W:" csa csa*sex 0 0 -1 1/exp;
run
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
And remember if you do put only a single variable in the model, the other steps, ESTIMATE statements, need to be adjusted accordingly.
One trick that helps to make sure you're doing this correctly is to comment your code with what what you think each line is doing. Then you can easily modify it as you go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. here is it.
proc genmod data=avia88 desc;
class sex;
model acet=sex csa sex*csa/link=logit dist=binomial type3;
estimate "M:" sex csa csa*sex 1 -1 0 0/exp;
estimate "W:" sex csa csa*sex 0 0 -1 1/exp;
run;
the independent variable is sex.
adjusting for csa (1,0), age(18, 23, 89 etc) etc...
but for now i want to do a univariable analyses with each variable one by one in the form of OR 95CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Univariate means one variable in the model statement.
You still have multiple variables.
@Mystik wrote:
Thank you. here is it.
proc genmod data=avia88 desc;
class sex;
model acet=sex csa sex*csa/link=logit dist=binomial type3;
estimate "M:" sex csa csa*sex 1 -1 0 0/exp;
estimate "W:" sex csa csa*sex 0 0 -1 1/exp;
run;
the independent variable is sex.
adjusting for csa (1,0), age(18, 23, 89 etc) etc...
but for now i want to do a univariable analyses with each variable one by one in the form of OR 95CI
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes i agreed univariate is one variable in the model but remember there is sex in there bcos i wanted to stratify by sex (male vs female) to create a table stratified by sex. As i said earlier, the dependent variable is sex and In this case you have to include sex.
Eventually, i got it all figured out as the problem was coming from the "estimate" side; e.g. -1 1 and -1 1 0 0 for males.
So the sas code below worked perfectly for me now.
proc genmod data=avia88 desc;
class sex csa;
model acet=sex csa sex*csa/link=logit dist=binomial type3;
estimate "M:" csa -1 1 csa*sex -1 1 0 0/exp;
estimate "W:" csa -1 1 csa*sex 0 0 -1 1/exp;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content