g11saf fits a latent variable model (with a single factor) to data consisting of a set of measurements on individuals in the form of binary-valued sequences (generally referred to as score patterns). Various measures of goodness-of-fit are calculated along with the factor (theta) scores.
The routine may be called by the names g11saf or nagf_contab_binary.
3Description
Given a set of $p$ dichotomous variables $\stackrel{~}{x}={({x}_{1},{x}_{2},\dots ,{x}_{p})}^{\prime}$, where ${}^{\prime}$ denotes vector or matrix transpose, the objective is to investigate whether the association between them can be adequately explained by a latent variable model of the form (see Bartholomew (1980) and Bartholomew (1987))
The ${x}_{i}$ are called item responses and take the value $0$ or $1$. $\theta $ denotes the latent variable assumed to have a standard Normal distribution over a population of individuals to be tested on $p$ items. Call ${\pi}_{i}\left(\theta \right)=P({x}_{i}=1\mid \theta )$ the item response function: it represents the probability that an individual with latent ability $\theta $ will produce a positive response (1) to item $i$. ${\alpha}_{i0}$ and ${\alpha}_{i1}$ are item parameters which can assume any real values. The set of parameters, ${\alpha}_{\mathit{i}1}$, for $\mathit{i}=1,2,\dots ,p$, being coefficients of the unobserved variable $\theta $, can be interpreted as ‘factor loadings’.
$G$ is a function selected by you as either ${\Phi}^{-1}$ or logit, mapping the interval $(0,1)$ onto the whole real line. Data from a random sample of $n$ individuals takes the form of the matrices $X$ and $R$ defined below:
where ${\stackrel{~}{x}}_{l}=({x}_{l1},{x}_{l2},\dots ,{x}_{lp})$ denotes the $l$th score pattern in the sample, ${r}_{l}$ the frequency with which ${\stackrel{~}{x}}_{l}$ occurs and $s$ the number of different score patterns observed. (Thus $\sum _{l=1}^{s}}{r}_{l}=n$). It can be shown that the log-likelihood function is proportional to
($\varphi \left(\theta \right)$ being the probability density function of a standard Normal random variable).
${P}_{l}$ denotes the unconditional probability of observing score pattern ${\stackrel{~}{x}}_{l}$. The integral in (2) is approximated using Gauss–Hermite quadrature. If we take $G\left(z\right)=\mathrm{logit}z=\mathrm{log}\left(\frac{z}{1-z}\right)$ in (1) and reparameterise as follows,
If we take $G\left(z\right)={\Phi}^{-1}\left(z\right)$ (where $\Phi $ is the cumulative distribution function of a standard Normal random variable) and reparameterise as follows,
An E-M algorithm (see Bock and Aitkin (1981)) is used to maximize the log-likelihood function. The number of quadrature points used is set initially to $10$ and once convergence is attained increased to $20$.
The theta score of an individual responding in score pattern ${\stackrel{~}{x}}_{l}$ is computed as the posterior mean, i.e., $E(\theta \mid {\stackrel{~}{x}}_{l})$. For the logit model the component score ${X}_{l}={\displaystyle \sum _{j=1}^{p}}{\alpha}_{j}{x}_{lj}$ is also calculated. (Note that in calculating the theta scores and measures of goodness-of-fit g11saf automatically reverses the coding on item $j$ if ${\alpha}_{j}<0$; it is assumed in the model that a response at the one level is showing a higher measure of latent ability than a response at the zero level.)
The frequency distribution of score patterns is required as input data. If your data is in the form of individual score patterns (uncounted), then g11sbf may be used to calculate the frequency distribution.
4References
Bartholomew D J (1980) Factor analysis for categorical data (with Discussion) J. Roy. Statist. Soc. Ser. B42 293–321
Bartholomew D J (1987) Latent Variable Models and Factor Analysis Griffin
Bock R D and Aitkin M (1981) Marginal maximum likelihood estimation of item parameters: Application of an E-M algorithm Psychometrika46 443–459
5Arguments
1: $\mathbf{ip}$ – IntegerInput
On entry: $p$, the number of dichotomous variables.
Constraint:
${\mathbf{ip}}\ge 3$.
2: $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of individuals in the sample.
Constraint:
${\mathbf{n}}\ge 7$.
3: $\mathbf{gprob}$ – LogicalInput
On entry: must be set equal to .TRUE. if $G\left(z\right)={\Phi}^{-1}\left(z\right)$ and .FALSE. if $G\left(z\right)=\mathrm{logit}z$.
4: $\mathbf{ns}$ – IntegerInput
On entry: ns must be set equal to the number of different score patterns in the sample, $s$.
On entry: the first $s$ rows of x must contain the $s$ different score patterns. The $l$th row of x must contain the $l$th score pattern with ${\mathbf{x}}(l,j)$ set equal to .TRUE. if ${x}_{lj}=1$ and .FALSE. if ${x}_{lj}=0$. All rows of x must be distinct.
On exit: given a valid parameter set then the first $s$ rows of x still contain the $s$ different score patterns. However, the following points should be noted:
(i)If the estimated factor loading for the $j$th item is negative then that item is re-coded, i.e., $0$s and $1$s (or .TRUE. and .FALSE.) in the $j$th column of x are interchanged.
(ii)The rows of x will be reordered so that the theta scores corresponding to rows of x are in increasing order of magnitude.
6: $\mathbf{ldx}$ – IntegerInput
On entry: the first dimension of the array x as declared in the (sub)program from which g11saf is called.
On entry: the $i$th component of irl must be set equal to the frequency with which the $i$th row of x occurs.
Constraints:
${\mathbf{irl}}\left(\mathit{i}\right)\ge 0$, for $\mathit{i}=1,2,\dots ,s$;
$\sum _{i=1}^{s}}{\mathbf{irl}}\left(i\right)=n$.
On exit: given a valid parameter set then the first $s$ components of irl are reordered as are the rows of x.
8: $\mathbf{a}\left({\mathbf{ip}}\right)$ – Real (Kind=nag_wp) arrayInput/Output
On entry: ${\mathbf{a}}\left(j\right)$ must be set equal to an initial estimate of ${\alpha}_{j1}$. In order to avoid divergence problems with the E-M algorithm you are strongly advised to set all the ${\mathbf{a}}\left(j\right)$ to $0.5$.
On exit: ${\mathbf{a}}\left(\mathit{j}\right)$ contains the latest estimate of ${\alpha}_{\mathit{j}1}$, for $\mathit{j}=1,2,\dots ,p$. (Because of possible recoding all elements of a will be positive.)
9: $\mathbf{c}\left({\mathbf{ip}}\right)$ – Real (Kind=nag_wp) arrayInput/Output
On entry: ${\mathbf{c}}\left(j\right)$ must be set equal to an initial estimate of ${\alpha}_{j0}$. In order to avoid divergence problems with the E-M algorithm you are strongly advised to set all the ${\mathbf{c}}\left(j\right)$ to $0.0$.
On exit: ${\mathbf{c}}\left(\mathit{j}\right)$ contains the latest estimate of ${\alpha}_{\mathit{j}0}$, for $\mathit{j}=1,2,\dots ,p$.
10: $\mathbf{iprint}$ – IntegerInput
On entry: the frequency with which the maximum likelihood search routine is to be monitored.
${\mathbf{iprint}}>0$
The search is monitored once every iprint iterations, and when the number of quadrature points is increased, and again at the final solution point.
${\mathbf{iprint}}=0$
The search is monitored once at the final point.
${\mathbf{iprint}}<0$
The search is not monitored at all.
iprint should normally be set to a small positive number.
Suggested value:
${\mathbf{iprint}}=1$.
11: $\mathbf{cgetol}$ – Real (Kind=nag_wp)Input
On entry: the accuracy to which the solution is required.
If cgetol is set to ${10}^{-l}$ and on exit ${\mathbf{ifail}}={\mathbf{0}}$ or ${\mathbf{7}}$, then all elements of the gradient vector will be smaller than ${10}^{-l}$ in absolute value. For most practical purposes the value ${10}^{\mathrm{-4}}$ should suffice. You should be wary of setting cgetol too small since the convergence criterion may then have become too strict for the machine to handle.
If cgetol has been set to a value which is less than the square root of the machine precision, $\epsilon $, then g11saf will use the value $\sqrt{\epsilon}$ instead.
12: $\mathbf{maxit}$ – IntegerInput
On entry: the maximum number of iterations to be made in the maximum likelihood search. There will be an error exit (see Section 6) if the search routine has not converged in maxit iterations.
Suggested value:
${\mathbf{maxit}}=1000$.
Constraint:
${\mathbf{maxit}}\ge 1$.
13: $\mathbf{chisqr}$ – LogicalInput
On entry: if chisqr is set equal to .TRUE., a likelihood ratio statistic will be calculated (see chi).
If chisqr is set equal to .FALSE., no such statistic will be calculated.
14: $\mathbf{ishow}$ – IntegerInput
On entry: indicates which of the following three quantities are to be printed before exit from the routine (given a valid parameter set):
(a)Table of maximum likelihood estimates and standard errors (as returned in the output arrays a, c, alpha, pigam and cm).
(b)Table of observed and expected first- and second-order margins (as returned in the output arrays expp and obs).
(c)Table of observed and expected frequencies of score patterns along with theta scores (as returned in the output arrays irl, exf, y, xl and iob) and the likelihood ratio statistic (if required).
On exit: given a valid parameter set then niter contains the number of iterations performed by the maximum likelihood search routine.
16: $\mathbf{alpha}\left({\mathbf{ip}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{alpha}}\left(j\right)$ contains the latest estimate of ${\alpha}_{j}$. (Because of possible recoding all elements of alpha will be positive.)
17: $\mathbf{pigam}\left({\mathbf{ip}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{pigam}}\left(j\right)$ contains the latest estimate of either ${\pi}_{j}$ if ${\mathbf{gprob}}=\mathrm{.FALSE.}$ (logit model) or ${\gamma}_{j}$ if ${\mathbf{gprob}}=\mathrm{.TRUE.}$ (probit model).
18: $\mathbf{cm}({\mathbf{ldcm}},2\times {\mathbf{ip}})$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then the strict lower triangle of cm contains the correlation matrix of the parameter estimates held in alpha and pigam on exit. The diagonal elements of cm contain the standard errors. Thus:
${\mathbf{cm}}(2\times i-1,2\times i-1)$
=
standard error $\left({\mathbf{alpha}}\left(i\right)\right)$
${\mathbf{cm}}(2\times i,2\times i)$
=
standard error $\left({\mathbf{pigam}}\left(i\right)\right)$
20: $\mathbf{g}\left(2\times {\mathbf{ip}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then g contains the estimated gradient vector corresponding to the final point held in the arrays alpha and pigam.
${\mathbf{g}}\left(2\times \mathit{j}-1\right)$ contains the derivative of the log-likelihood with respect to ${\mathbf{alpha}}\left(\mathit{j}\right)$, for $\mathit{j}=1,2,\dots ,p$.
${\mathbf{g}}\left(2\times \mathit{j}\right)$ contains the derivative of the log-likelihood with respect to ${\mathbf{pigam}}\left(\mathit{j}\right)$, for $\mathit{j}=1,2,\dots ,p$.
21: $\mathbf{expp}({\mathbf{ldexpp}},{\mathbf{ip}})$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{expp}}(i,j)$ contains the expected percentage of individuals in the sample who respond positively to items $i$ and $j$ ($j\le i$), corresponding to the final point held in the arrays alpha and pigam.
22: $\mathbf{ldexpp}$ – IntegerInput
On entry: the first dimension of the array obs and the first dimension of the array expp as declared in the (sub)program from which g11saf is called.
Constraint:
${\mathbf{ldexpp}}\ge {\mathbf{ip}}$.
23: $\mathbf{obs}({\mathbf{ldexpp}},{\mathbf{ip}})$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{obs}}(i,j)$ contains the observed percentage of individuals in the sample who responded positively to items $i$ and $j$ ($j\le i$).
24: $\mathbf{exf}\left({\mathbf{ns}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{exf}}\left(l\right)$ contains the expected frequency of the $l$th score pattern ($l$th row of x), corresponding to the final point held in the arrays alpha and pigam.
25: $\mathbf{y}\left({\mathbf{ns}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: given a valid parameter set then ${\mathbf{y}}\left(l\right)$ contains the estimated theta score corresponding to the $l$th row of x, for the final point held in the arrays alpha and pigam.
26: $\mathbf{xl}\left({\mathbf{ns}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: if gprob has been set equal to .FALSE. (logit model) then, given a valid parameter set, ${\mathbf{xl}}\left(l\right)$ contains the estimated component score corresponding to the $l$th row of x for the final point held in the arrays alpha and pigam.
If gprob is set equal to .TRUE. (probit model), this array is not used.
On exit: given a valid parameter set then ${\mathbf{iob}}\left(l\right)$ contains the number of items in the $l$th row of x for which the response was positive (.TRUE.).
28: $\mathbf{rlogl}$ – Real (Kind=nag_wp)Output
On exit: given a valid parameter set then rlogl contains the value of the log-likelihood kernel corresponding to the final point held in the arrays alpha and pigam, namely
On exit: if chisqr was set equal to .TRUE. on entry, then given a valid parameter set, chi will contain the value of the likelihood ratio statistic corresponding to the final parameter estimates held in the arrays alpha and pigam, namely
The summation is over those elements of irl which are positive. If ${\mathbf{exf}}\left(l\right)$ is less than $5.0$, then adjacent score patterns are pooled (the score patterns in x being first put in order of increasing theta score).
If chisqr has been set equal to .FALSE., then chi is not used.
30: $\mathbf{idf}$ – IntegerOutput
On exit: if chisqr was set equal to .TRUE. on entry, then given a valid parameter set, idf will contain the degrees of freedom associated with the likelihood ratio statistic, chi.
${\mathbf{idf}}={s}_{0}-2\times p$
if ${s}_{0}<{2}^{p}$;
${\mathbf{idf}}={s}_{0}-2\times p-1$
if ${s}_{0}={2}^{p}$,
where ${s}_{0}$ denotes the number of terms summed to calculate chi (${s}_{0}=s$ only if there is no pooling).
If chisqr has been set equal to .FALSE., idf is not used.
31: $\mathbf{siglev}$ – Real (Kind=nag_wp)Output
On exit: if chisqr was set equal to .TRUE. on entry, then given a valid parameter set, siglev will contain the significance level of chi based on idf degrees of freedom. If idf is zero or negative then siglev is set to zero.
If chisqr was set equal to .FALSE., siglev is not used.
32: $\mathbf{w}\left({\mathbf{lw}}\right)$ – Real (Kind=nag_wp) arrayWorkspace
33: $\mathbf{lw}$ – IntegerInput
On entry: the dimension of the array w as declared in the (sub)program from which g11saf is called.
On entry: ifail must be set to $0$, $\mathrm{-1}$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $\mathrm{-1}$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $\mathrm{-1}$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $\mathrm{-1}$ is recommended since useful values can be provided in some output arguments even when ${\mathbf{ifail}}\ne {\mathbf{0}}$ on exit. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry ${\mathbf{ifail}}=0$ or $\mathrm{-1}$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
Note: in some cases g11saf may return useful information.
${\mathbf{ifail}}=1$
On entry, $i=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{irl}}\left(i\right)=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{irl}}\left(i\right)\ge 0$.
On entry, $i=\u27e8\mathit{\text{value}}\u27e9$ and $j=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: rows $i$ and $j$ of x should not be identical.
On entry, ${\mathbf{ip}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ip}}\ge 3$.
On entry, ${\mathbf{ishow}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ishow}}=0$, $1$, $2$, $3$, $4$, $5$, $6$ or $7$.
On entry, ${\mathbf{ldcm}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ip}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ldcm}}\ge 2\times {\mathbf{ip}}$.
On entry, ${\mathbf{ldexpp}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ip}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ldexpp}}\ge {\mathbf{ip}}$
On entry, ${\mathbf{ldx}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ns}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ldx}}\ge {\mathbf{ns}}$.
On entry, ${\mathbf{lw}}=\u27e8\mathit{\text{value}}\u27e9$ and minimum value for ${\mathbf{lw}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{lw}}\ge 4\times {\mathbf{ip}}\times ({\mathbf{ip}}+16)$.
On entry, ${\mathbf{maxit}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{maxit}}\ge 1$.
On entry, ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{n}}\ge 7$.
On entry, ${\mathbf{ns}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ip}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ns}}>2\times {\mathbf{ip}}$.
On entry, ${\mathbf{ns}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{ip}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ns}}\le {2}^{{\mathbf{ip}}}$.
On entry, ${\mathbf{ns}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ns}}\le {\mathbf{n}}$.
On entry, ${\sum}_{i}{\mathbf{irl}}\left(i\right)=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\sum}_{i}{\mathbf{irl}}\left(i\right)={\mathbf{n}}$.
${\mathbf{ifail}}=2$
For at least one of the ip items the responses are all at the same level.
${\mathbf{ifail}}=3$
maxit iterations have been performed: ${\mathbf{maxit}}=\u27e8\mathit{\text{value}}\u27e9$. If steady increases in the log-likelihood kernel were monitored up to the point where this exit occurred, the exit probably occurred simply because maxit was set too small, so the calculations should be restarted from the final point held in a and c. This type of exit may also indicate that there is no maximum to the likelihood surface.
${\mathbf{ifail}}=4$
One of the elements of a has exceeded $10$ in absolute. This is the Heywood case as described in Section 9.3. If steady increases in the log-likelihood kernel were monitored up to the point where this exit occurred then this exit may indicate that there is no maximum to the likelihood surface. You are advised to restart the calculations from a different point to see whether the E-M algorithm moves off in the same direction.
${\mathbf{ifail}}=5$
Failure to invert Hessian matrix and maxit iterations made: ${\mathbf{maxit}}=\u27e8\mathit{\text{value}}\u27e9$. This indicates a failure to invert the second derivative matrix for calculating the variance-covariance matrix of parameter estimates in the specified number of iterations. The elements of cm have been set to zero. Try restarting the calculations with a larger value for maxit.
${\mathbf{ifail}}=6$
Failure to invert Hessian matrix plus Heywood case encountered. This indicates a failure to invert the second derivative matrix for calculating the variance-covariance matrix of parameter estimates. In addition, an element of a has exceeded $10$ in absolute value. The elements of cm will have then been set to zero on exit. You are advised to restart the calculations from a different point to see whether the E-M algorithm moves off in the same direction.
${\mathbf{ifail}}=7$
${\chi}^{2}$ statistic has less than one degree of freedom. The ${\chi}^{2}$ statistic is meaningless and siglev is set to zero. All other returned information should be correct.
${\mathbf{ifail}}=-99$
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
On exit from g11saf if ${\mathbf{ifail}}={\mathbf{0}}$ or ${\mathbf{7}}$ then the following condition will be satisfied:
If ${\mathbf{ifail}}={\mathbf{3}}$ or ${\mathbf{5}}$ on exit (i.e., maxit iterations have been performed but the above condition does not hold), then the elements in a, c, alpha and pigam may still be good approximations to the maximum likelihood estimates. You are advised to inspect the elements of g to see whether this is confirmed.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g11saf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g11saf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
9.1Timing
The number of iterations required in the maximum likelihood search depends upon the number of observed variables, $p$, and the distance of the starting point you supplied from the solution. The number of multiplications and divisions performed in an iteration is proportional to $p$.
9.2Initial Estimates
You are strongly advised to use the recommended starting values for the elements of a and c. Divergence may result from values you supplied even if they are very close to the solution. Divergence may also occur when an item has nearly all its responses at one level.
9.3Heywood Cases
As in normal factor analysis, Heywood cases can often occur, particularly when $p$ is small and $n$ not very big. To overcome this difficulty the maximum likelihood search routine is terminated when the absolute value of one of the ${\alpha}_{j1}$ exceeds $10.0$.
You have the option of deciding whether to exit from g11saf (by setting ${\mathbf{ifail}}={\mathbf{0}}$ on entry) or to permit g11saf to proceed onwards as if it had exited normally from the maximum likelihood search routine (setting ${\mathbf{ifail}}=\mathrm{-1}$ on entry).
The elements in a, c, alpha and pigam may still be good approximations to the maximum likelihood estimates. You are advised to inspect the elements g to see whether this is confirmed.
9.4Goodness of Fit Statistic
When $n$ is not very large compared to $s$ a goodness-of-fit statistic should not be calculated as many of the expected frequencies will then be less than $5$.
9.5First and Second Order Margins
The observed and expected percentages of sample members responding to individual and pairs of items held in the arrays obs and expp on exit can be converted to observed and expected numbers by multiplying all elements of these two arrays by $n/100.0$.
10Example
A program to fit the logit latent variable model to the following data: