Kaz's SAS, HLM, and Rasch Model
Rasch model with SAS PROC LOGISTIC
Home
Large National Data Sets
Kaz Library
SAS manuals
What is "error"?
Rasch Model
HLM
SAS PROC NLMIXED and GLIMMIX
Factor Analysis
Reading output via SAS
Excel functions for Statistical Analysis
Essays on learning statistics
Statistics in Japanese
My profile
My SAS questions and SAS's responses
My work tool box

Replicating Rasch model with SAS PROC LOGISTICS

Rash model is a logistic regression, so we should be able to use SAS PROC LOGISTIC, but I cannot solve two problems (let me know if you have solutions):
  • How can we get rid of perfect data?  (This is just a programming issue, so I can solve this one if I have time.)
  • How can we center person estimates at their means at each loop of maximum likelihood estimation process?  In Moulton's excel simulaiton (http://www.raschsig.org/EDS_Rasch_Demo.xls), this process is the one that is done at step 5, step 15, .....  I don't know how I can implement this part in SAS PROC LOGISTICS.

data troy;
input
ID $ 1-8 gender $ 9 item01 11 item02 12 item03 13 item04 14 item05 15
item06 16 item07 17 item08 18 item09 19 item10 20 item11 21 item12 22
item13 23 item14 24 item15 25 item16 26 item17 27 item18 28
;
datalines;
Richard M 111111100000000000
Tracie  F 111111111100000000
Walter  M 111111111001000000
Blaise  M 111100101000000000
Ron     M 111111111100000000
William M 111111111100000000
Susan   F 111111111111101000
Linda   F 111111111100000000
Kim     F 111111111100000000
Carol   F 111111111110000000
Pete    M 111011111000000000
Brenda  F 111110101100000000
Mike    M 111110011111000000
Zula    F 111111111110000000
Frank   M 111111111111100000
Dorothy F 111111111010000000
Rod     M 111101111100000000
Britton F 111111111100100000
Janet   F 111111111000000000
David   M 111111111100100000
Thomas  M 111111111110100000
Betty   F 111111111111000000
Bert    M 111111111100110000
Rick    M 111111111110100110
Don     M 111011000000000000
Barbara F 111111111100000000
Adam    M 111111100000000000
Audrey  F 111111111010000000
Anne    F 111111001110010000
Lisa    F 111111111000000000
James   M 111111111100000000
Joe     M 111111111110000000
Martha  F 111100100100000000
Elsie   F 111111111101010000
Helen   F 111000000000000000
;
run;
proc sort;
by ID;
run;

proc transpose data=troy out=troyT(rename = col1 = response);
by ID;
run;



proc logistic data=troyT des;
class _name_ ID;
model response = _name_ ID /noint;
ods output  ParameterEstimates=kaz;
run;

 

 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 411

The LOGISTIC Procedure

              Model Information

Data Set                      WORK.TROYT     
Response Variable             response       
Number of Response Levels     2              
Model                         binary logit   
Optimization Technique        Fisher's scoring


Number of Observations Read         630
Number of Observations Used         630


          Response Profile
 
 Ordered                      Total
   Value     response     Frequency

       1            1           341
       2            0           289

Probability modeled is response=1.


 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 412

The LOGISTIC Procedure

 
                        Class Level Information
 
Class   Value                       Design Variables

_NAME_  item01    1   0   0   0   0   0   0   0   0   0   0   0   0   0
        item02    0   1   0   0   0   0   0   0   0   0   0   0   0   0
        item03    0   0   1   0   0   0   0   0   0   0   0   0   0   0
        item04    0   0   0   1   0   0   0   0   0   0   0   0   0   0
        item05    0   0   0   0   1   0   0   0   0   0   0   0   0   0
        item06    0   0   0   0   0   1   0   0   0   0   0   0   0   0
        item07    0   0   0   0   0   0   1   0   0   0   0   0   0   0
        item08    0   0   0   0   0   0   0   1   0   0   0   0   0   0
        item09    0   0   0   0   0   0   0   0   1   0   0   0   0   0
        item10    0   0   0   0   0   0   0   0   0   1   0   0   0   0
        item11    0   0   0   0   0   0   0   0   0   0   1   0   0   0
        item12    0   0   0   0   0   0   0   0   0   0   0   1   0   0
        item13    0   0   0   0   0   0   0   0   0   0   0   0   1   0
        item14    0   0   0   0   0   0   0   0   0   0   0   0   0   1
        item15    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        item16    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        item17    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        item18   -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1

ID      Adam      1   0   0   0   0   0   0   0   0   0   0   0   0   0
        Anne      0   1   0   0   0   0   0   0   0   0   0   0   0   0
        Audrey    0   0   1   0   0   0   0   0   0   0   0   0   0   0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 413

The LOGISTIC Procedure

 
                       Class Level Information
 
                           Design Variables

 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 0   0   0                                                           
 1   0   0                                                           
 0   1   0                                                           
 0   0   1                                                           
-1  -1  -1                                                           

 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 414

The LOGISTIC Procedure

Class Level Information
 
  Design
Variables

        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        

 0      0
 0      0
 0      0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 415

The LOGISTIC Procedure

 
                        Class Level Information
 
Class   Value                       Design Variables

        Barbara   0   0   0   1   0   0   0   0   0   0   0   0   0   0
        Bert      0   0   0   0   1   0   0   0   0   0   0   0   0   0
        Betty     0   0   0   0   0   1   0   0   0   0   0   0   0   0
        Blaise    0   0   0   0   0   0   1   0   0   0   0   0   0   0
        Brenda    0   0   0   0   0   0   0   1   0   0   0   0   0   0
        Britton   0   0   0   0   0   0   0   0   1   0   0   0   0   0
        Carol     0   0   0   0   0   0   0   0   0   1   0   0   0   0
        David     0   0   0   0   0   0   0   0   0   0   1   0   0   0
        Don       0   0   0   0   0   0   0   0   0   0   0   1   0   0
        Dorothy   0   0   0   0   0   0   0   0   0   0   0   0   1   0
        Elsie     0   0   0   0   0   0   0   0   0   0   0   0   0   1
        Frank     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Helen     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        James     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Janet     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Joe       0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Kim       0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Linda     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Lisa      0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Martha    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Mike      0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Pete      0   0   0   0   0   0   0   0   0   0   0   0   0   0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 416

The LOGISTIC Procedure

 
                       Class Level Information
 
                           Design Variables

 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   1   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   1   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   1   0   0   0   0   0   0   0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 417

The LOGISTIC Procedure

Class Level Information
 
  Design
Variables

 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 418

The LOGISTIC Procedure

 
                        Class Level Information
 
Class   Value                       Design Variables

        Richard   0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Rick      0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Rod       0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Ron       0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Susan     0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Thomas    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Tracie    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Walter    0   0   0   0   0   0   0   0   0   0   0   0   0   0
        William   0   0   0   0   0   0   0   0   0   0   0   0   0   0
        Zula     -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1

 
                       Class Level Information
 
                           Design Variables

 0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1   0
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 419

The LOGISTIC Procedure

 
                       Class Level Information
 
                           Design Variables

 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   1
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
-1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1  -1

Class Level Information
 
  Design
Variables

 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 0      0
 1      0
 0      1
-1     -1
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 420

The LOGISTIC Procedure

                    Model Convergence Status

       Quasi-complete separation of data points detected.      

WARNING: The maximum likelihood estimate may not exist.
WARNING: The LOGISTIC procedure continues in spite of the above
         warning. Results shown are based on the last maximum
         likelihood iteration. Validity of the model fit is
         questionable.


         Model Fit Statistics
 
                 Without           With
Criterion     Covariates     Covariates

AIC              873.365        323.461
SC               873.365        550.192
-2 Log L         873.365        221.461


 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 421

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

        Testing Global Null Hypothesis: BETA=0
 
Test                 Chi-Square       DF     Pr > ChiSq

Likelihood Ratio       651.9049       51         <.0001
Score                  444.0571       51         <.0001
Wald                   111.7812       51         <.0001


        Type 3 Analysis of Effects
 
                        Wald
Effect      DF    Chi-Square    Pr > ChiSq

_NAME_      17      107.2071        <.0001
ID          34       66.0526        0.0008


 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 422

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

               Analysis of Maximum Likelihood Estimates
 
                                    Standard         Wald
Parameter           DF   Estimate      Error   Chi-Square   Pr > ChiSq

_NAME_    item01     1    25.9555      282.4       0.0085       0.9268
_NAME_    item02     1    25.9555      282.4       0.0085       0.9268
_NAME_    item03     1    25.9555      282.4       0.0085       0.9268
_NAME_    item04     1     3.9159     4.1979       0.8702       0.3509
_NAME_    item05     1     3.3331     4.1758       0.6371       0.4248
_NAME_    item06     1     2.8692     4.1634       0.4749       0.4907
_NAME_    item07     1     3.3331     4.1758       0.6371       0.4248
_NAME_    item08     1     1.8032     4.1441       0.1893       0.6635
_NAME_    item09     1     2.8692     4.1634       0.4749       0.4907
_NAME_    item10     1     0.9926     4.1347       0.0576       0.8103
_NAME_    item11     1    -1.4645     4.1306       0.1257       0.7229
_NAME_    item12     1    -2.9628     4.1473       0.5104       0.4750
_NAME_    item13     1    -2.6644     4.1425       0.4137       0.5201
_NAME_    item14     1    -4.1359     4.1769       0.9805       0.3221
_NAME_    item15     1    -5.5982     4.2679       1.7205       0.1896
_NAME_    item16     1    -5.5982     4.2679       1.7205       0.1896
_NAME_    item17     1    -5.5982     4.2679       1.7205       0.1896
ID        Adam       1    -2.4492     4.1953       0.3408       0.5594
ID        Anne       1     0.3602     4.2556       0.0072       0.9325
ID        Audrey     1     0.3602     4.2556       0.0072       0.9325
ID        Barbara    1     0.3602     4.2556       0.0072       0.9325
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 423

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

               Analysis of Maximum Likelihood Estimates
 
                                    Standard         Wald
Parameter           DF   Estimate      Error   Chi-Square   Pr > ChiSq

ID        Bert       1     2.6821     4.2264       0.4027       0.5257
ID        Betty      1     2.6821     4.2264       0.4027       0.5257
ID        Blaise     1    -3.1233     4.1965       0.5539       0.4567
ID        Brenda     1    -1.7191     4.2041       0.1672       0.6826
ID        Britton    1     1.6247     4.2419       0.1467       0.7017
ID        Carol      1     1.6247     4.2419       0.1467       0.7017
ID        David      1     1.6247     4.2419       0.1467       0.7017
ID        Don        1    -3.8389     4.2106       0.8312       0.3619
ID        Dorothy    1     0.3602     4.2556       0.0072       0.9325
ID        Elsie      1     2.6821     4.2264       0.4027       0.5257
ID        Frank      1     3.6239     4.2251       0.7357       0.3910
ID        Helen      1   -14.9490      139.5       0.0115       0.9147
ID        James      1     0.3602     4.2556       0.0072       0.9325
ID        Janet      1    -0.8258     4.2270       0.0382       0.8451
ID        Joe        1     1.6247     4.2419       0.1467       0.7017
ID        Kim        1     0.3602     4.2556       0.0072       0.9325
ID        Linda      1     0.3602     4.2556       0.0072       0.9325
ID        Lisa       1    -0.8258     4.2270       0.0382       0.8451
ID        Martha     1    -3.1233     4.1965       0.5539       0.4567
ID        Mike       1     0.3602     4.2556       0.0072       0.9325
ID        Pete       1    -1.7191     4.2041       0.1672       0.6826
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 424

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

               Analysis of Maximum Likelihood Estimates
 
                                    Standard         Wald
Parameter           DF   Estimate      Error   Chi-Square   Pr > ChiSq

ID        Richard    1    -2.4492     4.1953       0.3408       0.5594
ID        Rick       1     4.5252     4.2330       1.1428       0.2851
ID        Rod        1    -0.8258     4.2270       0.0382       0.8451
ID        Ron        1     0.3602     4.2556       0.0072       0.9325
ID        Susan      1     4.5252     4.2330       1.1428       0.2851
ID        Thomas     1     2.6821     4.2264       0.4027       0.5257
ID        Tracie     1     0.3602     4.2556       0.0072       0.9325
ID        Walter     1     0.3602     4.2556       0.0072       0.9325
ID        William    1     0.3602     4.2556       0.0072       0.9325


                    Odds Ratio Estimates
                             
                                Point          95% Wald
Effect                       Estimate      Confidence Limits

_NAME_ item01 vs item18      >999.999      <0.001    >999.999
_NAME_ item02 vs item18      >999.999      <0.001    >999.999
_NAME_ item03 vs item18      >999.999      <0.001    >999.999
_NAME_ item04 vs item18      >999.999      <0.001    >999.999
_NAME_ item05 vs item18      >999.999      <0.001    >999.999
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 425

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

                    Odds Ratio Estimates
                             
                                Point          95% Wald
Effect                       Estimate      Confidence Limits

_NAME_ item06 vs item18      >999.999      <0.001    >999.999
_NAME_ item07 vs item18      >999.999      <0.001    >999.999
_NAME_ item08 vs item18      >999.999      <0.001    >999.999
_NAME_ item09 vs item18      >999.999      <0.001    >999.999
_NAME_ item10 vs item18      >999.999      <0.001    >999.999
_NAME_ item11 vs item18      >999.999      <0.001    >999.999
_NAME_ item12 vs item18      >999.999      <0.001    >999.999
_NAME_ item13 vs item18      >999.999      <0.001    >999.999
_NAME_ item14 vs item18      >999.999      <0.001    >999.999
_NAME_ item15 vs item18      >999.999      <0.001    >999.999
_NAME_ item16 vs item18      >999.999      <0.001    >999.999
_NAME_ item17 vs item18      >999.999      <0.001    >999.999
ID     Adam    vs Zula          0.017       0.001       0.287
ID     Anne    vs Zula          0.282       0.013       6.311
ID     Audrey  vs Zula          0.282       0.013       6.311
ID     Barbara vs Zula          0.282       0.013       6.311
ID     Bert    vs Zula          2.879       0.162      51.143
ID     Betty   vs Zula          2.879       0.162      51.143
ID     Blaise  vs Zula          0.009      <0.001       0.148
ID     Brenda  vs Zula          0.035       0.002       0.624
ID     Britton vs Zula          1.000       0.051      19.751
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 426

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

                    Odds Ratio Estimates
                             
                                Point          95% Wald
Effect                       Estimate      Confidence Limits

ID     Carol   vs Zula          1.000       0.051      19.751
ID     David   vs Zula          1.000       0.051      19.751
ID     Don     vs Zula          0.004      <0.001       0.079
ID     Dorothy vs Zula          0.282       0.013       6.311
ID     Elsie   vs Zula          2.879       0.162      51.143
ID     Frank   vs Zula          7.383       0.420     129.735
ID     Helen   vs Zula         <0.001      <0.001    >999.999
ID     James   vs Zula          0.282       0.013       6.311
ID     Janet   vs Zula          0.086       0.004       1.712
ID     Joe     vs Zula          1.000       0.051      19.751
ID     Kim     vs Zula          0.282       0.013       6.311
ID     Linda   vs Zula          0.282       0.013       6.311
ID     Lisa    vs Zula          0.086       0.004       1.712
ID     Martha  vs Zula          0.009      <0.001       0.148
ID     Mike    vs Zula          0.282       0.013       6.311
ID     Pete    vs Zula          0.035       0.002       0.624
ID     Richard vs Zula          0.017       0.001       0.287
ID     Rick    vs Zula         18.184       0.987     335.106
ID     Rod     vs Zula          0.086       0.004       1.712
ID     Ron     vs Zula          0.282       0.013       6.311
ID     Susan   vs Zula         18.184       0.987     335.106
 
                                                                       
 
The SAS System                         09:58 Monday, August 13, 2007 427

The LOGISTIC Procedure
WARNING: The validity of the model fit is questionable.

                    Odds Ratio Estimates
                             
                                Point          95% Wald
Effect                       Estimate      Confidence Limits

ID     Thomas  vs Zula          2.879       0.162      51.143
ID     Tracie  vs Zula          0.282       0.013       6.311
ID     Walter  vs Zula          0.282       0.013       6.311
ID     William vs Zula          0.282       0.013       6.311


Association of Predicted Probabilities and Observed Responses

Percent Concordant     97.9    Somers' D    0.961
Percent Discordant      1.8    Gamma        0.964
Percent Tied            0.3    Tau-a        0.478
Pairs                 98549    c            0.981

Enter supporting content here

Copyright 2005 KU
For information inquiry (AT) estat.us