Announcement

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

  • merlin_xb_2(): 3001 expected 3 arguments but received 2 - Stata error following predictms help

    Hi as you may know, i've been using -predictms- I've had several problems despite following the official stata conference slides of 2017 and 2018. There's been an update but unfortunately the slides haven't been updated. I've now been following -help predictms- However I still have problems as you can see below

    I've created a new thread as I've made some progress compared to the previous post. Any thoughts how I can fix it? Do you normal users if you load this code, do you get the same error?

    Code:
    clear all
    
    use http://fmwww.bc.edu/repec/bocode/m/multistate_example,clear
    msset, id(pid) states(rfi osi) times(rf os) covariates(age)
    
    //Stores matrix callted tmat name, stores the values from transmatrix
    mat tmat = r(transmatrix)
    
    //Displays tmat ie the values of transmatrix
    mat list tmat
    
    //Declare survival data
    stset _stop, enter(_start) failure(_status=1) scale(12)
    
    stmerlin age if _trans1==1, distribution(weibull)
    estimate store m1
    
    stmerlin age if _trans2==1, distribution(weibull)
    estimate store m2
    
    stmerlin age if _trans3==1, distribution(weibull)
    estimate store m3
    
    ///transition probabilities for a patient with age 50  
    predictms, transmatrix(tmat) models(m1 m2 m3) probability at1(age 50)
    However I obtain the following error:

    Click image for larger version

Name:	Screenshot 2024-04-08 at 13.04.16.png
Views:	1
Size:	516.4 KB
ID:	1749249


  • #2

    Comment


    • #3
      Hi thanks for confirming this.
      i’ve tried to call redanalytics on their sweedish phone but went to voicemail
      i’ve also emailed directly M Crowther, hopefully either of us will get an answer

      Comment


      • #4
        Seems some mix-up of versions may have caused the problem. A clean install and a restart of Stata run the example(ref https://github.com/RedDoorAnalytics/multistate/issues/6)
        Code:
        capt ado uninstall merlin
        capture ado uninstall stmerlin 
        capt ado uninstall multistate
        
        net install merlin, from("https://raw.githubusercontent.com/RedDoorAnalytics/merlin/main/")
        net install stmerlin, from("https://raw.githubusercontent.com/RedDoorAnalytics/stmerlin/main/")
        net install multistate, from("https://raw.githubusercontent.com/RedDoorAnalytics/multistate/main/")
        
        * RESTART Stata
        
        use http://fmwww.bc.edu/repec/bocode/m/multistate_example, clear
        msset, id(pid) states(rfi osi) times(rf os)
        mat tmat = r(transmatrix)
        stset _stop, enter(_start) failure(_status=1)
        stmerlin age if _trans1==1, distribution(weibull)
        estimate store m1
        stmerlin age if _trans2==1, distribution(weibull)
        estimate store m2
        stmerlin age if _trans3==1, distribution(weibull)
        estimates store m3
        predictms, transmatrix(tmat) models(m1 m2 m3) probability at1(age 50)
        graphms

        Comment


        • #5
          I was just going to post this as I got a reply from the author
          Note to future users - the github link has the latest version so download from here rather than -ssc install-

          fantastic ! It now works !

          Comment

          Working...
          X