tidyLPA icon indicating copy to clipboard operation
tidyLPA copied to clipboard

plot_density result is blank

Open tchau30 opened this issue 2 years ago • 0 comments

Hi,

I am very new to R so please forgive me if this is a silly question. I have successfully run estimate_profiles and plot_profiles on my data which consists of two continuous numeric variables (confirmed using is.numeric() and is.factor()). There are four unique datasets in total, corresponding to 4 different age groups' responses for variable A and variable B. However, running plot_density only produces a density plot for variable B but not variable A across all four datasets.

When I created a separate dataframe consisting of variable A alone, plot_density works perfectly.

Here is an example of the code I've been using:

lpa_test %>% estimate_profiles(n_profiles = 3, models = 2) %>% plot_density()

Or

lpa_test <- estimate_profiles(dataframe, n_profiles = 3, models = 2) plot_density(lpa_test)

I've attached two images, one from the dataframe consisting of variable A alone, then another from a dataframe consisting of both variable A and variable B.

Thank you for your help,

Tracey image image

tchau30 avatar Apr 25 '22 01:04 tchau30