Announcement

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

  • #16
    BTW -- -mvmeta- seems to be a not-so-recent user-written .ado file. So it *might* involve modifying/contacting the writer (Ian White, as far as I can tell). But then again, Stata being unable to store an arbitrary set of estimates (that it can happily display) points to something going wrong before invoking -mvmeta-.

    Comment


    • #17
      Hi,

      I'm back after exchanging a couple of messages with the Stata Tech support team (which was very efficient and helpful).
      The first suggestion was to update the version of mvmeta to the most recent one, from 2008 version to a 2011 version.
      This seemed to partially solve the problem and I managed to run a bit more of my do file.

      Unfortunately, it appears that a further problem is hindering from running the complete analysis. Again, I don't understand how this could be as I have succesfully run these commands countless times a couple of months ago! I have indicated the area the line which is causing the issues below in the code.

      Code:
       
       gen logrr = log(rr) gen loguci = log(uci) gen loglci = log(lci) gen logse = ((loguci - loglci)/(2*invnorm(.975)))   bysort id: gen dosec = dose - dose[1] mkspline doses = dose, nk(3) cubic mvmeta_make glst logrr doses1 doses2, cov(totalpersons cases) se(logse) pfirst(id study) saving(ssest_spline) replace  by(id)  names(b V)   preserve use ssest_spline, clear mvmeta b V  , mm   i2 capture estimates save mvmeta,   replace restore    predictnl logrr_sp = _b[bdoses1]*(doses1) + _b[bdoses2]*(doses2-0) , ci(los his)  *** This is where Stata is now refusing to run:  [doses1] not found r(111);   gen ors = exp(logrr_sp) gen lbs = exp(los) gen ubs = exp(his) predictnl logrr_l  = _b[dose]*dose gen orl  = exp(logrr_l)   twoway (line orl dose, sort  lc(green) lw(thick) lp(-) ) (line ors lbs ubs  dose, sort lw(thick medium medium) lc(orange black black) lp(l longdash longdash)) ,ytitle("Relative Risk") xtitle("LTPA Physical Activity (MET-h's/week)") scheme(s1mono)xlabel(0(5)60) xmtick(0(5)60) ymtick(.1(.3)1) ylabel(.1 .2 .3 .4 .5 .6 .7 .8 .9 1 , format(%3.2fc) angle(horiz)) legend(label(1 "Linear Model")  label(2 "Cubic Spline Model") order(1 2) ring(0) pos(20) col(1) ) plotregion(style(none))
      When I browse my data, I can clearly see that there is a variable called doses1, so how can it be that Stata is not "seeing" this?
      Or is there something else that might be responsible for this?

      Thank you!

      Comment


      • #18
        First off, your code wraps, that is, lines run together. So it's pretty difficult to read. I think this is an artifact of copying from one post to another.

        Second, it's only partial code. I didn't see your -preserve- command. When you browse and find your doses1 variable, is that immediately after the error, or is that when you first load up your data?

        Comment


        • #19
          Oh no, something seems to have gone wrong whilst posting the code! Sorry, I'll have another go:

          Code:
          mvmeta_make glst logrr doses1 doses2, cov(totalpersons cases) ///
          se(logse) pfirst(id study) saving(ssest_spline) replace  by(id)  names(b V)
          
          preserve
          use ssest_spline, clear
          mvmeta b V  , mm   i2
          estimates save mvmeta,   replace
          restore 
          
          *Obtain and plot the dose-response relationship back on the original scale
          estimates use mvmeta
          
          *Compute predictions and their standard errors
          predictnl logrr_sp = _b[bdoses1]*(doses1) + _b[bdoses2]*(doses2-0) , ci(los his)
          
          gen ors = exp(logrr_sp) 
          gen lbs = exp(los)
          gen ubs = exp(his)
          
          *Obtain and plot the dose-response relationship back on the original scale 
          predictnl logrr_l  = _b[dose]*dose
          
          *** This is where Stata refuses to run and gives the following error message:
          [dose] not found
          r(111);
          
          gen orl  = exp(logrr_l)
          
          *Overlay predictions from spline and linear models 
          twoway (line orl dose, sort  lc(green) lw(thick) lp(-) ) (line ors lbs ubs  dose, sort lw(thick medium medium) lc(orange black black) lp(l longdash longdash)) ,ytitle("Relative Risk") xtitle("LTPA Physical Activity (MET-h's/week)") scheme(s1mono)xlabel(0(5)60) xmtick(0(5)60) ymtick(.1(.3)1) ylabel(.1 .2 .3 .4 .5 .6 .7 .8 .9 1 , format(%3.2fc) angle(horiz)) legend(label(1 "Linear Model")  label(2 "Cubic Spline Model") order(1 2) ring(0) pos(20) col(1) ) plotregion(style(none))
          I just re-ran the whole thing and now Stata didn't act up on the variable "doses1" but now it can't can see the variable "dose". However, both right after loading the data and after the error message has occurred I can clearly see that I have this variable in my data set. When I try

          Code:
          list dose
          it does however seem to return a list of values for this variable! Very confusing!

          Comment


          • #20
            I just wanted to update and close this thread in case somebody requires similar information in the future.
            Thanks to a combination of suggestions from this forum and the Stata tech team, the problem has been solved.

            The problem appears to have been 2-fold:

            (1) I had to change my working directory to a folder that had writing permission.
            (2) I has to update the mvmeta package that I was using to the 2011 version. By working through the details of the do file and slightly tweaking the code to adapt it to the updated version of mvmeta, I was finally able to run the entire do file.

            Thank you everybody that responded to my question!

            Comment


            • #21
              hi, Dr. dominicasmith. I confronted with the same problem when I do a meta-analysis. I guess that there is a problem with my mvmeta.ado. It is an old version writted in 2008 and it was updated by the author in 2011. Would you so kindly to send me a new mvmeta.ado doucument? Thank you very much. Please email: [email protected].

              Comment


              • #22
                Yes, I will send you a copy (but please keep in mind that my variable names will be most likely very different to yours).

                Comment


                • #23
                  How to update the mvmeta package? I can't found it.

                  Comment


                  • #24
                    To update mvmeta:

                    Step 1: Type into Stata:
                    Code:
                    findit mvmeta

                    Step 2: Then a window will pop up, to progress you must click on the the following option

                    SJ-11-2 st0156_1 . . . . Multivariate random-effects meta-regression: Updates
                    (help mvmeta, mvmeta_make if installed) . . . . . . . . . I. R. White
                    Q2/11 SJ 11(2):255--270
                    extension of mvmeta command to handle meta-regression

                    Click on the blue text (which I have indicated above)
                    This will bring you to the next page.


                    Step 3: Click on the blue "click here to install" (shown below)

                    INSTALLATION FILES (click here to install)

                    Step 4: Then it will try to tell you that the files have already been installed so you have to select the option to replace the files.

                    I hope this works for you!

                    Comment


                    • #25
                      I have already updated my mvmeta.ado following your patient instructions. However, when I type in this command (predictnl logor_sp = _b[bbmics1]*(bmis1-19.3)…………), the Stata said:_b[bbmics1] not found. I don't where the problem is. Wish your help! The code is on this website.(http://www.imm.ki.se/biostatistics/glst/) Take "Body mass index and renal cancer" as an example.
                      Thank you!

                      Comment


                      • #26
                        I am familiar with the example that you are referring to which can be found at (http://www.imm.ki.se/biostatistics/glst/). I had a similar issue with one of my variables too. From my experience, I was able to solve this by changing the variable name. I'm not sure why or how this was suddenly necessary but the transformed variable no longer was saved under the same name.

                        So in terms of your data and variable names you would have to change the code from:

                        Code:
                          
                         predictnl logor_sp = _b[bbmics1]*(bmis1-19.3) + _b[bbmics2]*(bmis2-0) , ci(los his)
                        to
                        Code:
                          
                         predictnl logor_sp = _b[bmics1]*(bmis1-19.3) + _b[bbmics2]*(bmis2-0) , ci(los his)
                        I'm just guessing but do let me know how that goes!

                        Comment


                        • #27
                          Sorry to trouble you again. I did as you said but the problems remains unsolved. The Stata said "[bmics1] not found" as before. I don't know how to make it work so I ask you for a favor again. Thank you for your kindly help. I just know how you make it work.
                          code:
                          predictnl logor_sp = _b[bmics1]*(bmis1-19.3) + _b[bmics2]*(bmis2-0) , ci(los his
                          [bmics1] not found
                          r(111);

                          Comment


                          • #28
                            When you browse your data set, do you see a variable called "bmics1"?

                            Comment


                            • #29
                              Yeah, I saw it. It was in the original database, which was calculated by bmics using mkspline command. But the _b[bmics1] referce to the estimated coefficients of bmics1. How you make the code work? I'm really appreciated with your quickly replying. Thank you again.

                              Comment


                              • #30
                                What is your output when you enter:

                                Code:
                                describe

                                Comment

                                Working...
                                X