|Date: ||Tue, 18 Mar 2008 11:39:03 -0500|
|Reply-To: ||Mary <email@example.com>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Mary <mlhoward@AVALON.NET>|
|Subject: ||Re: How to create several dummy variables at the same time?|
|Content-Type: ||text/plain; charset="iso-8859-1"|
Yes, it looks like you would specify which is the reference category by the Zero= option. So cool!!
----- Original Message -----
From: data _null_,
Sent: Tuesday, March 18, 2008 11:30 AM
Subject: Re: How to create several dummy variables at the same time?
I had to look up the option I think this is it, ZERO. See example
ZERO=FIRST | LAST | NONE | SUM
ZER=FIR | LAS | NON | SUM
ZERO='formatted-value ' <'formatted-value ' ...>
is used with CLASS variables. The default is ZERO=LAST.
The specification CLASS(variable / ZERO=FIRST) sets to missing the
dummy variable for the first of the sorted categories, implying a zero
coefficient for that category.
The specification CLASS(variable / ZERO=LAST) sets to missing the
dummy variable for the last of the sorted categories, implying a zero
coefficient for that category.
The specification CLASS(variable / ZERO='formatted-value') sets to
missing the dummy variable for the category with a formatted value
that matches 'formatted-value', implying a zero coefficient for that
category. With ZERO=formatted-value-list, the first formatted value
applies to the first variable in the specification, the second
formatted value applies to the next variable that was not previously
mentioned and so on. For example, CLASS(A A*B B B*C C / ZERO='x' 'y'
'z') specifies that the reference level for A is 'x', for B is 'y',
and for C is 'z'. With ZERO='formatted-value', the procedure first
looks for exact matches between the formatted values and the specified
value. If none are found, leading blanks are stripped from both and
the values are compared again. If zero or two or more matches are
found, warnings are issued.
Example with Transreg.
input Y X1 $ X2 $;
8 a a
7 a a
4 a b
3 a b
5 b a
4 b a
2 b b
1 b b
8 c a
7 c a
5 c b
2 c b
model class(X1 X2 / ZERO='a' 'a');
model class(X1 X2);
On Tue, Mar 18, 2008 at 10:30 AM, Mary <firstname.lastname@example.org> wrote:
> Data null,
> Micky already replied to this- the user is using PROC MIANALYZE which clearly labels the CLASS statement as experimental and does not allow reference coding; the user stated that they could not get the CLASS statement to work in MIANALYZE as expected (I've never run that particular procedure).
> Can GLMMOD or TRANSREG create indicator variables with reference coding? If so, could you give an example?
> ----- Original Message -----
> From: data _null_,
> To: SAS-L@LISTSERV.UGA.EDU
> Sent: Tuesday, March 18, 2008 8:52 AM
> Subject: Re: How to create several dummy variables at the same time?
> On Tue, Mar 18, 2008 at 8:44 AM, <email@example.com> wrote:
> > Hi Mickey,
> > I'm not sure if there's a better way to achieve what you're aiming
> > for,
> Yes it is called the CLASS statement. But if you insist on creating
> indicator variables PROC GLMMOD or PROC TRANSREG are better than any
> data step method.