TidyLPA not working - could not find function "estimate_profiles"

I am a new R user and am trying to run a latent profile analysis using the tidyLPA package. All of the variables selected are ordinal with integer values from 1-11. Missing values have already been imputed.

First 10 rows of data:

RISK1_PHMS1 RISK1_PHMS4 RISK1_PHMS6 RISK1_PHMS8 RISK1_PHMS18 RISK1_PHMS20 RISK_PHMS_SEVERITY2
1 8 5 8 9 8 8 6
2 8 4 11 6 8 10 5
3 9 9 8 9 8 9 8
4 5 6 6 3 7 6 7
5 8 9 11 6 8 8 9
6 5 5 7 8 7 7 5
7 8 3 11 4 11 4 1
8 9 3 11 4 9 9 5
9 8 10 6 11 10 10 3
10 11 3 10 6 8 6 6

m1 <- msps1 %>%
  select (RISK1_PHMS1, RISK1_PHMS4, RISK1_PHMS6, RISK1_PHMS8, RISK1_PHMS18, RISK1_PHMS20,
          RISK_PHMS_SEVERITY2) %>%
  estimate_profiles(1:5, variances="varying", covariances="varying")

Error message received is:
Error in estimate_profiles(., 1:5, variances = "varying", covariances = "varying") :
could not find function "estimate_profiles"

Can someone help me figure out why I'm receiving this error message?

Thanks,
Jennifer

I can't reproduce your issue (see reprex below), please provide a proper REPRoducible EXample (reprex) that actually shows your problem.

library(tidyLPA)
library(dplyr)

# Sample data on a copy/paste friendly format
msps1 <- data.frame(
          RISK1_PHMS1 = c(8, 8, 9, 5, 8, 5, 8, 9, 8, 11),
          RISK1_PHMS4 = c(5, 4, 9, 6, 9, 5, 3, 3, 10, 3),
          RISK1_PHMS6 = c(8, 11, 8, 6, 11, 7, 11, 11, 6, 10),
          RISK1_PHMS8 = c(9, 6, 9, 3, 6, 8, 4, 4, 11, 6),
         RISK1_PHMS18 = c(8, 8, 8, 7, 8, 7, 11, 9, 10, 8),
         RISK1_PHMS20 = c(8, 10, 9, 6, 8, 7, 4, 9, 10, 6),
  RISK_PHMS_SEVERITY2 = c(6, 5, 8, 7, 9, 5, 1, 5, 3, 6)
)

msps1 %>%
    select (RISK1_PHMS1, RISK1_PHMS4, RISK1_PHMS6, RISK1_PHMS8, RISK1_PHMS18, RISK1_PHMS20,
            RISK_PHMS_SEVERITY2) %>%
    estimate_profiles(1:5, variances  = "varying", covariances="varying")
#> tidyLPA analysis using mclust: 
#> 
#>  Model Classes AIC    BIC    Entropy prob_min prob_max n_min n_max BLRT_p
#>  6     1       310.59 321.18 1.00    1.00     1.00     1.00  1.00        
#>  6     2                                                                 
#>  6     3                                                                 
#>  6     4                                                                 
#>  6     5

Created on 2021-03-18 by the reprex package (v1.0.0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.