[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: CLASS statement in Proc Logistic
From:       John Hendrickx <john2.hendrickx () GMAIL ! COM>
Date:       2016-08-30 8:09:48
Message-ID: CADNaYtRhcFpDfy0q_70VZtH_b1EdqpthjRd_yrxNTku_E9hoKA () mail ! gmail ! com
[Download RAW message or body]

If you don't use the class statement then you're estimating age as an
interval level variable with values 1, 2, 3. It's interesting that age has
a significant effect when modelled this way, this wouldn't necessarily be
the case. If the predicted logit is e.g. higher for middle age, lower for
young and old, then you might not find an effect of age modelled this way,
although age does affect your dependent variable.

It's also surprising that the type3 estimate for age as a class variable is
not statistically significant whereas a linear effect of age is. One reason
could be that the type3 estimate is a Wald statistic. This is quicker to
calculate but can be a bit less than the likelihood ratio chi-square. You
could check this by estimating a model with and without age as a class
variable. Calculate the likelihood ratio as the difference in -2 log
likelihood values of the two models with 2df. You can calculate the p-value
as "1 - probchi(diffminus2ll, 2)". Perhaps there's an option to get these
LR values rather than Wald statistics but I can't find it just now.

Another possibility is that a linear effect of age with 1 df just has a
better fit than an effect of age as a class variable with 2df. If the
effect of the three categories of age is linear, then estimating the extra
df doesn't improve the fit but does delete your type 3 statistic.

Good luck,
John Hendrickx

2016-08-30 2:28 GMT+02:00 Laughing Beggar <Laughing_Beggar@hotmail.com>:

> Hi all,
>
> I'm predicting a binary variable (Adequate Physical Activity/Inadequate)
> from 2 binary variables (Sex (M/F) and location (A/B)) and a variable with
> 3 levels (age (Young, middle, old)).
>
> The 3 level variable is ordinal.
>
> Without a CLASS statement, age is significant (using Analysis of MLE).
>
> This looked interesting so I added a CLASS statement to pull the 3 levels
> of age apart.
>
> With a CLASS statement, age is only significant for one comparison within
> its levels, but not the other (Using MLE) - fair enough.
>
> BUT age is not significant Using Type3.
>
> What is the effect of using a CLASS statement with the Age variable, and
> why is there a difference between MLE and Type3 Estimates.?
>
> Thanks
>
> L_B
>
>
> "The beggar laughs in the face of the thief"
>

[Attachment #3 (text/html)]

<div dir="ltr"><div><div><div><div>If you don&#39;t use the class statement then \
you&#39;re estimating age as an interval level variable with values 1, 2, 3. It&#39;s \
interesting that age has a significant effect when modelled this way, this \
wouldn&#39;t necessarily be the case. If the predicted logit is e.g. higher for \
middle age, lower for young and old, then you might not find an effect of age \
modelled this way, although age does affect your dependent \
variable.<br><br></div>It&#39;s also surprising that the type3 estimate for age as a \
class variable is not statistically significant whereas a linear effect of age is. \
One reason could be that the type3 estimate is a Wald statistic. This is quicker to \
calculate but can be a bit less than the likelihood ratio chi-square. You could check \
this by estimating a model with and without age as a class variable. Calculate the \
likelihood ratio as the difference in -2 log likelihood values of the two models with \
2df. You can calculate the p-value as &quot;1 - probchi(diffminus2ll, 2)&quot;. \
Perhaps there&#39;s an option to get these LR values rather than Wald statistics but \
I can&#39;t find it just now.<br><br></div>Another possibility is that a linear \
effect of age with 1 df just has a better fit than an effect of age as a class \
variable with 2df. If the effect of the three categories of age is linear, then \
estimating the extra df doesn&#39;t improve the fit but does delete your type 3 \
statistic.<br><br></div>Good luck,<br></div>John Hendrickx<br></div><div \
class="gmail_extra"><br><div class="gmail_quote">2016-08-30 2:28 GMT+02:00 Laughing \
Beggar <span dir="ltr">&lt;<a href="mailto:Laughing_Beggar@hotmail.com" \
target="_blank">Laughing_Beggar@hotmail.com</a>&gt;</span>:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">




<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p>Hi all,</p>
<p>I&#39;m predicting a binary variable (Adequate Physical Activity/Inadequate) from \
2 binary variables (Sex (M/F) and location (A/B)) and a variable with 3 levels (age \
(Young, middle, old)).</p> <p>The 3 level variable is ordinal.</p>
<p>Without a CLASS statement, age is significant (using Analysis of MLE).</p>
<p>This looked interesting so I added a CLASS statement to pull the 3 levels of age \
apart.<br> </p>
<p>With a CLASS statement, age is only significant for one comparison within its \
levels, but not the other (Using MLE) - fair enough.</p> <p>BUT age is not \
significant Using Type3.<br> </p>
<p>What is the effect of using a CLASS statement with the Age variable, and why is \
there a difference between MLE and Type3 Estimates.?</p> <p>Thanks</p>
<p>L_B<br>
</p>
<p><br>
</p>
<div>&quot;The beggar laughs in the face of the thief&quot; </div>
</div>
</div>

</blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic