Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pseudo R-squared with LCLogit (latent class logit command)

    Dear Statalisters, I am new to the forum and struggling with the following issue: I am using lclogit on Stata 14.1, a command developed by Pacifico and Yoo (2013), to estimate a Latent class model.

    I am trying to find a way to compute the McFadden Pseudo R-squared for my estimation, using the formula (1 - (loglikelihood_fullmodel/loglikelihood_constantonly)).
    In other similar estimation commands (such as mixlogit) the pseudo r-square is either already computed, or both e(ll) and e (ll_0) are saved, making it possible to compute the R-squared. But it is not the case for LCLogit (I checked using ereturn, list).

    Would you have any tips/idea of how I could compute either the constant only log-likelihood, or even directly the pseudo R-squared after using LClogit ?

    Thank you in advance for your help,

    Here below my code and the ereturn list:

    Code:
    lclogit Choice_card Prob_5 Prob_25 Prob_75 Prob_95 reversibility Cut area fishing time  asc_A $best_inter, group(Card2) id(Id) nclass(2) membership(age education mangrove_use)
    lclogitml
    
    
     ereturn list
    
    scalars:
                      e(N) =  949
                     e(ll) =  -237.428347703645
               e(nclasses) =  2
                    e(N_g) =  474
                    e(N_i) =  126
                    e(bic) =  658.6354078714462
                   e(caic) =  696.6354078714462
                    e(aic) =  550.85669540729
    
    macros:
                  e(title) : "Model estimated via GLLAMM"
                    e(cmd) : "lclogitml"
             e(indepvars2) : "age education mangrove_use conservationist3 highincome"
              e(indepvars) : "Prob_5 Prob_25 Prob_75 Prob_95 reversibility Cut area fishing time asc_A.."
                 e(depvar) : "Choice_card"
                     e(id) : "Id"
                  e(group) : "Card2"
             e(properties) : "b V"
    
    matrices:
                      e(b) :  1 x 38
                      e(V) :  38 x 38
                      e(B) :  2 x 16
                      e(P) :  2 x 1
                     e(PB) :  1 x 16
                     e(CB) :  16 x 16
                    e(CMB) :  2 x 6

  • #2
    Juliette, this response is a bit late, to say the least, so I'm not sure if this will reach you.

    McFadden's pseudo-R^2 applies to logistic regression, where you're predicting a binary outcome. Latent class models predict something quite different - they predict a set of (potential) unobserved classes. I am not aware of any R^2-like statistics that apply to these models that try to explain the proportion of the variance in the outcome accounted for by the predictors. That is, I don't think the concept applies.

    I am not famliar with this particular latent class logit model, as it differs from the standard latent class model with binary indicators. I believe there is a chi-square test against a null model that applies to (I think) models with binary or ordinal indicators. I am not sure what the null model is in this context. We typically would iteratively fit models, increasing the number of classes, and then pick the one with lowest BIC. Based on my reading, I would suggest you not use AIC for comparison at all. There are statistics like entropy, which describe the degree of separation between the classes (with 1 being very strongly separated, 0 being the reverse), but entropy is not really conceptually parallel to R^2 in my mind. (I am, as always, open to being wrong. Also, I'm not sure what predicted probabilities of class membership you would use, but I think it's the posterior probability of membership given choice pattern, i.e. lclogitpr predclass, cp)
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment

    Working...
    X