Discussion:
use of class statement in proc logistic
(too old to reply)
n
2008-10-14 13:08:35 UTC
Permalink
hi all;

i am using the proc logistic in my work but am a bit confused about
what exactly the 'class' statement means.

it does not give any separate analysis for the class variables.

could you please tell me the function of the class statement?

thanks and regards

Nikhil
Swank, Paul R
2008-10-14 16:13:16 UTC
Permalink
The class statement automatically recodes classification variables as
indicators so they can be included in the analysis. It does not direct
the program to do the analysis separately for each level. Use the "by"
statement for that.

Paul R. Swank, Ph.D
Professor and Director of Research
Children's Learning Institute
University of Texas Health Science Center
Houston, TX 77038


-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of n
Sent: Tuesday, October 14, 2008 8:09 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: use of class statement in proc logistic

hi all;

i am using the proc logistic in my work but am a bit confused about
what exactly the 'class' statement means.

it does not give any separate analysis for the class variables.

could you please tell me the function of the class statement?

thanks and regards

Nikhil
Mary
2008-10-14 21:37:55 UTC
Permalink
Nikhil,

What a class statement is doing is forming "dummy" variables to use in the
model. For instance, the logistic regression coding:

proc logistic data=set1;
class sex(param=ref ref='M');
model disease=sex var1 var2;
run;

Would form one dummy variable for sex with values 0 for Male (because it was
the reference variable), and 1 for Female. If you have more than two
values, it would form one less dummy variable than you have values (i.e.,
two for 3 categories). It is probably a good idea to use reference coding
to start as I'm doing above, as effect coding is different in the way it
codes dummy variables and that can get confusing!

So, the class statement in logistic regression identifies the categorical
variables rather than doing a separate analysis (use the by statement for
that). When I started we had to code all our dummy variables in the data
step, so the introduction of the class statement was a big help!

-Mary
----- Original Message -----
From: n
To: SAS-***@LISTSERV.UGA.EDU
Sent: Tuesday, October 14, 2008 8:08 AM
Subject: use of class statement in proc logistic


hi all;

i am using the proc logistic in my work but am a bit confused about
what exactly the 'class' statement means.

it does not give any separate analysis for the class variables.

could you please tell me the function of the class statement?

thanks and regards

Nikhil
Mary
2008-10-16 15:19:57 UTC
Permalink
Paul,

"param=3D" specifies the parameterizion method for the classification =
variable. The default is param=3Deffect, but effect coding creates a =
different number of dummy variables (the same as the number of =
classifications), and different values (it includes -1 in addition to 1 =
and 0) than reference coding does. =20

Peter Flom recommends using reference coding; I do find it is easier to =
interpret the odds ratios by using it; thus param=3Dref specifies to =
create the dummy variables using reference coding, which is similary to =
how I learned to do them originally when we had to do them in the data =
step (uses 1 and 0, with 1 less dummy variable created than there are =
categories).

-Mary
----- Original Message -----=20
From: paul wilson=20
To: Mary=20
Sent: Wednesday, October 15, 2008 7:29 PM
Subject: Re: use of class statement in proc logistic


Hi Mary,

What does "param=3Dref" in your code do?
I Inderstand ref=3D'M' part but no clue what "parm" code does and if =
it's necessary.
...and yeah, you're absolutely right, I'd much rather learn how to do =
it this way then code dummies manually :)

Also, would you be able to provide an example of "by" code in proc =
logistic and explain what it does?

Thanks a lot!



----- Original Message ----
From: Mary <***@AVALON.NET>
To: SAS-***@LISTSERV.UGA.EDU
Sent: Tuesday, October 14, 2008 5:37:55 PM
Subject: Re: use of class statement in proc logistic

Nikhil,

What a class statement is doing is forming "dummy" variables to use in =
the
model. For instance, the logistic regression coding:

proc logistic data=3Dset1;
class sex(param=3Dref ref=3D'M');
model disease=3Dsex var1 var2;
run;

Would form one dummy variable for sex with values 0 for Male (because =
it was
the reference variable), and 1 for Female. If you have more than two
values, it would form one less dummy variable than you have values =
(i.e.,
two for 3 categories). It is probably a good idea to use reference =
coding
to start as I'm doing above, as effect coding is different in the way =
it
codes dummy variables and that can get confusing!

So, the class statement in logistic regression identifies the =
categorical
variables rather than doing a separate analysis (use the by statement =
for
that). When I started we had to code all our dummy variables in the =
data
step, so the introduction of the class statement was a big help!

-Mary
----- Original Message -----
From: n
To: SAS-***@LISTSERV.UGA.EDU
Sent: Tuesday, October 14, 2008 8:08 AM
Subject: use of class statement in proc logistic


hi all;

i am using the proc logistic in my work but am a bit confused about
what exactly the 'class' statement means.

it does not give any separate analysis for the class variables.

could you please tell me the function of the class statement?

thanks and regards

Nikhil

Loading...