Dear TidyLPA-ers,
First, thanks so much for developing the tidyLPA package. I’ve been trying to migrate over to R from MPlus, and was really glad to find it.
Second, I’m having an issue. When I try to get a printout of my data (for subsequent analyses, when I look at comparisons across profiles), I get an error. I’ve googled around a bit but wasn’t able to come up with a solution. I also spent some time in the tidyLPA documentation to no end.
I’m including details on my code, error, output, and data below. Please don’t hesitate to let me know if I can provide anything else and/or if I should direct my question elsewhere.
Many thanks,
Corianna
****
Here’s my code
results<-opinions_clean %>%
select(acc1:feas4)%>%
single_imputation()%>%
estimate_profiles(2)%>%
get_data(results)
Here’s the output from my model (when I just call “results”)
tidyLPA analysis using mclust:
Model Classes AIC BIC Entropy prob_min prob_max n_min n_max BLRT_p
1 2 1942.10 2022.56 0.97 0.99 0.99 0.35 0.65 0.01
Here’s my error
Error in formula.default(model) : invalid formula
Here’s the plot I get when I use plot_profiles

And here’s a readout from my data, which I loaded in from SPSS using haven
> head(opinions_clean)
# A tibble: 6 x 12
acc1 acc2 acc3 acc4 app1 app2 app3 app4 feas1 feas2 feas3 feas4
<dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl> <dbl+lbl>
1 1 [1] 1 [1] 1 [1] 1 [1] 2 [2] 1 [1] 3 [3] 1 [1] 2 [2] 5 [5] 2 [2] 3 [3]
2 1 [1] 1 [1] 1 [1] 1 [1] 2 [2] 2 [2] 2 [2] 1 [1] 3 [3] 1 [1] 4 [4] 2 [2]
3 3 [3] 2 [2] 2 [2] 2 [2] 4 [4] 4 [4] 4 [4] 4 [4] 3 [3] 4 [4] 3 [3] 3 [3]
4 4 [4] 5 [5] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4] 4 [4]
5 2 [2] 2 [2] 3 [3] 3 [3] 3 [3] 3 [3] 4 [4] 2 [2] 2 [2] 2 [2] 2 [2] 4 [4]
6 2 [2] 1 [1] 1 [1] 1 [1] 3 [3] 3 [3] 4 [4] 1 [1] 4 [4] 2 [2] 4 [4] 4 [4]
--
Corianna Elizabeth Sichel, MPhil
Pre-Doctoral Psychology Fellow
Division of Prevention and Community Research
Department of Psychiatry
Yale School of Medicine
she, her, hers
--
You received this message because you are subscribed to the Google Groups "tidyLPA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tidylpa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tidylpa/MN2PR08MB5982A5D792B0DE1D105555AD90070%40MN2PR08MB5982.namprd08.prod.outlook.com.
Hi Caspar,
Thanks for your reply. I’m pretty new to R. How do you recommend I go about creating a reproducible example?
Thanks also for your note on the mixture model issue. When I started this project I was intending to use LCA, but then read something that made me think I should switch to an LPA. I looked back in my notes and can’t seem to find whatever that was, so I’ll do a bit more digging and revisit that, as well.
Best,
Corianna
Also – I should have mentioned that I got the error after running get_data(results). Thanks!
Just following up on this, as I would like to use TidyLPA in other analyses going forward but not sure why the get_data() command did not work as described. Thanks!