0

I am running an LPA with 5 classes and a distal outcome in MplusAutomation (R). While doing so, I also want to run a distal outcome omnibus Wald test o see whether there are significant differences between the classes. However, the results of the test does not show in the output-file. At the same time, no error message is provided, and I get every other output(i.e., the conditional distal means). Does anyone know what the problem might be? The code is pasted below.

  TITLE = "Step3_lca_distal - Mpanel;", 
  
  DATA = "LISTWISE=ON;",
  
  VARIABLE = 
    "nominal=N;
  usevar = n;
  missing are all (9999);
  classes = c(5);
  
  usevar = edu3 claim_5;",
  
  DEFINE = "Center edu3 (Grandmean);",
  
  ANALYSIS = 
    "estimator = mlr; 
  type = mixture; 
  starts = 0;",
  
  MODEL =
    glue(
      " %OVERALL%
  
  C on edu3;      ! covariate as predictor of C

     %C#1%
  [n#1@{logit_cprobs[1,1]}];
  [n#2@{logit_cprobs[1,2]}];
  [n#3@{logit_cprobs[1,3]}];
  [n#4@{logit_cprobs[1,4]}];
  
  [claim_5](m1);    ! conditional distal mean 
  claim_5;          ! conditional distal variance (freely estimated)

  %C#2%
  [n#1@{logit_cprobs[2,1]}];
  [n#2@{logit_cprobs[2,2]}];
  [n#3@{logit_cprobs[2,3]}];
  [n#4@{logit_cprobs[2,4]}];
  
  [claim_5](m2);
  claim_5;
  
  %C#3%
  [n#1@{logit_cprobs[3,1]}];
  [n#2@{logit_cprobs[3,2]}];
  [n#3@{logit_cprobs[3,3]}];
  [n#4@{logit_cprobs[3,4]}];
  
  [claim_5](m3);
  claim_5;

  %C#4%
  [n#1@{logit_cprobs[4,1]}];
  [n#2@{logit_cprobs[4,2]}];
  [n#3@{logit_cprobs[4,3]}];
  [n#4@{logit_cprobs[4,4]}];
  
  [claim_5](m4);
  claim_5;
  
  %C#5%
  [n#1@{logit_cprobs[5,1]}];
  [n#2@{logit_cprobs[5,2]}];
  [n#3@{logit_cprobs[5,3]}];
  [n#4@{logit_cprobs[5,4]}];
  
  [claim_5](m5);
  claim_5;"),
  
  
  
  MODELCONSTRAINT = 
    "New (diff12 diff13 diff14 diff15
    diff23 diff24 diff25
    diff34 diff35 diff45); 
  
    diff12 = m1-m2; diff24 = m2-m4; ! Pairwise test of difference in distal means
    diff13 = m1-m3; diff25 = m2-m5;
    diff14 = m1-m4; diff34 = m3-m4;
    diff15 = m1-m5; diff35 = m3-m5;
    diff23 = m2-m3; diff45 = m4-m5;",

  
  MODELTEST = "     
    m1=m2;
    m2=m3;
    m3=m4;
    m4=m5;",
  
  OUTPUT = "sampstat residual tech4 tech11 tech14;",
  
  usevariables = colnames(savedata), 
  rdata = savedata)

step3_fit <- mplusModeler(step3,
                          dataout=here("model_lca_distal.dta"),
                          modelout=here("myfile.inp"),
                          check=TRUE, run = TRUE, hashfilename = FALSE) 

I greatly appreciate any help with this! Also, I am rather new to this forum so let me know if you need any extra information.

Thanks!

Sofia
  • 11
  • 2
  • Please read this what extra information we need: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – jay.sf Sep 22 '22 at 11:36

0 Answers0