BookmarkSubscribeRSS Feed
jean_kiser
Calcite | Level 5

The SAS note https://support.sas.com/kb/37/228.html#note1 indicates that you can use the NLEstimate macro to get the risk difference. The example dataset has 100 records. In the example code, df=100. However, the macro indicates that it would typically be the number of observations minus the number of parameters estimated. So wouldn't that be 97 (100-3)?

 proc logistic data=test;
         class a / param=glm;
         model y(event="1") = a;
         lsmeans a / ilink;
         store logfit;
         run;
      data fd; 
         length label f $32767; 
         infile datalines delimiter=',';
         input label f; 
         datalines;
      Prob Diff A1-A2,logistic(B_p1+b_p2) - logistic(B_p1+b_p3)
      Prob Diff A1-A3,logistic(B_p1+b_p2) - logistic(B_p1)
      Prob Diff A2-A3,logistic(B_p1+b_p3) - logistic(B_p1)
      ;
      %NLEstimate(instore=logfit, fdata=fd, df=100)

 

df=,            /* Specifies the degrees of freedom to be used in the */

                /* test and confidence interval computed for the      */

                /* estimated function(s). If omitted, large-sample    */

                /* Wald statistics are given. The degrees of freedom  */

                /* for testing a linear combination of parameters in  */

                /* a linear model would typically be the number of    */

                /* observations used in fitting the model minus the   */

                /* number of parameters estimated in the model –      */

                /* essentially, the error degrees of freedom.         */

1 REPLY 1
StatDave
SAS Super FREQ

It would be. The value  specified in df= is used, as is, for the test. The documentation of df= is suggesting that if you specify df= that you typically will want to specify N-p, where N is the sample size, and p is the number of estimated parameters.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 411 views
  • 1 like
  • 2 in conversation