The NLMIXED Procedure

Example 83.3 Probit-Normal Model with Ordinal Data

(View the complete code for this example.)

The data for this example are from Ezzet and Whitehead (1991), who describe a crossover experiment on two groups of patients using two different inhaler devices (A and B). Patients from group 1 used device A for one week and then device B for another week. Patients from group 2 used the devices in reverse order. The data entered as a SAS data set are as follows:

data inhaler;
   input clarity group time freq @@;
   gt = group*time;
   sub = floor((_n_+1)/2);
   datalines;
1 0 0 59   1 0 1 59   1 0 0 35   2 0 1 35   1 0 0  3   3 0 1  3   1 0 0  2
4 0 1  2   2 0 0 11   1 0 1 11   2 0 0 27   2 0 1 27   2 0 0  2   3 0 1  2
2 0 0  1   4 0 1  1   4 0 0  1   1 0 1  1   4 0 0  1   2 0 1  1   1 1 0 63
1 1 1 63   1 1 0 13   2 1 1 13   2 1 0 40   1 1 1 40   2 1 0 15   2 1 1 15
3 1 0  7   1 1 1  7   3 1 0  2   2 1 1  2   3 1 0  1   3 1 1  1   4 1 0  2
1 1 1  2   4 1 0  1   3 1 1  1
;

The response measurement, clarity, is the patients’ assessment on the clarity of the leaflet instructions for the devices. The clarity variable is on an ordinal scale, with 1=easy, 2=only clear after rereading, 3=not very clear, and 4=confusing. The group variable indicates the treatment group, and the time variable indicates the time of measurement. The freq variable indicates the number of patients with exactly the same responses. A variable gt is created to indicate a group-by-time interaction, and a variable sub is created to indicate patients.

As in the previous example and in Hedeker and Gibbons (1994), assume an underlying latent continuous variable, here with the form

where i indexes patient and j indexes the time period, indicates groups, indicates time, is a patient-level normal random effect, and are iid normal errors. The s are unknown coefficients to be estimated.

Instead of observing , however, you observe only whether it falls in one of the four intervals: (, 0), (0, I1), (I1, I1 + I2), or (I1 + I2, ), where I1 and I2 are both positive. The resulting category is the value assigned to the clarity variable.

The following code sets up and fits this ordinal probit model:

proc nlmixed data=inhaler corr ecorr;
   parms b0=0 b1=0 b2=0 b3=0 sd=1 i1=1 i2=1;
   bounds i1 > 0, i2 > 0;
   eta = b0 + b1*group + b2*time + b3*gt + u;
   if (clarity=1) then p = probnorm(-eta);
   else if (clarity=2) then
      p = probnorm(i1-eta) - probnorm(-eta);
   else if (clarity=3) then
      p = probnorm(i1+i2-eta) - probnorm(i1-eta);
   else p = 1 - probnorm(i1+i2-eta);
   if (p > 1e-8) then ll = log(p);
   else ll = -1e20;
   model clarity ~ general(ll);
   random u ~ normal(0,sd*sd) subject=sub;
   replicate freq;
   estimate 'thresh2' i1;
   estimate 'thresh3' i1 + i2;
   estimate 'icc' sd*sd/(1+sd*sd);
run;

The PROC NLMIXED statement specifies the input data set and requests correlations both for the parameter estimates (CORR option) and for the additional estimates specified with ESTIMATE statements (ECORR option).

The parameters as defined in the PARMS statement are as follows: b0 (overall intercept), b1 (group main effect), B2 (time main effect), b3 (group-by-time interaction), sd (standard deviation of the random effect), i1 (increment between first and second thresholds), and i2 (increment between second and third thresholds). The BOUNDS statement restricts i1 and i2 to be positive.

The SAS programming statements begin by defining the linear predictor eta, which is a linear combination of the b parameters and a single random effect u. The next statements define the ordinal likelihood according to the clarity variable, eta, and the increment variables. An error trap is included in case the likelihood becomes too small.

A general log-likelihood specification is used in the MODEL statement, and the RANDOM statement defines the random effect u to have standard deviation sd and subject variable sub. The REPLICATE statement indicates that data for each subject should be replicated according to the freq variable.

The ESTIMATE statements specify the second and third thresholds in terms of the increment variables (the first threshold is assumed to equal zero for model identifiability). Also computed is the intraclass correlation.

The output is as follows.

Output 83.3.1: Specifications for Ordinal Data Model

The NLMIXED Procedure

Specifications
Data SetWORK.INHALER
Dependent Variableclarity
Distribution for Dependent VariableGeneral
Random Effectsu
Distribution for Random EffectsNormal
Subject Variablesub
Replicate Variablefreq
Optimization TechniqueDual Quasi-Newton
Integration MethodAdaptive Gaussian Quadrature


The "Specifications" table echoes some primary information specified for this nonlinear mixed model (Output 83.3.1). Because the log-likelihood function was expressed with SAS programming statements, the distribution is displayed as General in the "Specifications" table.

The "Dimensions" table reveals a total of 286 subjects, which is the sum of the values of the FREQ variable for the second time point. Five quadrature points are selected for log-likelihood evaluation (Output 83.3.2).

Output 83.3.2: Dimensions Table for Ordinal Data Model

Dimensions
Observations Used38
Observations Not Used0
Total Observations38
Subjects286
Max Obs per Subject2
Parameters7
Quadrature Points5


Output 83.3.3: Parameter Starting Values and Negative Log Likelihood

Initial Parameters
b0b1b2b3sdi1i2Negative
Log
Likelihood
0000111538.484276


The "Parameters" table lists the simple starting values for this problem (Output 83.3.3). The "Iteration History" table indicates successful convergence in 13 iterations (Output 83.3.4).

Output 83.3.4: Iteration History

Iteration History
IterationCallsNegative
Log
Likelihood
DifferenceMaximum
Gradient
Slope
14476.382562.1017643.7506-1431.40
27463.228213.1543114.2465-106.753
39458.52814.7000848.3132-33.0389
411450.97577.55238322.6010-40.9954
514448.01272.96303314.8688-16.7453
617447.24520.7675497.77419-2.26743
719446.72770.5174833.79353-1.59278
822446.51830.2093960.86864-0.37801
926446.51450.0037450.32857-0.02356
1029446.51330.0011870.056778-0.00183
1132446.51330.0000270.010785-0.00004
1235446.51333.956E-60.004922-5.41E-6
1338446.51331.989E-70.000470-4E-7

NOTE: GCONV convergence criterion satisfied.


Output 83.3.5: Fit Statistics for Ordinal Data Model

Fit Statistics
-2 Log Likelihood893.0
AIC (smaller is better)907.0
AICC (smaller is better)910.8
BIC (smaller is better)932.6


The "Fit Statistics" table lists the log likelihood and information criteria for model comparisons (Output 83.3.5).

Output 83.3.6: Parameter Estimates at Convergence

Parameter Estimates
ParameterEstimateStandard
Error
DFt ValuePr > |t|95% Confidence LimitsGradient
b0-0.63640.1342285-4.74<.0001-0.9006-0.37220.000470
b10.60070.17702853.390.00080.25230.94910.000265
b20.60150.15822853.800.00020.29000.91290.000080
b3-1.48170.2385285-6.21<.0001-1.9512-1.01220.000102
sd0.65990.13122855.03<.00010.40170.9181-0.00009
i11.74500.147428511.84<.00011.45482.03520.000202
i20.59850.14272854.19<.00010.31760.87940.000087


The "Parameter Estimates" table indicates significance of all the parameters (Output 83.3.6).

Output 83.3.7: Threshold and Intraclass Correlation Estimates

Additional Estimates
LabelEstimateStandard
Error
DFt ValuePr > |t|AlphaLowerUpper
thresh21.74500.147428511.84<.00010.051.45482.0352
thresh32.34350.207328511.31<.00010.051.93552.7516
icc0.30340.084022853.610.00040.050.13800.4687


The "Additional Estimates" table displays results from the ESTIMATE statements (Output 83.3.7).