Go Back   Rhinocerus > Newsgroup > Newsgroup comp.soft-sys.sas

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2005, 03:39 PM
Howells, William
Guest
 
Posts: n/a
Default FW: [SAS us6299825] PROC MIXED: specifying class variable changes

SAS Tech Support came through with a really nice explanation for how
specifying dummy variables in the CLASS statement changes results in a
GLM model (or MIXED), thought I would share. Bill H.


-----Original Message-----
From: SAS Technical Support [mailto:support@sas.com]
Sent: Tuesday, October 25, 2005 12:30 PM
To: Howells, William
Subject: [SAS us6299825] PROC MIXED: specifying class variable changes
intercept

<=== Page: 1 === SAS Consultant === emailed w/answer === 25Oct2005
12:24:44 ===>

Bill,

When you change the parameterization of the X matrix for your model,
that will change the interpretation of the f-statistics and of the
parameter estimates in your model. The overall models are comparable,
but the tests you get are different.

Let's look at a simpler verion. The issue here is not with the RANDOM
and REPEATED statements. The issue concerns only the CLASS and MODEL
statements.

The DATA step here

data test;
do a=0 to 1;
do rep=1 to 10;
x=rannor(123);
y=3 + a + x + rannor(123);
output;
end;
end;
run;

proc print data=test;
run;

simulates data for a simple ANOVA model with a covariate. Effect A
takes on two levels (0 and 1) and X is a covariate in the model.

You can approach the model in two ways. We recommend using the CLASS
statement since its use makes the tests and parameter estimates more
useful. The two models are

proc mixed data=test;
class a;
model y=a x a*x / s;
run;

proc mixed data=test;
model y=a x a*x/ s;
run;

In the first model, you get

Solution for Fixed Effects

Standard
Effect a Estimate Error DF t Value Pr > |t|

Intercept 3.5448 0.4011 16 8.84 <.0001
a 0 -0.7768 0.5660 16 -1.37 0.1888
a 1 0 . . . .
x 1.6497 0.6911 16 2.39 0.0297
x*a 0 -0.9564 0.8717 16 -1.10 0.2888
x*a 1 0 . . . .


Type 3 Tests of Fixed Effects

Num Den
Effect DF DF F Value Pr > F

a 1 16 1.88 0.1888
x 1 16 7.22 0.0162
x*a 1 16 1.20 0.2888


The second model gives

Solution for Fixed Effects

Standard
Effect Estimate Error DF t Value Pr > |t|

Intercept 2.7680 0.3994 16 6.93 <.0001
a 0.7768 0.5660 16 1.37 0.1888
x 0.6933 0.5313 16 1.30 0.2104
a*x 0.9564 0.8717 16 1.10 0.2888


Type 3 Tests of Fixed Effects

Num Den
Effect DF DF F Value Pr > F

a 1 16 1.88 0.1888
x 1 16 1.70 0.2104
a*x 1 16 1.20 0.2888


You will notice the same kinds of differences in these two models
results as in your models results.

The f-tests on both A and A*X are the same in both models. The test on
X is different though.
The parameter estimates are different in these models as well, though by
examining them you can tell how they are related.

In the first model with the CLASS statement, the parameter estimate for
the intercept is actually the intercept for the 2nd level of the A
effect. The parameter estimate for the 1st level of A is the difference
in the intercepts for the 2 levels of the A effect. So the estimate for
the first level of A is 3.5448 - .7768 = 2.7680. The 2nd model gives
this value as the value of the intercept. Without A on the CLASS
statement, the parameter estimate of the model intercept is the
intercept for the first level of A. The parameter estimate for A itself
is the slope on A. Since A is 0,1 then the parameter estimate for the
"intercept" on the 2nd level of A is 2.7680 + 1*.7768 = 3.5448, which is
the same as from the first model.

You can interpet the slopes on X in a similar fashion.

Getting back to the f-tests, you can add the /E3 option to see the
hypothesis tested in each model. In the model with the CLASS statement,
the hypothesis on X is that the average slope across the two levels of A
is different from 0. The test in the 2nd model is that the slope on X
for the first level of A is different from 0.

Changing the parameterization of the design matrix for the fixed effects
changes the interpretation of all of these statistics.

<br/>The materials in this message are private and may contain Protected Healthcare Information. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PROC FREQ--DATA STEP--MODELING QUESTION Gerstle, John Newsgroup comp.soft-sys.sas 0 06-06-2007 07:47 PM
Re: Class dicotomous variable in Proc mixed Dale McLerran Newsgroup comp.soft-sys.sas 0 05-23-2005 09:02 PM
Re: Number of Records Dunn, Toby Newsgroup comp.soft-sys.sas 0 10-29-2004 08:35 PM
Re: Number of Records Pardee, Roy Newsgroup comp.soft-sys.sas 0 10-29-2004 08:31 PM
Number of Records Mathew Chandler Newsgroup comp.soft-sys.sas 0 10-29-2004 08:05 PM



All times are GMT. The time now is 05:21 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.