This page addresses FAQs about PROC LCA and PROC LTA in SAS software. For general questions about latent class and latent transition modeling, see the LCA and LTA Modeling FAQs.

Installation of PROC LCA/LTA

PROC LCA/LTA is an add-on software to SAS V9 for Windows. To install PROC LCA/LTA properly, you should

  • have SAS 9.x installed on my computer (Windows system),
  • download the proper version of the procedures for your versions of SAS and Windows,
  • unzip proc_lca_lta_XXXXX_setup.zip,
  • run the file “proc_lca_lta_XXXX.msi”,
  • follow the steps until completion,
  • open SAS, and
  • run a PROC LCA/LTA example code to test your installation.

If you can run the example code (e.g., example 1 in the users’ guide) without error message, congratulations! Your installation of PROC LCA/LTA is successful. If you have a problem at step (4), please refer to the installation guide for your software. After verifying that you installed the correct version of PROC LCA/LTA, please read the next item for a solution.

If you get error messages like “ERROR: Procedure LCA not found,” the most likely cause is that the PROC LCA files were put in a place where your version of SAS cannot find them. The following steps have fixed most installation problems.

1. Use your search to see if the following five files are stored anywhere on your computer:

  • lca.dll
  • lta.dll
  • liblta.dll
  • libiomp5md.dll
  • msvcr71.dll (not present for 64-bit SAS installations)

Assuming that the download of the installer went well and you extracted the installer, these files should be saved somewhere on your PC. NOTE: Your search default may search only a portion of your hard drive. Please alter your search settings to search for items on ALL drives.

2. Use search to find the file SAS.exe

NOTE: SAS.exe is probably located in one of the following folders:

C:\Program Files\SAS\SAS 9.x,
C:\Program Files\SAS\SASFoundation\9.x, or
C:\Program Files\SASHome\x86\SASFoundation\9.x

NOTE: If you are able to use one of the folders listed in step 2, the corresponding subdirectories will be

C:\Program Files\SAS\SAS 9.x\core\sasexe\,
C:\Program Files\SAS\SASFoundation\9.x\core\sasexe\, or
C:\Program Files\SASHome\x86\SASFoundation\9.3\core\sasexe\

3. Put the following three files in the folder where the file SAS.exe is located.

  • liblta.dll
  • libiomp5md.dll
  • msvcr71.dll (32-bit SAS only)

4. Put the following two files in the \core\sasexe\ subdirectory, which will be in the folder with the file SAS.exe (the folder you identified in step 2).

  • lca.dll
  • lta.dll

If the above steps still don’t fix this installation problem, please verify that you installed the correct version of the procedure. Then, uninstall/reinstall the PROC.

PROC LCA and PROC LTA are only available for SAS V9 for Windows.

Using PROC LCA/LTA or LCA Stata Plugin

Input

The limit on the number of indicators PROC LCA or PROC LTA can handle is 999. However, as you add indicators the size of the contingency table (and often model complexity) increases substantially. Depending on the model and data, it may be possible to include up to 20 or 30 indicators. Other models cannot handle more than a handful. If you get an error message about the estimation engine not being able to fit the saturated model when you have a large number of indicators and/or response categories, see below.

How many measurement occasions can PROC LTA handle?
The limit on the number of measurement occasions that PROC LTA can handle is 99. However, practical limitations driven by the amount of memory on the computer and sparseness of the raw data contingency table exist. For these practical reasons, typical users specify five or fewer occasions of measurement.

Output

The AIC and BIC are penalized log-likelihood (LL) information criteria. The penalty for the AIC is two times the number of estimated parameters, and the penalty for the BIC is log(N) times the number of estimated parameters. In PROC LCA, the G2 statistic is penalized. The G2 equals -2(LL overall model – LL saturated model). Because the LL for the saturated model is a constant for a given data set, basing the AIC and BIC on this statistic is equivalent to basing it on -2LL of the overall model. Because the AIC and BIC are based on the G2 statistic, they will not necessarily match those from other software packages if they are based on the LL.

Yes. Standard errors are now provided where possible in the current version PROC LCA (but not PROC LTA). They can also be saved to a dataset using the OUTSTDERR option. Given the estimated standard errors of parameters, one can readily calculate the confidence intervals.

Yes. Posterior probabilities of class or status membership are available by using the OUTPOST option in PROC LCA and PROC LTA. See the users’ guide for details on the syntax. If the goal is to assign individuals to a latent class based on their predicted probabilities and link class membership to outcomes, note that this approach does not incorporate the uncertainty of class membership into the analysis, thus biasing inference.

Although the OUTPOST statement generates posterior probabilities, there is no expected frequency table output. It is not possible to get the frequency distribution of class assignment from the PROC LCA output. However, interested users can calculate them easily by saving the posterior probabilities to a SAS data file using the OUTPOST option. Then, in a SAS data step, individuals can be assigned to the class with the highest posterior probability. In fact, there are numerous straight-forward calculations one may wish to do using the posterior probabilities, including the calculation for entropy and the odds of correct classification (as described in Nagin, 2005).

Significance tests are conducted as follows:

  • Fit a model with all covariates of interest; save loglikelihood as ‘loglik’
  • For each covariate, fit the model with that covariate removed; save loglikelihood as ‘ll_beta_test’ (the rest of the steps are done for each covariate)
  • delta2ll = ( 2 * loglik ) – ( 2 * ll_beta_test )
  • df = ( number of latent classes – 1 ) * ( number of groups ) OR, for binary regression, df = number of groups
  • Compute the CDF of a Chi-square distribution for the value ‘delta2ll’, with ‘df’ degrees of freedom. This is the p-vale for that covariate.

Advanced Features

Version 1.2.6 or higher of PROC LCA can account for sampling weights and clusters. PROC LTA cannot incorporate sampling weights. If you are currently running an older version of PROC LCA and wish to upgrade, download version 1.3.2.

Yes, PROC LCA and PROC LTA handle m cissing data on the indicators so that you can make use of all the data you have. In other words, it is not necessary to delete cases that have partial data. You just need to code all missing data as SAS system missing (.). Missing data are handled with a full-information maximum likelihood (FIML) technique. Keep in mind that this procedure assumes that data are missing at random (MAR). However, even when the MAR assumption is not met, this missing data procedure performs better than casewise deletion. Note, however, that cases missing values on one or more covariates or on the grouping variable are removed from the analysis.

No. Latent trajectories analysis is a different procedure that requires software such as MPlus or SAS Proc Traj.

Typical Error Messages

You may have gotten one of several common error messages.
Error message:

‘LCA’ is not recognized as an internal or external command operable program or batch file. In addition, the window opened C:\WINNT\system32\cmd.exe

This problem is most likely due to a failed installation. Check the first two questions at the top of this page for details about how to proceed.

Error message:

(The following errors were reported by the estimation engine.)
Argument to exp function too large
exp for gamma
OCCURRED IN: lta_mstep_beta in MOD lta_estimation
M-step for BETA failed at iteration ***.
OCCURRED IN: run_lta_em_modelfit in MOD lta_estimation

This is a numerical problem during logistic regression. It occurs when one of the beta parameters (coefficients) starts getting very large. One of the gamma parameters has gone to zero. Be sure that you have run the model without covariates to see if the number of latent classes is correct. Alternatively, there may be a problem with the way the covariates have been coded. There may be missingness in the covariates that causes an entire covariate/group combination to drop out.

Error message:

A computational error message at iteration x.

To explore problems with the specified model, you can estimate the model again, adding a statement to terminate estimation at some iteration smaller than x, for example: MAXITER x-1 where x-1 is the number of the last successful iteration prior to the error message. This may provide a clue as to parameters that are hitting boundaries (in particular, look for estimates approaching zero). You may wish to produce an optional output file (e.g., using the OUTPARAM option) so that you can examine parameter estimates with greater precision.

Troubleshooting

Here are a few links to other software packages with features related to LCA.

Last updated: 2019

Let’s stay in touch.

We are in this together. Receive an email whenever a new model or resource is added to the Knowledge Base.