I'm currently trying to implement hlme to detect latent class trajectories in my longitudinal data; however, I am having an issue in determining the number of optimal groups. Models with ng = 1 ran without an issue (this is how df = 5 was determined).
Here is the code causing the issue:
m2f <- hlme(centered_x ~ ns(age, df=5), random =~ 1, mixture = ns(age, df=5), subject = 'ID', data = data_f, ng = 2)
returns the error: Error: object 'age' not found.
I have removed NA values for age, and ensured that it is present in the data set, so I don't know quite what to do next.
Hi all,
I'm currently trying to implement hlme to detect latent class trajectories in my longitudinal data; however, I am having an issue in determining the number of optimal groups. Models with ng = 1 ran without an issue (this is how df = 5 was determined).
Here is the code causing the issue:
m2f <- hlme(centered_x ~ ns(age, df=5), random =~ 1, mixture = ns(age, df=5), subject = 'ID', data = data_f, ng = 2)
returns the error: Error: object 'age' not found.I have removed NA values for age, and ensured that it is present in the data set, so I don't know quite what to do next.
Thanks in advance!