Announcement

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

  • Latent Class Analyses

    Hi to everybody,
    I' ve a trouble about latent class analyses
    Nagin also recommends four other criteria of model adequacy based on the posterior probability of assignment.
    These are the average posterior probability of assignment (APPA), odds of correct classification (OCC), mismatch between estimated and assigned group probabilities, and standard deviation of group membership probabilities (SD-GMP)
    I think that your code demonstrates the first three condition (the mismatch is the differences between p and TotProb). How to verify the last (standard deviation of group membership probabilities (SD-GMP)).?

    I found this very useful code on the internet but I have some problems verifying the fourth condition

    Which is the code?
    Thanks a million in advance.


    Code:
    /****************************************************************************/
    traj, multgroups(5) model(cnorm) var(a1 a2 a3 ) indep(t1 t2 t3)  order(2 2 2 2 2) min(-6) max(9) 
    
    
    gen Mp = 0
        foreach i of varlist _traj_ProbG* {
            replace Mp = `i' if `i' > Mp 
        }
        sort _traj_Group
        *and the odds of correct classification
        by _traj_Group: gen countG = _N
        by _traj_Group: egen groupAPP = mean(Mp)
        by _traj_Group: gen counter = _n
        gen n = groupAPP/(1 - groupAPP)
        gen p = countG/ _N
        gen d = p/(1-p)
        gen occ = n/d
    list _traj_Group countG groupAPP occ if counter == 1
    *Estimated proportion for each group
        scalar f = 0
        gen TotProb = 0
        foreach i of varlist _traj_ProbG* {
           scalar f = f + 1
           quietly summarize `i'
           replace TotProb = r(sum)/ _N if _traj_Group == f
        }
        gen d_pp = TotProb/(1 - TotProb)
        gen occ_pp = n/d_pp
        
        list _traj_Group countG groupAPP occ occ_pp p TotProb if counter == 1
    drop Mp countG groupAPP counter n p d occ TotProb d_pp occ_pp


  • #2
    I write again the code to explain variables

    Code:
     *This displays the group number [_traj_~p], 
        *the count per group (based on the max post prob), [countG]
        *the average posterior probability for each group, [groupAPP]
        *the odds of correct classification (based on the max post prob group assignment), [occ] 
        *the odds of correct classification (based on the weighted post. prob), [occ_pp]
        *and the observed probability of groups versus the probability [p]
        *based on the posterior probabilities [TotProb]
    How to verify the last (standard deviation of group membership probabilities (SD-GMP)).?

    I found this very useful code on the internet but I have some problems verifying the fourth condition

    Which is the code?
    Thanks a million in advance.


    Tommaso

    Comment

    Working...
    X