data-edu / tidyLPA

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

add examples with get_estimates() and get_fit() #118

Closed jrosen48 closed 5 years ago

jrosen48 commented 5 years ago

I don't think get_estimates() and get_fit() are described in the vignette or README - these can make it even easier for folks to work with the output (along with #117)

jrosen48 commented 5 years ago

Also, should get_estimates() provide the estimates in wide format in terms of the means and variances (i.e., can the variances be in the same row as the mean with which it corresponds?):

    library(tidyLPA)
#> tidyLPA has received a major update, with a much easier workflow and improved functionality. However, you might have to update old syntax to account for the new workflow. See vignette('introduction-to-major-changes') for details!
#> 
#> Mplus is not installed. Use only package = 'mclust' when calling estimate_profiles().
    library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
    results <- iris %>%
        select(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) %>%
        estimate_profiles(3)
    get_estimates(results)
#> # A tibble: 24 x 8
#>    Category  Parameter    Estimate      se        p Class Model Classes
#>    <chr>     <chr>           <dbl>   <dbl>    <dbl> <int> <dbl>   <dbl>
#>  1 Means     Sepal.Length   5.01   0.0445  0.           1     1       3
#>  2 Means     Sepal.Width    3.43   0.0522  0.           1     1       3
#>  3 Means     Petal.Length   1.46   0.0242  0.           1     1       3
#>  4 Means     Petal.Width    0.246  0.0142  5.78e-67     1     1       3
#>  5 Variances Sepal.Length   0.235  0.0285  1.51e-16     1     1       3
#>  6 Variances Sepal.Width    0.107  0.0133  7.05e-16     1     1       3
#>  7 Variances Petal.Length   0.187  0.0307  1.05e- 9     1     1       3
#>  8 Variances Petal.Width    0.0379 0.00568 2.41e-11     1     1       3
#>  9 Means     Sepal.Length   5.92   0.0759  0.           2     1       3
#> 10 Means     Sepal.Width    2.75   0.0488  0.           2     1       3
#> # … with 14 more rows

Created on 2019-06-12 by the reprex package (v0.3.0)

jrosen48 commented 5 years ago

addressed in https://github.com/data-edu/tidyLPA/commit/0fdaff471104227c0411b1176541417dbbb09fc2