This page addresses FAQs about our LCA software. For general questions about latent class modeling, see the LCA FAQ.
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 send an email to MChelpdesk@psu.edu describing the error message as well as information regarding your operating system and SAS version. If you have a problem at step (6), please read the next item for a solution.
What do I do if the installation is not successful?
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:
- 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
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
3. Put the following three files in the folder where the file SAS.exe is located.
- 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).
If the above steps still don’t fix this installation problem, please send an email to MChelpdesk@psu.edu. In your email, please
(1) copy/paste the error message you received,
(2) describe your SAS version (e.g., SAS9.2, 32 bit), and
(3) describe your operating system (e.g., Windows 7 64 bit). For information regarding your operating system, issue the following command in SAS,
“%put SAS SYSSCPL=&SYSSCPL., SYSVLOG=&SYSVLONG;”
and send us the output (in the log window) of this command.
Can the PROC LCA and PROC LTA be installed on a UNIX/LINUX version of SAS?
Not at this time. PROC LCA and PROC LTA are only available for SAS V9 for Windows.
Using PROC LCA/LTA or LCA Stata Plugin
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, or even more. 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.
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.
Does this software produce standard errors and/or confidence intervals?
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.
Can I obtain the predicted probability of membership in each latent class/status for each individual?
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.
Can the expected frequency table be output?
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).
How do I calculate the significance test for a covariate by hand?
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.
Version 1.2.6 or higher of PROC LCA can account for sampling weights and clusters. PROC LTA cannot incorporate sampling weights at this time. If you are currently running an older version of PROC LCA and wish to upgrade, you can download the latest version here.
Does this software handle missing data?
Yes, PROC LCA and PROC LTA handle missing 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.
Can I use PROC LCA or PROC LTA to do latent trajectories 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. If you do not see the error message below, send an email to MChelpdesk@psu.edu for help with troubleshooting.
‘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 of one of the two files you need to run PROC LCA. To fix it, redownload the PROC LCA installation file from the Methodology Center’s website to your desktop. Then, open the *.zip file and rerun the setup.msi program. Doing so should restart the installer. When the appropriate window appears, click the “Repair” option. Then, finish the installation as directed by the installer. Once you have reinstalled, rerun your SAS PROC LCA program.
(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.
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.