

Timevarying Covariates .. 

Message/Author 

Stat_love posted on Wednesday, November 16, 2005  8:12 am



Dear Muth, These days, I use the Mplus lots of time. First, I get a result from Latent Class analysis and then got 2 classes and I didn't consider any covariates. But I have age variable of each waves. ex) ID Sex Age1 Y1 Age2 Y2 Age3 Y3...Age5 Y5 1 F 8 0 10 0 11 1 ... 16 1 2 M 10 0 12 1 15 1 ... 18 1 ... like this.. I want to consider age effect, even if each age rang is not equal. I find Ex.6.10 in User's Guide 2004. I think Age variable is effect Y's, so I want to apply this formate. But our example use timeinvariant and timevarying covariates..I just think timevarying covariates are each age case. Is it corrct?? or not? I really want to consider age of each wave. Before, I just use the age variable, I have lots of missing data, for age range is not equal. Subject 1 have starting age is 8, but 2 have starting age is 10 like this.. Could you give me your good suggestion? 

bmuthen posted on Wednesday, November 16, 2005  8:53 am



Perhaps ex 6.12 is useful. It sounds like you have "individuallyvarying times of observation", so that people are not of the same age at a given measurement occasion. Ex 6.12 also has random slopes for the timevarying covariates which you don't have to use. 

Stat_love posted on Wednesday, November 16, 2005  11:26 am



Dear Muth, You said that ex6.12 is useful, because a1a5 is individuallyvarying times of observation. I got an Error message *Data format: ID FID SubID S R a1 a2 a3 a4 a5 y1 y2 y3 y4 y5 A1 1 1 F 1 8 10 12 17 18 0 0 1 0 1 A2 2 1 F 0 7 10 11 15 17 0 0 0 0 1 …………… Q1 79 2 M 1 9 12 15 17 18 0 1 1 0 1 … • a1~a5 is Age variables it’s not equal range in each subject. • y1~y5 is binary case 0: absent / 1: present • Each subject have 5 wave(times) – longitudinal data  * Input: Data: File is ex612.txt; Variable: Names are ID FID SubID S R a1a5 y1y5; USEVARIABLE ARE a1a5 y1y5; Categorical = y1y5; TSCORES = a1a5; Class = C (2); Analysis: Type = Mixture; Starts = 50 2; Model: %overall% i s  y1@0 y2@1 y3@2 y4@3 y5@4 AT a1a5; Output: Tech1 Tech8;  * Purpose: Find how many class in here? So I use ‘Type=mixture’ and ‘Class=’ If I consider agevariable, it have lots of missing. So just consider effect to y1~y5. Error is that ‘Class=’ and ‘Type=Mixture’ commend, but I want to analysis the admixture model. How to solve this problem? I also consider Agevariable information. 

Stat_love posted on Wednesday, November 16, 2005  12:36 pm



I fix the input. Like this:  Data: File is ex612.txt; Variable: Names are ID FID SubID Sex Risk a1a5 y1y5; USEVARIABLE ARE a1a5 y1y5; Categorical = y1y5; TSCORES = a1a5; Class = c(2); Analysis: Type = Mixture Random ; ALGORITHM=INTEGRATION; Model: %Overall% i s  y1y5 AT a1a5; Output: Tech1 Tech8;  (Q1)This is corret? (Q2) Got this message: Unperturbed starting value run did not converge. THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY DUE TO A NONZERO DERIVATIVE OF THE OBSERVEDDATA LOGLIKELIHOOD. THE MCONVERGENCE CRITERION OF THE EM ALGORITHM IS NOT FULFILLED. CHECK YOUR STARTING VALUES OR INCREASE THE NUMBER OF MITERATIONS. ESTIMATES CANNOT BE TRUSTED. THE LOGLIKELIHOOD DERIVATIVE FOR PARAMETER 2 IS 0.11420395D01. > So finally, I didn't get the correct result. How can do it? I try to change 'startvalue', it's not working. * Could you give me your advise? 

bmuthen posted on Wednesday, November 16, 2005  4:50 pm



This type of question is better answered by sending your input, output, data and license number to support@statmodel.com. 

Back to top 

