Kaz's SAS, HLM, and Rasch Model
PROC NLMIXED for Rasch Model
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

How do we use PROC NLMIXED for Rasch model?

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*/
proc logistic data=troyT des;
class _name_ ID;
model response = _name_ ID /noint;
ods output  ParameterEstimates=kaz;
run;

/*PROC NLMIXED*/
/*NEEDS TO CREATE A SERIES OF DUMMY VARIABLES
BECAUSE PROC NLMIXED DOES NOT TAKE CLASS STATEMENT (I think)*/
proc glmmod data=troyT prefix=I_ OUTDESIGN=ITEMS ZEROBASED;
class _NAME_ ;
model response=_NAME_;
run;
data all;
merge troyT items;
run;
proc nlmixed data=all;
eta=
i_1*item1 +
i_2*item2 +
i_3*item3 +
i_4*item4 +
i_5*item5 +
i_6*item6 +
i_7*item7 +
i_8*item8 +
i_9*item9 +
i_10*item10 +
i_11*item11 +
i_12*item12 +
i_13*item13 +
i_14*item14 +
i_15*item15 +
i_16*item16 +
i_17*item17 +
i_18*item18
+ u;
expeta=exp(eta);
p=expeta/(1+expeta);
model response ~ binary(p);
random u ~ normal(0,s2u) subject=ID out=PERSON_MEASURE_FILE;
ods output   ParameterEstimates=ITEM_DIFFICULTY_FILE;
run;

The SAS System                         09:58 Monday, August 13, 2007 838
The NLMIXED Procedure
                         Specifications
Data Set                                    WORK.ALL
Dependent Variable                          response
Distribution for Dependent Variable         Binary
Random Effects                              u
Distribution for Random Effects             Normal
Subject Variable                            ID
Optimization Technique                      Dual Quasi-Newton
Integration Method                          Adaptive Gaussian
                                            Quadrature

               Dimensions
Observations Used                    630
Observations Not Used                  0
Total Observations                   630
Subjects                              35
Max Obs Per Subject                   18
Parameters                            19
Quadrature Points                      3
 
 
The SAS System                         09:58 Monday, August 13, 2007 839
The NLMIXED Procedure
                             Parameters
   item1     item2     item3     item4     item5     item6     item7
       1         1         1         1         1         1         1
                             Parameters
   item8     item9    item10    item11    item12    item13    item14
       1         1         1         1         1         1         1
                              Parameters
  item15      item16      item17      item18         s2u    NegLogLike
       1           1           1           1           1    454.679672

                        Iteration History
Iter     Calls    NegLogLike        Diff     MaxGrad       Slope
   1         3    199.810695     254.869    4.953127     -875.82
   2         5    166.026981    33.78371    1.728731    -32.0131
   3         6     160.81887    5.208111    2.187815    -10.6543
 
The SAS System                         09:58 Monday, August 13, 2007 840
The NLMIXED Procedure
                        Iteration History
Iter     Calls    NegLogLike        Diff     MaxGrad       Slope
   4         7    158.980242    1.838628    1.151092    -3.82023
   5         8    157.996157    0.984085    0.467378    -1.44361
   6         9    157.234471    0.761686    0.945486    -1.23833
   7        11    156.858053    0.376418    0.203983    -0.65688
   8        13    156.756095    0.101957    0.479077    -0.09431
   9        14    156.626365     0.12973    0.578862    -0.17794
  10        16    156.538861    0.087504     0.20088    -0.12837
  11        18    156.501218    0.037644    0.173842    -0.05772
  12        19    156.469283    0.031934    0.291173     -0.0295
  13        20     156.45318    0.016103    0.254279     -0.0356
  14        21    156.433214    0.019966    0.035227    -0.02963
  15        22    156.425587    0.007627    0.112784    -0.00606
  16        23    156.417176    0.008411    0.022233    -0.01194
  17        25    156.415748    0.001429    0.025993     -0.0014
  18        26     156.41493    0.000818    0.033231    -0.00075
  19        27    156.414237    0.000693    0.014914    -0.00112
  20        29    156.413948    0.000288     0.00674    -0.00035
  21        30     156.41371    0.000238    0.008509    -0.00014
  22        32    156.413624    0.000086    0.001365    -0.00012
  23        33    156.413591    0.000033    0.004098    -0.00002
  24        35    156.413576    0.000016    0.000698    -0.00002
  25        37    156.413575    9.132E-7    0.000441    -1.08E-6
 
The SAS System                         09:58 Monday, August 13, 2007 841
The NLMIXED Procedure
          NOTE: GCONV convergence criterion satisfied.

             Fit Statistics
-2 Log Likelihood                  312.8
AIC (smaller is better)            350.8
AICC (smaller is better)           352.1
BIC (smaller is better)            380.4

                          Parameter Estimates
                     Standard
Parameter  Estimate     Error    DF  t Value  Pr > |t|   Alpha     Lower
item1       19.7159   1253.76    34     0.02    0.9875    0.05  -2528.22
item2       19.7159   1253.76    34     0.02    0.9875    0.05  -2528.22

      Parameter Estimates
Parameter     Upper    Gradient
item1       2567.65    -6.36E-7
item2       2567.65    -6.36E-7
 
The SAS System                         09:58 Monday, August 13, 2007 842
The NLMIXED Procedure
                          Parameter Estimates
                     Standard
Parameter  Estimate     Error    DF  t Value  Pr > |t|   Alpha     Lower
item3       19.7159   1253.76    34     0.02    0.9875    0.05  -2528.22
item4        3.5219    0.8275    34     4.26    0.0002    0.05    1.8402
item5        3.0640    0.7487    34     4.09    0.0002    0.05    1.5425
item6        2.6882    0.6951    34     3.87    0.0005    0.05    1.2754
item7        3.0640    0.7487    34     4.09    0.0002    0.05    1.5425
item8        1.8172    0.6021    34     3.02    0.0048    0.05    0.5936
item9        2.6882    0.6951    34     3.87    0.0005    0.05    1.2754
item10       1.1422    0.5552    34     2.06    0.0474    0.05   0.01399
item11      -1.0364    0.5388    34    -1.92    0.0628    0.05   -2.1313
item12      -2.3584    0.6342    34    -3.72    0.0007    0.05   -3.6472
item13      -2.0962    0.6080    34    -3.45    0.0015    0.05   -3.3319
item14      -3.4002    0.7848    34    -4.33    0.0001    0.05   -4.9951
item15      -4.7771    1.1672    34    -4.09    0.0002    0.05   -7.1491
item16      -4.7771    1.1672    34    -4.09    0.0002    0.05   -7.1491
item17      -4.7771    1.1672    34    -4.09    0.0002    0.05   -7.1491
item18     -19.8683   1733.06    34    -0.01    0.9909    0.05  -3541.86
s2u          3.2801    1.2116    34     2.71    0.0105    0.05    0.8178
 

The SAS System                         09:58 Monday, August 13, 2007 843
The NLMIXED Procedure

      Parameter Estimates
Parameter     Upper    Gradient
item3       2567.65    -6.36E-7
item4        5.2035    0.000021
item5        4.5856    -0.00027
item6        4.1009    0.000224
item7        4.5856    -0.00027
item8        3.0408    0.000441
item9        4.1009    0.000224
item10       2.2705    -0.00005
item11      0.05844    0.000083
item12      -1.0695    -0.00002
item13      -0.8605    0.000156
item14      -1.8053    -0.00023
item15      -2.4052    7.143E-6
item16      -2.4052    7.143E-6
item17      -2.4052    7.143E-6
item18      3502.13    3.329E-7
s2u          5.7423    -0.00015

Enter supporting content here

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