0
$\begingroup$

I'm running an LM model using the LMest package available in R. The dataset contains NO missing values.

pct_miss(df_long) [1] 0 n_miss(df_long) [1] 0

The lmest function with no covariates works fine. However, when I added covariates in the latentFormula, I got the following error message. "Error in lmest(responsesFormula = responseA + responseB + responseC + responseD ~ : missing data in the covariates affecting the initial probabilities are not allowed"

My code follows:

LMmodel <- lmest(responsesFormula = responseA + responseB + responseC + responseD ~ NULL,

  •           latentFormula =  ~
    
  •               SEX + GRADE | SEX + GRADE,
    
  •           index = c("ID","Time"),
    
  •           data = df_long,
    
  •           k = 3,
    
  •           paramLatent = "multilogit",
    
  •           start = 0)
    

where the four response variables (responses A to D) are categorical, ranging from 0 to 8; SEX is binary (1 and 2 represent Male and Female, respectively); GRADE is categorical, ranging from grades 7 to 12.

Can anyone point out what went wrong and how to address this error?

Thanks so much.

$\endgroup$
0
$\begingroup$

I'm answering my question here. The issue was eventually addressed by reordering the structure of my dataset. In my original dataset, the response variables were placed at the first few columns, followed by a list of covariates. To use the LMest package, response variables should be placed towards the end of the dataset.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.