Announcement

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

  • Help! "3598 Stata returned error"

    Hello,
    I'm trying to run mediation analysis in Stata 13. I've done so previously and am using identical syntax but with new data. I've verified that everything is updated. All non-binary variables are standardized to range from 0-1. The DV, treatment, and mediator are all continuous variables.

    Here's my syntax: "medeff (regress new_lrideol new_open new_consc new_extra new_agree new_emostab male new_educ new_age new_rururb)(regress EUSUPP01 new_lrideol new_open new_consc new_extra new_agree new_emostab male new_educ new_age new_rururb) if ccode==255, treat(new_open) mediate(new_lrideol)"

    When I run the command, the models converge and basic output is returned but no mediation analysis is conducted or reported. Instead, I get the message, "variable newc not found
    st_data(): 3598 Stata returned error
    med_reg(): - function returned error
    <istmt>: - function returned error
    r(3598);"

    What could be the problem? Based on my reading of previous posts, this error seems associated with unnecessary spaces...but I believe I've eliminated all those and still can't get the output I'm used to getting.

    Sincerely appreciate any/all help!

  • #2
    wish8397: Some small matters of form:

    1. FAQ Advice #8 spells out that we ask people to use full real names:


    6. Why are real names preferred?

    You are asked to post on Statalist using your full real name, including given name(s) and a family name, such as "Ronald Fisher" or "Gertrude M. Cox". Giving full names is one of the ways in which we show respect for others and is a long tradition on Statalist. It is also much easier to get to know people when real names are used.

    If you overlook this on first registration, it is easy to fix. Click on “Contact us” located at the bottom right-hand corner of every page.
    2. FAQ Advice #12 asks that you explain where you obtained the code of user-written programs you refer to. Here presumably medeff is one of the following:

    Code:
    SJ-12-2 st0243_1  . . . . . . . . . . . Software update for medeff and medsens
            (help medeff, medsens if installed) . . . . .  R. Hicks and D. Tingley
            Q2/12   SJ 12(2):352
            fixed error in medsens and now allows for interaction
            between mediator and treatment variables in medeff
    
    SJ-11-4 st0243  . . . . . . . . . . . . . . . . . .  Causal mediation analysis
            (help medeff, medsens if installed) . . . . .  R. Hicks and D. Tingley
            Q4/11   SJ 11(4):605--619
            calculates causal mediation effects using several different
            types of parametric models and calculates sensitivity
            analyses for violations to the key identifying assumption
    Your error message suggests to me that some list of variable names is being truncated. As I can see reference to a new_consc I don't know why the program is looking for new_c. I glanced at the code and could see no obvious problem, although that means no more than it says.

    If you don't get a better answer I would contact the authors directly; they are not obviously active here.

    Comment


    • #3
      I would suggest trying a substantial simplification of your command and then building it back up until it again fails. Start with something like
      Code:
      medeff (regress new_lrideol new_open) (regress EUSUPP01 new_lrideol new_open) if ccode==255, treat(new_open) mediate(new_lrideol)
      (if that makes sense, I do not use medeff) for example.

      Comment

      Working...
      X