Announcement

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

  • variable RR already defined variable Lower not found error during Mantel–Haenszel estimate of the rate ratio

    Hello everyone,
    I hope you're all doing fine.
    Firstly, I wanted to express how grateful am I for your kind help, it really helped me very much as a beginner. Thanks a lot, I really appreciate it.

    Secondly,

    I've used the following command
    Code:
    stptime, by(rs2228001) per(100)
    stmh rs11615, compare (0,2 )
    I keep getting this error:
    variable RR already defined
    variable Lower not found


    when I'm trying to get Mantel–Haenszel estimate of the rate ratio between 0 and 2 values of rs11615 using the command

    where rs11615 is a categorical variable with three values 0,1,2

    Before that, I've done many survival time analyses as Kaplan Meier, and they all went pretty fine, but this one keeps getting this error.

    How can I avoid that error ?

  • #2
    Do you have a variable named "RR" in your dataset? I can only replicate this error if that is the case. Maybe you can rename that variable in case it exists.

    Code:
    cap rename RR VarRR
    stptime, by(rs2228001) per(100)
    stmh rs11615, compare (0,2 )

    Comment


    • #3
      No I don't have a variable called RR in my dataset.

      Maybe the variable originated from the survival time analysis that I used, but, I haven't generated such variable intentionally.

      Any insights what might be the error ?

      Comment


      • #4
        Did including

        cap rename RR VarRR
        before running stmh not resolve the problem? I think you should raise the issue with Stata Technical Services - "RR" is not a reserved variable name. Here is a reproducible example that you can send to them.

        Code:
        webuse diet, clear
        stset dox, origin(time dob) enter(time doe) id(id) scale(365.25) fail(fail==1 3 13) noshow
        gen RR= .
        stmh month, compare(11, 12)
        Res.:

        Code:
        . stmh month, compare(11, 12)
        
        Mantel-Haenszel estimate of the rate ratio
          comparing month==11 vs. month==12
        
        variable RR already defined
        variable Lower not found
        r(111);

        Comment

        Working...
        X