I'm running an LM model using the LMest package available in R. The dataset contains NO missing values.
pct_miss(df_long)  0 n_miss(df_long)  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.