Important: Read this before posting to this forum

  1. This forum is for questions related to the use of Apollo. We will answer some general choice modelling questions too, where appropriate, and time permitting. We cannot answer questions about how to estimate choice models with other software packages.
  2. There is a very detailed manual for Apollo available at http://www.ApolloChoiceModelling.com/manual.html. This contains detailed descriptions of the various Apollo functions, and numerous examples are available at http://www.ApolloChoiceModelling.com/examples.html. In addition, help files are available for all functions, using e.g. ?apollo_mnl
  3. Before asking a question on the forum, users are kindly requested to follow these steps:
    1. Check that the same issue has not already been addressed in the forum - there is a search tool.
    2. Ensure that the correct syntax has been used. For any function, detailed instructions are available directly in Apollo, e.g. by using ?apollo_mnl for apollo_mnl
    3. Check the frequently asked questions section on the Apollo website, which discusses some common issues/failures. Please see http://www.apollochoicemodelling.com/faq.html
    4. Make sure that R is using the latest official release of Apollo.
  4. If the above steps do not resolve the issue, then users should follow these steps when posting a question:
    1. provide full details on the issue, including the entire code and output, including any error messages
    2. posts will not immediately appear on the forum, but will be checked by a moderator first. This may take a day or two at busy times. There is no need to submit the post multiple times.

Error in Latent Class Model - NA

Ask questions about the results reported after estimation. If the output includes errors, please include your model code if possible.
Post Reply
eunkum
Posts: 3
Joined: 11 Apr 2022, 20:14

Error in Latent Class Model - NA

Post by eunkum »

I conducted a latent class model using Apollo to examine the following question: (What participant characteristics (e.g., sociodemographic, health status, motivation) play a role in people’s preferences for certain characteristics of a proposed physical activity reward program).

Dependent Variable=choice
Independent Variables= income_recode, age, sex, pain_recode, IPAQ_cat, IPAQ_catGoal1, IPAQ_catGoal2, BMI_recode, intrinsic, loss_score

I used the following code and got the following output. I got NA for s.e., t.rat.(0), Rob.s.e., Rob.t.rat.(0)

> rm(list = ls())
> library(apollo)
> apollo_initialise()
Apollo ignition sequence completed
> apollo_control = list(
+ modelName = "LC",
+ modelDescr = "Simple LC model on choice data",
+ indivID = "ID",
+ nCores = 2,
+ outputDirectory = "output"
+ )
> database <-read.table("C:/haysem/dataRQ1.txt", header=TRUE)

> apollo_beta = c(asc_1 = 0,
+ asc_2 = 0,
+ beta_goal_a = 0,
+ beta_goal_b = 0,
+ beta_form_a = 0,
+ beta_form_b = 0,
+ beta_mag_a = 0.2229,
+ beta_mag_b = 0.5345,
+ beta_dir_a = 0.3064,
+ beta_dir_b = -0.2296,
+ delta_a = 0,
+ delta_b = 0,
+ gamma_income_recode_a = 0.044,
+ gamma_age_a = -0.001,
+ gamma_sex_a = 0.729,
+ gamma_pain_recode_a = 21.243,
+ gamma_IPAQ_cat_a = -21.504,
+ gamma_IPAQ_catGoal1_a = 0.108,
+ gamma_IPAQ_catGoal2_a = -0.115,
+ gamma_BMI_recode_a = 0.564,
+ gamma_intrinsic_a = -0.027,
+ gamma_loss_score_a = -0.003,
+ gamma_income_recode_b = -0.005,
+ gamma_age_b = -0.002,
+ gamma_sex_b = 0.812,
+ gamma_pain_recode_b = 21.177,
+ gamma_IPAQ_cat_b = -21.399,
+ gamma_IPAQ_catGoal1_b = 0.110,
+ gamma_IPAQ_catGoal2_b = -0.116,
+ gamma_BMI_recode_b = 0.337,
+ gamma_intrinsic_b = -0.034,
+ gamma_loss_score_b = -0.003)
> apollo_fixed = c("asc_2","delta_b")
> apollo_lcPars=function(apollo_beta, apollo_inputs){
+ lcpars = list()
+
+ lcpars[["beta_goal"]] = list(beta_goal_a, beta_goal_b)
+ lcpars[["beta_form"]] = list(beta_form_a, beta_form_b)
+ lcpars[["beta_mag"]] = list(beta_mag_a, beta_mag_b)
+ lcpars[["beta_dir"]] = list(beta_dir_a, beta_dir_b)
+
+ V=list()
+ V[["class_a"]] = delta_a + gamma_income_recode_a*income_recode + gamma_age_a*age + gamma_sex_a*sex + gamma_pain_recode_a*pain_recode + gamma_IPAQ_cat_a*IPAQ_cat + gamma_IPAQ_catGoal1_a*IPAQ_catGoal1 + gamma_IPAQ_catGoal2_a*IPAQ_catGoal2 + gamma_BMI_recode_a*BMI_recode + gamma_intrinsic_a*intrinsic + gamma_loss_score_a*loss_score
+ V[["class_b"]] = delta_b + gamma_income_recode_b*income_recode + gamma_age_b*age + gamma_sex_b*sex + gamma_pain_recode_b*pain_recode + gamma_IPAQ_cat_b*IPAQ_cat + gamma_IPAQ_catGoal1_b*IPAQ_catGoal1 + gamma_IPAQ_catGoal2_b*IPAQ_catGoal2 + gamma_BMI_recode_b*BMI_recode + gamma_intrinsic_b*intrinsic + gamma_loss_score_b*loss_score
+
+ classAlloc_settings = list(
+ classes = c(class_a=1, class_b=2),
+ utilities = V
+ )
+ lcpars[["pi_values"]] = apollo_classAlloc(classAlloc_settings)
+
+ return(lcpars)
+ }
> apollo_inputs = apollo_validateInputs()
Several observations per individual detected based on the value of ID. Setting panelData in apollo_control set to TRUE.
All checks on apollo_control completed.
All checks on database completed.
>
> apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
+ apollo_attach(apollo_beta, apollo_inputs)
+ on.exit(apollo_detach(apollo_beta, apollo_inputs))
+ P = list()
+
+ mnl_settings = list(
+ alternatives = c(alt1=1, alt2=2),
+ choiceVar = choice
+ )
+ for(s in 1:2){
+
+ V=list()
+ V[["alt1"]] = asc_1 + beta_goal_a*goal1 + beta_form_a*form1 + beta_mag_a*mag1 + beta_dir_a*dir1
+ V[["alt2"]] = asc_2 + beta_goal_b*goal2 + beta_form_b*form2 + beta_mag_b*mag2 + beta_dir_b*dir2
+ mnl_settings$utilities = V
+ mnl_settings$componentName = paste0("Class_",s)
+
+ P[[paste0("Class_",s)]] = apollo_mnl(mnl_settings, functionality)
+ P[[paste0("Class_",s)]] = apollo_panelProd(P[[paste0("Class_",s)]], apollo_inputs ,functionality)
+ }
+
+ lc_settings = list(inClassProb = P, classProb=pi_values)
+ P[["model"]] = apollo_lc(lc_settings, apollo_inputs, functionality)
+
+ P = apollo_prepareProb(P, apollo_inputs, functionality)
+ return(P)
+ }
>
> model = apollo_estimate(apollo_beta, apollo_fixed, apollo_probabilities, apollo_inputs)
Preparing user-defined functions.

Testing likelihood function...
Apollo found a model component of type classAlloc without a componentName. The name was set to "classAlloc" by default.
Setting "avail" is missing, so full availability is assumed.
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component Class_1:
alt1 alt2
Times available 2470.00 2470.00
Times chosen 1157.00 1313.00
Percentage chosen overall 46.84 53.16
Percentage chosen when available 46.84 53.16
Setting "avail" is missing, so full availability is assumed.

Overview of choices for MNL model component Class_2:
alt1 alt2
Times available 2470.00 2470.00
Times chosen 1157.00 1313.00
Percentage chosen overall 46.84 53.16
Percentage chosen when available 46.84 53.16

Summary of class allocation for LC model component :
Mean prob.
Class_1 0.6380
Class_2 0.3620
Class probability for model component "model" averaged across observations of each individual.

Pre-processing likelihood function...
Preparing workers for multithreading...

Testing influence of parameters
Starting main estimation
Initial function value: -1716.13
Initial gradient value:
asc_1 beta_goal_a beta_goal_b beta_form_a beta_form_b beta_mag_a
1.207374e+02 5.641608e+01 -4.585558e+02 -1.668387e+02 -7.233187e+02 2.983956e+02
beta_mag_b beta_dir_a beta_dir_b delta_a gamma_income_recode_a gamma_age_a
-4.096166e+02 5.219715e+01 -6.854022e+01 -5.828643e-16 -4.356241e-16 -8.193604e-16
gamma_sex_a gamma_pain_recode_a gamma_IPAQ_cat_a gamma_IPAQ_catGoal1_a gamma_IPAQ_catGoal2_a gamma_BMI_recode_a
-1.118636e-15 8.119314e-17 -1.107190e-15 -2.351178e-15 -1.386013e-15 -4.876930e-17
gamma_intrinsic_a gamma_loss_score_a gamma_income_recode_b gamma_age_b gamma_sex_b gamma_pain_recode_b
9.828279e-16 1.776661e-15 -2.796812e-16 -1.778392e-14 -9.843078e-16 -8.888814e-16
gamma_IPAQ_cat_b gamma_IPAQ_catGoal1_b gamma_IPAQ_catGoal2_b gamma_BMI_recode_b gamma_intrinsic_b gamma_loss_score_b
2.125611e-15 2.355540e-15 -2.610483e-15 -2.690440e-15 1.296953e-15 -1.874143e-15
initial value 1716.129599
iter 2 value 1666.366836
iter 3 value 1320.205932
iter 4 value 1307.775265
iter 5 value 1306.819076
iter 6 value 1305.378445
iter 7 value 1302.667918
iter 8 value 1283.996380
iter 9 value 1280.597484
iter 10 value 1252.830613
iter 11 value 1247.136693
iter 12 value 1246.500501
iter 13 value 1246.493389
iter 14 value 1246.493194
iter 14 value 1246.493178
iter 14 value 1246.493178
final value 1246.493178
converged
Additional convergence test using scaled estimation. Parameters will be scaled by their current estimates and additional
iterations will be performed.
initial value 1246.493178
iter 1 value 1246.493178
final value 1246.493178
converged
Estimated parameters:
Estimate
asc_1 0.357265
asc_2 0.000000
beta_goal_a -0.507890
beta_goal_b -0.372861
beta_form_a -0.972136
beta_form_b -0.925274
beta_mag_a 0.222880
beta_mag_b 0.534484
beta_dir_a 0.485041
beta_dir_b -0.408224
delta_a -1.538e-16
delta_b 0.000000
gamma_income_recode_a 0.044000
gamma_age_a -1.0000e-03
gamma_sex_a 0.729000
gamma_pain_recode_a 21.243000
gamma_IPAQ_cat_a -21.504000
gamma_IPAQ_catGoal1_a 0.108000
gamma_IPAQ_catGoal2_a -0.115000
gamma_BMI_recode_a 0.564000
gamma_intrinsic_a -0.027000
gamma_loss_score_a -0.003000
gamma_income_recode_b -0.005000
gamma_age_b -0.002000
gamma_sex_b 0.812000
gamma_pain_recode_b 21.177000
gamma_IPAQ_cat_b -21.399000
gamma_IPAQ_catGoal1_b 0.110000
gamma_IPAQ_catGoal2_b -0.116000
gamma_BMI_recode_b 0.337000
gamma_intrinsic_b -0.034000
gamma_loss_score_b -0.003000

Computing covariance matrix using analytical gradient.
0%....25%....50%....75%...100%
ERROR: Singular Hessian, cannot calculate s.e.
Could not write hessian to a file.
WARNING: Some eigenvalues of the Hessian are complex, indicating that the Hessian is not symmetrical.
Computing score matrix...

Summary of class allocation for LC model component :
Mean prob.
Class_1 0.8246
Class_2 0.1754

Calculating LL(0) for applicable models...
Calculating LL(c) for applicable models...
Calculating LL of each model component...
>
> apollo_modelOutput(model)
Model run by Eunkum using Apollo 0.2.7 on R 4.0.0 for Windows.
www.ApolloChoiceModelling.com

Model name : LC
Model description : Simple LC model on choice data
Model run at : 2022-04-13 10:52:44
Estimation method : bfgs
Model diagnosis : successful convergence
Number of individuals : 310
Number of rows in database : 2470
Number of modelled outcomes : 2470

Number of cores used : 2
Model without mixing

LL(start) : -1716.13
LL(0, whole model) : -1712.07
LL(C, whole model) : -1707.14
LL(final, whole model) : -1246.49
Rho-square (0) : 0.2719
Adj.Rho-square (0) : 0.2544
Rho-square (C) : 0.2698
Adj.Rho-square (C) : 0.2523
AIC : 2552.99
BIC : 2727.35

LL(0,Class_1) : -1712.07
LL(final,Class_1) : -1246.49
LL(0,Class_2) : -1712.07
LL(final,Class_2) : -1246.49

Estimated parameters : 30
Time taken (hh:mm:ss) : 00:00:15.96
pre-estimation : 00:00:6.16
estimation : 00:00:1.07
post-estimation : 00:00:8.73
Iterations : 18

Unconstrained optimisation.

Estimates:
Estimate s.e. t.rat.(0) Rob.s.e. Rob.t.rat.(0)
asc_1 0.357265 NA NA NA NA
asc_2 0.000000 NA NA NA NA
beta_goal_a -0.507890 NA NA NA NA
beta_goal_b -0.372861 NA NA NA NA
beta_form_a -0.972136 NA NA NA NA
beta_form_b -0.925274 NA NA NA NA
beta_mag_a 0.222880 NA NA NA NA
beta_mag_b 0.534484 NA NA NA NA
beta_dir_a 0.485041 NA NA NA NA
beta_dir_b -0.408224 NA NA NA NA
delta_a -1.538e-16 NA NA NA NA
delta_b 0.000000 NA NA NA NA
gamma_income_recode_a 0.044000 NA NA NA NA
gamma_age_a -1.0000e-03 NA NA NA NA
gamma_sex_a 0.729000 NA NA NA NA
gamma_pain_recode_a 21.243000 NA NA NA NA
gamma_IPAQ_cat_a -21.504000 NA NA NA NA
gamma_IPAQ_catGoal1_a 0.108000 NA NA NA NA
gamma_IPAQ_catGoal2_a -0.115000 NA NA NA NA
gamma_BMI_recode_a 0.564000 NA NA NA NA
gamma_intrinsic_a -0.027000 NA NA NA NA
gamma_loss_score_a -0.003000 NA NA NA NA
gamma_income_recode_b -0.005000 NA NA NA NA
gamma_age_b -0.002000 NA NA NA NA
gamma_sex_b 0.812000 NA NA NA NA
gamma_pain_recode_b 21.177000 NA NA NA NA
gamma_IPAQ_cat_b -21.399000 NA NA NA NA
gamma_IPAQ_catGoal1_b 0.110000 NA NA NA NA
gamma_IPAQ_catGoal2_b -0.116000 NA NA NA NA
gamma_BMI_recode_b 0.337000 NA NA NA NA
gamma_intrinsic_b -0.034000 NA NA NA NA
gamma_loss_score_b -0.003000 NA NA NA NA


Summary of class allocation for LC model component :
Mean prob.
Class_1 0.8246
Class_2 0.1754

> apollo_saveOutput(model)

Old result file "output/LC_output.txt"
renamed to: "output/LC_OLD1_output.txt"
Old result file "output/LC_estimates.csv"
renamed to: "output/LC_OLD1_estimates.csv"
Old result file "output/LC_model.rds"
renamed to: "output/LC_OLD1_model.rds"
Model output saved to output/LC_output.txt
Estimates saved to output/LC_estimates.csv
Model object saved to output/LC.rds
> apollo_sink()
Writing output to file output/LC_additional_output.txt. Please run "apollo_sink()" again after finishing writing results.
>
> apollo_outOfSample(apollo_beta, apollo_fixed,
+ apollo_probabilities, apollo_inputs)
10 separate runs will be conducted, each using a random subset of 90% for estimation and the remainder for validation.
Number of individuals
- for estimation : 279
- for forecasting : 31
- in sample (total): 310
Preparing loop.
Old output files found, they will be recycled.
10 repetitions recovered from old result files. 10 new repetitions will be added.
Estimated parameters and log-likelihoods for each sample will be written to: output/LC_outOfSample_params.csv
The matrix defining the observations used in each repetition will be written to: output/LC_outOfSample_samples.csv

Estimation cycle 11 (2222 obs.)
Estimation results written to file.
Estimation cycle 12 (2222 obs.)
Estimation results written to file.
Estimation cycle 13 (2222 obs.)
Estimation results written to file.
Estimation cycle 14 (2228 obs.)
Estimation results written to file.
Estimation cycle 15 (2222 obs.)
Estimation results written to file.
Estimation cycle 16 (2222 obs.)
Estimation results written to file.
Estimation cycle 17 (2228 obs.)
Estimation results written to file.
Estimation cycle 18 (2222 obs.)
Estimation results written to file.
Estimation cycle 19 (2226 obs.)
Estimation results written to file.
Estimation cycle 20 (2222 obs.)
Estimation results written to file.
Processing time: 1.262955 mins

Outputs of out of sample testing:
LL per obs in estimation sample LL per obs in validation sample % difference
sample_1 -0.5039 -0.5127 -1.73
sample_2 -0.5114 -0.4471 12.58
sample_3 -0.4847 -0.6966 -43.70
sample_4 -0.4998 -0.5534 -10.72
sample_5 -0.5069 -0.4847 4.39
sample_6 -0.4987 -0.5605 -12.39
sample_7 -0.5009 -0.5417 -8.15
sample_8 -0.5079 -0.4774 6.02
sample_9 -0.5068 -0.4861 4.08
sample_10 -0.5099 -0.4597 9.84
sample_11 -0.5004 -0.5486 -9.64
sample_12 -0.5066 -0.4893 3.42
sample_13 -0.4984 -0.5633 -13.03
sample_14 -0.5073 -0.4816 5.07
sample_15 -0.5015 -0.5344 -6.56
sample_16 -0.5052 -0.5017 0.70
sample_17 -0.5006 -0.5430 -8.46
sample_18 -0.5033 -0.5186 -3.05
sample_19 -0.5087 -0.4690 7.81
sample_20 -0.5057 -0.4982 1.48
Average -0.5034 -0.5184 -3.10
> apollo_bootstrap(apollo_beta, apollo_fixed,apollo_probabilities, apollo_inputs)
30 new datasets will be constructed by randomly sampling 310 individuals with replacement from the original dataset.
Not all individuals have the same number of observations, therefore not all generated datasets may have the same number of
observations.
Preparing bootstrap.
File output/LC_bootstrap_params.csv found in the working/output directory.
File output/LC_bootstrap_samples.csv found in the working/output directory.
New bootstrap repetitions will be added to the existing results.
Parameters and LL in each repetition will be written to: output/LC_bootstrap_params.csv
Vectors showing sampling rate for each observation in each repetition written to: output/LC_bootstrap_samples.csv

Estimation cycle 1 (2476 obs)
Estimation results written to file.
Estimation cycle 2 (2480 obs)
Estimation results written to file.
Estimation cycle 3 (2460 obs)
Estimation results written to file.
Estimation cycle 4 (2476 obs)
Estimation results written to file.
Estimation cycle 5 (2470 obs)
Estimation results written to file.
Estimation cycle 6 (2462 obs)
Estimation results written to file.
Estimation cycle 7 (2458 obs)
Estimation results written to file.
Estimation cycle 8 (2464 obs)
Estimation results written to file.
Estimation cycle 9 (2458 obs)
Estimation results written to file.
Estimation cycle 10 (2480 obs)
Estimation results written to file.
Estimation cycle 11 (2476 obs)
Estimation results written to file.
Estimation cycle 12 (2468 obs)
Estimation results written to file.
Estimation cycle 13 (2466 obs)
Estimation results written to file.
Estimation cycle 14 (2462 obs)
Estimation results written to file.
Estimation cycle 15 (2472 obs)
Estimation results written to file.
Estimation cycle 16 (2480 obs)
Estimation results written to file.
Estimation cycle 17 (2474 obs)
Estimation results written to file.
Estimation cycle 18 (2458 obs)
Estimation results written to file.
Estimation cycle 19 (2470 obs)
Estimation results written to file.
Estimation cycle 20 (2464 obs)
Estimation results written to file.
Estimation cycle 21 (2476 obs)
Estimation results written to file.
Estimation cycle 22 (2470 obs)
Estimation results written to file.
Estimation cycle 23 (2476 obs)
Estimation results written to file.
Estimation cycle 24 (2468 obs)
Estimation results written to file.
Estimation cycle 25 (2474 obs)
Estimation results written to file.
Estimation cycle 26 (2476 obs)
Estimation results written to file.
Estimation cycle 27 (2470 obs)
Estimation results written to file.
Estimation cycle 28 (2476 obs)
Estimation results written to file.
Estimation cycle 29 (2470 obs)
Estimation results written to file.
Estimation cycle 30 (2468 obs)
Estimation results written to file.

Finished bootstrap runs.
Parameters and LL for each repetition written to: output/LC_bootstrap_params.csv
Vectors showing sampling rate for each observation in each repetition written to: output/LC_bootstrap_samples.csv
Covariance matrix of parameters written to: output/LC_bootstrap_vcov.csv

Mean LL across runs: -1247.09
Mean parameter values across runs:
Estimate
asc_1 0.4343
asc_2 0.0000
beta_goal_a -0.5281
beta_goal_b -0.3791
beta_form_a -0.9890
beta_form_b -0.9290
beta_mag_a 0.2459
beta_mag_b 0.5227
beta_dir_a 0.3983
beta_dir_b -0.3041
delta_a 0.0000
delta_b 0.0000
gamma_income_recode_a 0.0220
gamma_age_a -0.0005
gamma_sex_a 0.3645
gamma_pain_recode_a 10.6215
gamma_IPAQ_cat_a -10.7520
gamma_IPAQ_catGoal1_a 0.0540
gamma_IPAQ_catGoal2_a -0.0575
gamma_BMI_recode_a 0.2820
gamma_intrinsic_a -0.0135
gamma_loss_score_a -0.0015
gamma_income_recode_b -0.0025
gamma_age_b -0.0010
gamma_sex_b 0.4060
gamma_pain_recode_b 10.5885
gamma_IPAQ_cat_b -10.6995
gamma_IPAQ_catGoal1_b 0.0550
gamma_IPAQ_catGoal2_b -0.0580
gamma_BMI_recode_b 0.1685
gamma_intrinsic_b -0.0170
gamma_loss_score_b -0.0015
Covariance matrix across runs:
asc_1 beta_goal_a beta_goal_b beta_form_a beta_form_b
asc_1 1.224e-01 -6.741e-03 -4.948e-03 -2.595e-02 1.080e-02
beta_goal_a -6.741e-03 6.089e-03 -2.668e-03 1.247e-03 1.289e-03
beta_goal_b -4.948e-03 -2.668e-03 8.256e-03 2.957e-03 -3.061e-03
beta_form_a -2.595e-02 1.247e-03 2.957e-03 9.706e-03 -2.199e-03
beta_form_b 1.080e-02 1.289e-03 -3.061e-03 -2.199e-03 5.700e-03
beta_mag_a -1.859e-02 -2.524e-03 3.681e-03 1.951e-03 -2.792e-03
beta_mag_b 2.373e-02 1.268e-03 -3.804e-03 -4.426e-03 1.962e-03
beta_dir_a 5.001e-02 -2.033e-03 -3.630e-03 -9.707e-03 7.658e-03
beta_dir_b -3.500e-02 3.310e-03 -9.474e-04 5.085e-03 -4.114e-03
delta_a 8.445e-17 -3.005e-17 5.808e-18 5.876e-18 4.984e-18
gamma_income_recode_a -3.070e-03 1.148e-04 1.859e-04 9.161e-04 7.962e-05
gamma_age_a 6.977e-05 -2.608e-06 -4.226e-06 -2.082e-05 -1.810e-06
gamma_sex_a -5.086e-02 1.902e-03 3.081e-03 1.518e-02 1.319e-03
gamma_pain_recode_a -1.482e+00 5.541e-02 8.977e-02 4.423e-01 3.844e-02
gamma_IPAQ_cat_a 1.500e+00 -5.609e-02 -9.088e-02 -4.477e-01 -3.891e-02
gamma_IPAQ_catGoal1_a -7.535e-03 2.817e-04 4.564e-04 2.249e-03 1.954e-04
gamma_IPAQ_catGoal2_a 8.024e-03 -3.000e-04 -4.860e-04 -2.394e-03 -2.081e-04
gamma_BMI_recode_a -3.935e-02 1.471e-03 2.383e-03 1.174e-02 1.021e-03
gamma_intrinsic_a 1.884e-03 -7.043e-05 -1.141e-04 -5.621e-04 -4.886e-05
gamma_loss_score_a 2.093e-04 -7.825e-06 -1.268e-05 -6.246e-05 -5.429e-06
gamma_income_recode_b 3.489e-04 -1.304e-05 -2.113e-05 -1.041e-04 -9.048e-06
gamma_age_b 1.395e-04 -5.217e-06 -8.452e-06 -4.164e-05 -3.619e-06
gamma_sex_b -5.665e-02 2.118e-03 3.432e-03 1.691e-02 1.469e-03
gamma_pain_recode_b -1.478e+00 5.524e-02 8.949e-02 4.409e-01 3.832e-02
gamma_IPAQ_cat_b 1.493e+00 -5.582e-02 -9.043e-02 -4.455e-01 -3.872e-02
gamma_IPAQ_catGoal1_b -7.675e-03 2.869e-04 4.649e-04 2.290e-03 1.991e-04
gamma_IPAQ_catGoal2_b 8.093e-03 -3.026e-04 -4.902e-04 -2.415e-03 -2.099e-04
gamma_BMI_recode_b -2.351e-02 8.791e-04 1.424e-03 7.016e-03 6.098e-04
gamma_intrinsic_b 2.372e-03 -8.869e-05 -1.437e-04 -7.079e-04 -6.153e-05
gamma_loss_score_b 2.093e-04 -7.825e-06 -1.268e-05 -6.246e-05 -5.429e-06
beta_mag_a beta_mag_b beta_dir_a beta_dir_b delta_a
asc_1 -1.859e-02 2.373e-02 5.001e-02 -3.500e-02 8.445e-17
beta_goal_a -2.524e-03 1.268e-03 -2.033e-03 3.310e-03 -3.005e-17
beta_goal_b 3.681e-03 -3.804e-03 -3.630e-03 -9.474e-04 5.808e-18
beta_form_a 1.951e-03 -4.426e-03 -9.707e-03 5.085e-03 5.876e-18
beta_form_b -2.792e-03 1.962e-03 7.658e-03 -4.114e-03 4.984e-18
beta_mag_a 9.841e-03 -5.888e-03 -1.326e-02 9.285e-03 -3.788e-17
beta_mag_b -5.888e-03 9.660e-03 1.254e-02 -8.185e-03 8.247e-18
beta_dir_a -1.326e-02 1.254e-02 3.973e-02 -2.676e-02 5.785e-17
beta_dir_b 9.285e-03 -8.185e-03 -2.676e-02 2.741e-02 -8.839e-17
delta_a -3.788e-17 8.247e-18 5.785e-17 -8.839e-17 3.915e-30
gamma_income_recode_a -3.252e-04 -2.467e-04 1.353e-03 -1.573e-03 5.072e-18
gamma_age_a 7.392e-06 5.607e-06 -3.074e-05 3.576e-05 -1.153e-19
gamma_sex_a -5.389e-03 -4.088e-03 2.241e-02 -2.607e-02 8.403e-17
gamma_pain_recode_a -1.570e-01 -1.191e-01 6.531e-01 -7.596e-01 2.449e-15
gamma_IPAQ_cat_a 1.590e-01 1.206e-01 -6.611e-01 7.689e-01 -2.479e-15
gamma_IPAQ_catGoal1_a -7.983e-04 -6.056e-04 3.320e-03 -3.862e-03 1.245e-17
gamma_IPAQ_catGoal2_a 8.501e-04 6.448e-04 -3.536e-03 4.112e-03 -1.326e-17
gamma_BMI_recode_a -4.169e-03 -3.163e-03 1.734e-02 -2.017e-02 6.501e-17
gamma_intrinsic_a 1.996e-04 1.514e-04 -8.301e-04 9.654e-04 -3.112e-18
gamma_loss_score_a 2.218e-05 1.682e-05 -9.223e-05 1.073e-04 -3.458e-19
gamma_income_recode_b 3.696e-05 2.804e-05 -1.537e-04 1.788e-04 -5.764e-19
gamma_age_b 1.478e-05 1.121e-05 -6.149e-05 7.151e-05 -2.305e-19
gamma_sex_b -6.002e-03 -4.553e-03 2.496e-02 -2.903e-02 9.360e-17
gamma_pain_recode_b -1.565e-01 -1.187e-01 6.511e-01 -7.572e-01 2.441e-15
gamma_IPAQ_cat_b 1.582e-01 1.200e-01 -6.579e-01 7.651e-01 -2.467e-15
gamma_IPAQ_catGoal1_b -8.131e-04 -6.168e-04 3.382e-03 -3.933e-03 1.268e-17
gamma_IPAQ_catGoal2_b 8.575e-04 6.505e-04 -3.566e-03 4.148e-03 -1.337e-17
gamma_BMI_recode_b -2.491e-03 -1.890e-03 1.036e-02 -1.205e-02 3.885e-17
gamma_intrinsic_b 2.513e-04 1.907e-04 -1.045e-03 1.216e-03 -3.919e-18
gamma_loss_score_b 2.218e-05 1.682e-05 -9.223e-05 1.073e-04 -3.458e-19
gamma_income_recode_a gamma_age_a gamma_sex_a gamma_pain_recode_a gamma_IPAQ_cat_a
asc_1 -3.070e-03 6.977e-05 -5.086e-02 -1.482e+00 1.500e+00
beta_goal_a 1.148e-04 -2.608e-06 1.902e-03 5.541e-02 -5.609e-02
beta_goal_b 1.859e-04 -4.226e-06 3.081e-03 8.977e-02 -9.088e-02
beta_form_a 9.161e-04 -2.082e-05 1.518e-02 4.423e-01 -4.477e-01
beta_form_b 7.962e-05 -1.810e-06 1.319e-03 3.844e-02 -3.891e-02
beta_mag_a -3.252e-04 7.392e-06 -5.389e-03 -1.570e-01 1.590e-01
beta_mag_b -2.467e-04 5.607e-06 -4.088e-03 -1.191e-01 1.206e-01
beta_dir_a 1.353e-03 -3.074e-05 2.241e-02 6.531e-01 -6.611e-01
beta_dir_b -1.573e-03 3.576e-05 -2.607e-02 -7.596e-01 7.689e-01
delta_a 5.072e-18 -1.153e-19 8.403e-17 2.449e-15 -2.479e-15
gamma_income_recode_a 4.922e-04 -1.119e-05 8.155e-03 2.376e-01 -2.406e-01
gamma_age_a -1.119e-05 2.542e-07 -1.853e-04 -5.401e-03 5.467e-03
gamma_sex_a 8.155e-03 -1.853e-04 1.351e-01 3.937e+00 -3.986e+00
gamma_pain_recode_a 2.376e-01 -5.401e-03 3.937e+00 1.147e+02 -1.161e+02
gamma_IPAQ_cat_a -2.406e-01 5.467e-03 -3.986e+00 -1.161e+02 1.176e+02
gamma_IPAQ_catGoal1_a 1.208e-03 -2.746e-05 2.002e-02 5.833e-01 -5.904e-01
gamma_IPAQ_catGoal2_a -1.286e-03 2.924e-05 -2.131e-02 -6.211e-01 6.287e-01
gamma_BMI_recode_a 6.309e-03 -1.434e-04 1.045e-01 3.046e+00 -3.083e+00
gamma_intrinsic_a -3.020e-04 6.864e-06 -5.004e-03 -1.458e-01 1.476e-01
gamma_loss_score_a -3.356e-05 7.627e-07 -5.560e-04 -1.620e-02 1.640e-02
gamma_income_recode_b -5.593e-05 1.271e-06 -9.267e-04 -2.700e-02 2.734e-02
gamma_age_b -2.237e-05 5.085e-07 -3.707e-04 -1.080e-02 1.093e-02
gamma_sex_b 9.083e-03 -2.064e-04 1.505e-01 4.385e+00 -4.439e+00
gamma_pain_recode_b 2.369e-01 -5.384e-03 3.925e+00 1.144e+02 -1.158e+02
gamma_IPAQ_cat_b -2.394e-01 5.440e-03 -3.966e+00 -1.156e+02 1.170e+02
gamma_IPAQ_catGoal1_b 1.231e-03 -2.797e-05 2.039e-02 5.941e-01 -6.014e-01
gamma_IPAQ_catGoal2_b -1.298e-03 2.949e-05 -2.150e-02 -6.265e-01 6.342e-01
gamma_BMI_recode_b 3.770e-03 -8.568e-05 6.246e-02 1.820e+00 -1.842e+00
gamma_intrinsic_b -3.803e-04 8.644e-06 -6.302e-03 -1.836e-01 1.859e-01
gamma_loss_score_b -3.356e-05 7.627e-07 -5.560e-04 -1.620e-02 1.640e-02
gamma_IPAQ_catGoal1_a gamma_IPAQ_catGoal2_a gamma_BMI_recode_a gamma_intrinsic_a gamma_loss_score_a
asc_1 -7.535e-03 8.024e-03 -3.935e-02 1.884e-03 2.093e-04
beta_goal_a 2.817e-04 -3.000e-04 1.471e-03 -7.043e-05 -7.825e-06
beta_goal_b 4.564e-04 -4.860e-04 2.383e-03 -1.141e-04 -1.268e-05
beta_form_a 2.249e-03 -2.394e-03 1.174e-02 -5.621e-04 -6.246e-05
beta_form_b 1.954e-04 -2.081e-04 1.021e-03 -4.886e-05 -5.429e-06
beta_mag_a -7.983e-04 8.501e-04 -4.169e-03 1.996e-04 2.218e-05
beta_mag_b -6.056e-04 6.448e-04 -3.163e-03 1.514e-04 1.682e-05
beta_dir_a 3.320e-03 -3.536e-03 1.734e-02 -8.301e-04 -9.223e-05
beta_dir_b -3.862e-03 4.112e-03 -2.017e-02 9.654e-04 1.073e-04
delta_a 1.245e-17 -1.326e-17 6.501e-17 -3.112e-18 -3.458e-19
gamma_income_recode_a 1.208e-03 -1.286e-03 6.309e-03 -3.020e-04 -3.356e-05
gamma_age_a -2.746e-05 2.924e-05 -1.434e-04 6.864e-06 7.627e-07
gamma_sex_a 2.002e-02 -2.131e-02 1.045e-01 -5.004e-03 -5.560e-04
gamma_pain_recode_a 5.833e-01 -6.211e-01 3.046e+00 -1.458e-01 -1.620e-02
gamma_IPAQ_cat_a -5.904e-01 6.287e-01 -3.083e+00 1.476e-01 1.640e-02
gamma_IPAQ_catGoal1_a 2.965e-03 -3.158e-03 1.549e-02 -7.414e-04 -8.237e-05
gamma_IPAQ_catGoal2_a -3.158e-03 3.362e-03 -1.649e-02 7.894e-04 8.771e-05
gamma_BMI_recode_a 1.549e-02 -1.649e-02 8.087e-02 -3.872e-03 -4.302e-04
gamma_intrinsic_a -7.414e-04 7.894e-04 -3.872e-03 1.853e-04 2.059e-05
gamma_loss_score_a -8.237e-05 8.771e-05 -4.302e-04 2.059e-05 2.288e-06
gamma_income_recode_b -1.373e-04 1.462e-04 -7.169e-04 3.432e-05 3.814e-06
gamma_age_b -5.492e-05 5.847e-05 -2.868e-04 1.373e-05 1.525e-06
gamma_sex_b 2.230e-02 -2.374e-02 1.164e-01 -5.574e-03 -6.193e-04
gamma_pain_recode_b 5.815e-01 -6.192e-01 3.037e+00 -1.454e-01 -1.615e-02
gamma_IPAQ_cat_b -5.876e-01 6.256e-01 -3.068e+00 1.469e-01 1.632e-02
gamma_IPAQ_catGoal1_b 3.020e-03 -3.216e-03 1.577e-02 -7.551e-04 -8.390e-05
gamma_IPAQ_catGoal2_b -3.185e-03 3.392e-03 -1.663e-02 7.963e-04 8.847e-05
gamma_BMI_recode_b 9.253e-03 -9.853e-03 4.832e-02 -2.313e-03 -2.570e-04
gamma_intrinsic_b -9.336e-04 9.941e-04 -4.875e-03 2.334e-04 2.593e-05
gamma_loss_score_b -8.237e-05 8.771e-05 -4.302e-04 2.059e-05 2.288e-06
gamma_income_recode_b gamma_age_b gamma_sex_b gamma_pain_recode_b gamma_IPAQ_cat_b
asc_1 3.489e-04 1.395e-04 -5.665e-02 -1.478e+00 1.493e+00
beta_goal_a -1.304e-05 -5.217e-06 2.118e-03 5.524e-02 -5.582e-02
beta_goal_b -2.113e-05 -8.452e-06 3.432e-03 8.949e-02 -9.043e-02
beta_form_a -1.041e-04 -4.164e-05 1.691e-02 4.409e-01 -4.455e-01
beta_form_b -9.048e-06 -3.619e-06 1.469e-03 3.832e-02 -3.872e-02
beta_mag_a 3.696e-05 1.478e-05 -6.002e-03 -1.565e-01 1.582e-01
beta_mag_b 2.804e-05 1.121e-05 -4.553e-03 -1.187e-01 1.200e-01
beta_dir_a -1.537e-04 -6.149e-05 2.496e-02 6.511e-01 -6.579e-01
beta_dir_b 1.788e-04 7.151e-05 -2.903e-02 -7.572e-01 7.651e-01
delta_a -5.764e-19 -2.305e-19 9.360e-17 2.441e-15 -2.467e-15
gamma_income_recode_a -5.593e-05 -2.237e-05 9.083e-03 2.369e-01 -2.394e-01
gamma_age_a 1.271e-06 5.085e-07 -2.064e-04 -5.384e-03 5.440e-03
gamma_sex_a -9.267e-04 -3.707e-04 1.505e-01 3.925e+00 -3.966e+00
gamma_pain_recode_a -2.700e-02 -1.080e-02 4.385e+00 1.144e+02 -1.156e+02
gamma_IPAQ_cat_a 2.734e-02 1.093e-02 -4.439e+00 -1.158e+02 1.170e+02
gamma_IPAQ_catGoal1_a -1.373e-04 -5.492e-05 2.230e-02 5.815e-01 -5.876e-01
gamma_IPAQ_catGoal2_a 1.462e-04 5.847e-05 -2.374e-02 -6.192e-01 6.256e-01
gamma_BMI_recode_a -7.169e-04 -2.868e-04 1.164e-01 3.037e+00 -3.068e+00
gamma_intrinsic_a 3.432e-05 1.373e-05 -5.574e-03 -1.454e-01 1.469e-01
gamma_loss_score_a 3.814e-06 1.525e-06 -6.193e-04 -1.615e-02 1.632e-02
gamma_income_recode_b 6.356e-06 2.542e-06 -1.032e-03 -2.692e-02 2.720e-02
gamma_age_b 2.542e-06 1.017e-06 -4.129e-04 -1.077e-02 1.088e-02
gamma_sex_b -1.032e-03 -4.129e-04 1.676e-01 4.372e+00 -4.418e+00
gamma_pain_recode_b -2.692e-02 -1.077e-02 4.372e+00 1.140e+02 -1.152e+02
gamma_IPAQ_cat_b 2.720e-02 1.088e-02 -4.418e+00 -1.152e+02 1.164e+02
gamma_IPAQ_catGoal1_b -1.398e-04 -5.593e-05 2.271e-02 5.922e-01 -5.984e-01
gamma_IPAQ_catGoal2_b 1.475e-04 5.898e-05 -2.395e-02 -6.245e-01 6.311e-01
gamma_BMI_recode_b -4.284e-04 -1.714e-04 6.957e-02 1.814e+00 -1.833e+00
gamma_intrinsic_b 4.322e-05 1.729e-05 -7.019e-03 -1.831e-01 1.850e-01
gamma_loss_score_b 3.814e-06 1.525e-06 -6.193e-04 -1.615e-02 1.632e-02
gamma_IPAQ_catGoal1_b gamma_IPAQ_catGoal2_b gamma_BMI_recode_b gamma_intrinsic_b gamma_loss_score_b
asc_1 -7.675e-03 8.093e-03 -2.351e-02 2.372e-03 2.093e-04
beta_goal_a 2.869e-04 -3.026e-04 8.791e-04 -8.869e-05 -7.825e-06
beta_goal_b 4.649e-04 -4.902e-04 1.424e-03 -1.437e-04 -1.268e-05
beta_form_a 2.290e-03 -2.415e-03 7.016e-03 -7.079e-04 -6.246e-05
beta_form_b 1.991e-04 -2.099e-04 6.098e-04 -6.153e-05 -5.429e-06
beta_mag_a -8.131e-04 8.575e-04 -2.491e-03 2.513e-04 2.218e-05
beta_mag_b -6.168e-04 6.505e-04 -1.890e-03 1.907e-04 1.682e-05
beta_dir_a 3.382e-03 -3.566e-03 1.036e-02 -1.045e-03 -9.223e-05
beta_dir_b -3.933e-03 4.148e-03 -1.205e-02 1.216e-03 1.073e-04
delta_a 1.268e-17 -1.337e-17 3.885e-17 -3.919e-18 -3.458e-19
gamma_income_recode_a 1.231e-03 -1.298e-03 3.770e-03 -3.803e-04 -3.356e-05
gamma_age_a -2.797e-05 2.949e-05 -8.568e-05 8.644e-06 7.627e-07
gamma_sex_a 2.039e-02 -2.150e-02 6.246e-02 -6.302e-03 -5.560e-04
gamma_pain_recode_a 5.941e-01 -6.265e-01 1.820e+00 -1.836e-01 -1.620e-02
gamma_IPAQ_cat_a -6.014e-01 6.342e-01 -1.842e+00 1.859e-01 1.640e-02
gamma_IPAQ_catGoal1_a 3.020e-03 -3.185e-03 9.253e-03 -9.336e-04 -8.237e-05
gamma_IPAQ_catGoal2_a -3.216e-03 3.392e-03 -9.853e-03 9.941e-04 8.771e-05
gamma_BMI_recode_a 1.577e-02 -1.663e-02 4.832e-02 -4.875e-03 -4.302e-04
gamma_intrinsic_a -7.551e-04 7.963e-04 -2.313e-03 2.334e-04 2.059e-05
gamma_loss_score_a -8.390e-05 8.847e-05 -2.570e-04 2.593e-05 2.288e-06
gamma_income_recode_b -1.398e-04 1.475e-04 -4.284e-04 4.322e-05 3.814e-06
gamma_age_b -5.593e-05 5.898e-05 -1.714e-04 1.729e-05 1.525e-06
gamma_sex_b 2.271e-02 -2.395e-02 6.957e-02 -7.019e-03 -6.193e-04
gamma_pain_recode_b 5.922e-01 -6.245e-01 1.814e+00 -1.831e-01 -1.615e-02
gamma_IPAQ_cat_b -5.984e-01 6.311e-01 -1.833e+00 1.850e-01 1.632e-02
gamma_IPAQ_catGoal1_b 3.076e-03 -3.244e-03 9.425e-03 -9.508e-04 -8.390e-05
gamma_IPAQ_catGoal2_b -3.244e-03 3.421e-03 -9.939e-03 1.003e-03 8.847e-05
gamma_BMI_recode_b 9.425e-03 -9.939e-03 2.887e-02 -2.913e-03 -2.570e-04
gamma_intrinsic_b -9.508e-04 1.003e-03 -2.913e-03 2.939e-04 2.593e-05
gamma_loss_score_b -8.390e-05 8.847e-05 -2.570e-04 2.593e-05 2.288e-06
Bootstrap processing time: 3.993056 mins
>
stephanehess
Site Admin
Posts: 977
Joined: 24 Apr 2020, 16:29

Re: Error in Latent Class Model - NA

Post by stephanehess »

It looks like you model is potentially overspecified or not empiricall identified. But difficult to diagnose without knowing the data myself

Have a look at the estimates. The large values look suspicious

Code: Select all

gamma_pain_recode_a 21.243000 NA NA NA NA
gamma_IPAQ_cat_a -21.504000 NA NA NA NA
--------------------------------
Stephane Hess
www.stephanehess.me.uk
Post Reply