data-edu / tidyLPA

Easily carry out Latent Profile Analysis (LPA) using open-source or commercial software
https://data-edu.github.io/tidyLPA/
Other
55 stars 15 forks source link

Calculation of prob_min and prob_max? #197

Open dirkpelt opened 1 year ago

dirkpelt commented 1 year ago

Hi,

I was wondering how prob_min and prob_max are calculated, because if I manually calculate it, I get different values

Example code for a 4 class solution:

m4vv<-lpa_clean %>%
  estimate_profiles(4, variances = "varying", covariances = 'varying')
m4vv

Outputs:

 Model Classes AIC       BIC       Entropy prob_min prob_max n_min n_max BLRT_p
 6     4       269261.85 270151.02 0.89    0.89     1.00     0.14  0.32  0.01

Own calculation:

dat_m4vv<-get_data(m4vv)

cm4<-dat_m4vv %>%
  group_by(Class) %>%
  summarise_at(vars( c(CPROB1,CPROB2,CPROB3,CPROB4) ), list(mean = mean)) %>%
  ungroup()
cm4$Class<-NULL
diag(as.matrix(cm4))

Outputs: [1] 0.9449972 0.9884853 0.8585581 0.9761004

Here the minimum and maximum seem to be .86 and .99. Or am I confused on what prob_min and prob_max are?

Best, Dirk