Announcement

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

  • Getting Standard Error bars instead desired 95% CI bars

    Dear Statalisters,

    Used Stata version: 13.1

    Here is my sample dataset below:

    Code:
    id    gender    visit    ir
    1    Girls    5    .45
    2    Girls    5    .21
    3    Girls    5    .53
    4    Boys    5    .21
    11    Boys    5    .44
    14    Boys    5    .58
    1    Girls    6    .21
    2    Girls    6    .37
    3    Girls    6    1.8
    4    Boys    6    .22
    11    Boys    6    .29
    14    Boys    6    .64
    1    Girls    7    .37
    2    Girls    7    .21
    3    Girls    7    1.2
    4    Boys    7    .22
    11    Boys    7    .22
    14    Boys    7    .19
    1    Girls    8    .43
    2    Girls    8    .22
    3    Girls    8    1.1
    4    Boys    8    .37
    11    Boys    8    .22
    14    Boys    8    .21
    1    Girls    9    .42
    2    Girls    9    .29
    3    Girls    9    2.5
    4    Boys    9    .22
    11    Boys    9    .21
    14    Boys    9    .6
    The variables are self explanatory, "ir" stands for "Insulin Resistance". I am using "lgraph" command http://econpapers.repec.org/software...de/s456849.htm to produce a line graph with 95% confidence interval bars for each visit by gender.

    Problem: The graph is being produced with one Standard Error bars instead desired 95% Confidence Interval bars. I used the following code which can be cross checked by typing "help lgraph" in Stata.

    Code:
     lgraph ir visit gender,err(ci(95)) /// xlab(5/16)
    I am not sure where I am making the mistake. I know I could go with "twoway connected" option. Since I will have to produce graphs on several variables, I am just trying to avoid creating variables for "rcap". "lgraph" seems does the job quickly and graphs can be combined afterwards. I just need to sort out the dilemma between SE and CI bars.

    Your help is highly appreciated.

    All the best,
    Last edited by Roman Mostazir; 19 Sep 2014, 09:36. Reason: Tagged
    Roman

  • #2
    lgraph is written by Timothy Mak. I studied the help file and found that the description of the errortype() option is insufficient; it does not really tell which arguments are allowed. I also found that I got the same graph whether I wrote -se- or -ci(95)- or -ci(90).

    Comment


    • #3
      He Svend, many thanks for your reply. At least I am now assured that it is something wrong with the program. Yes you are right, indeed I found the same. It produces the same error bars regardless whatever the specification is. SD bars seem works fine. It is just the CI is not working. I think the author needs a feedback on this.
      Roman

      Comment


      • #4
        Hi,

        Sorry for late reply, and thanks for alerting me to the problem. I've just emailed Kit Baum a fix, and should be available shortly. It will be version 3.0.2.

        Timothy Mak

        Comment


        • #5
          Thank you so much Tim. I highly appreciate the *.ado file you sent me. All the best.
          Roman

          Comment

          Working...
          X