Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • conformability error using mimrgns

    I am using mimrgns after mi estimate and keep getting this message for one of the analysis

    Code:
    mi estimate: regress     vm time i.x i.y i.z i.u i.v
    
    mimrgns,  over(time) at(x=0 y=0 z=0 u=0 v=0) cmdmargins post 
    
    conformability error
    an error occurred when mi estimate executed mimrgns_estimate on m=18
    There are observations that have the combination of x=0 y=0 z=0 u=0 v=0 and I don't understand where the error comes from

    any help would be much appreciated

    Thank you

  • #2
    Try the following and show the output

    Code:
    mi convert flong
    regress vm time i.x i.y i.z i.u i.v if _mi_m == 17
    margins , over(time) at(x=0 y=0 z=0 u=0 v=0)
    regress vm time i.x i.y i.z i.u i.v if _mi_m == 18
    margins , over(time) at(x=0 y=0 z=0 u=0 v=0)
    My first guess is that the values of time vary with the imputed datasets.

    By the way, it seems inconsistent to include time as a continuous covariate in the regression model and then specify it in over(); over() is actually used with (the distinct levels of) categorical variables.

    Comment


    • #3
      Thank you very much Daniel.

      You are correct, the variable "time" is imputed and one value is missing for the 18th imputed data set. I will check what happens if I delete this value from all the datasets.

      Regarding your comment for over(time), I checked and it gives the same result as writing at(time=(0(1)10) x=0 y=0 z=0 u=0 v=0). I use this notation because in my model I am actually using splines of time.

      Last edited by Andre Martinez; 09 Jun 2021, 04:58.

      Comment


      • #4
        Originally posted by Andre Martinez View Post
        Is there a way to solve this ?
        I can think of brute-force workarounds. However, I believe that there is a more theoretical issue here: if, for some datasets, there are no (predicted) values for some time values, then how do you combine the respective estimates? I am surprised that the regression model runs smoothly; if you specify time as a categorical predictor, you should probably at least get a warning. I have not worked with splines a lot and never in the MI context, so I cannot say much about that.


        Originally posted by Andre Martinez View Post
        Regarding your comment for over(time), I checked and it gives the same result as writing at(time=(0(1)10) x=0 y=0 z=0 u=0 v=0)
        The latter specification should prevent the error that you report because specifying fixed values for time will ensure predicted values for every time value in every dataset. Whether that is what you want, I cannot really tell.

        Comment

        Working...
        X