Announcement

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

  • Create two-way line graph with shaded confidence intervals from dstdize results

    Hello,
    I am struggling to create a simple, two-way line graph representing the results from my standardized adjusted rate calculations.

    My code is straight forward:

    gen pop=1
    dstdize dxpid pop agecat gender insurance ruca2, by(year)


    The results (by year) provide crude and adjusted rates, and associated 95% confidence intervals.
    I simply want to graph the adjusted rates and confidence intervals...


    I read that there should be an option to save the results to a separate .dta but I haven't had any success.

    Any help would be appreciated.
    Thank you.


  • #2
    there is a "saving(filename)" option. does it not work?

    Comment


    • #3
      Hi there,
      Evidently there is a "Saving (filename)" option but I'm not sure where it fits in my code

      However, I am already using a 'main' option -- ' by(year)' because I am trying to estimate rates by year.

      I've tried:
      dstdize dxpid pop agecat gender insurance ruca2, by(year) saving"state/analytic/standard/v1.dta"

      When I do that I am prompted "option saving incorrectly specified"
      when I include a comma after year I am prompted "invalid saving"



      Comment


      • #4
        Code:
        dstdize dxpid pop agecat gender insurance ruca2, by(year) saving("state/analytic/standard/v1.dta")
        This may work to replace the file if already there. Stata commands vary with how to specify replace.
        Code:
        dstdize dxpid pop agecat gender insurance ruca2, by(year) saving("state/analytic/standard/v1.dta", replace)

        Comment


        • #5
          Thank you. I was able to save the file but lost all relevant output including: 1) my primary variable (catvar), 2) confidence intervals and 3) adjusted rates. Fortunately I figured out a way to present the adjusted rates and shaded confidence intervals in Excel. It was very tedious.

          Comment


          • #6
            That's a kluge, but one many of us are guilty of. Doing stuff in excel often points me to a solution.

            If you'd post some data (dataex) you might get a solution. Just make sure you post enough to get something interesting.

            Comment

            Working...
            X