Announcement

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

  • Unsure about an error using boxplots

    I have been trying to make boxplots over a categorical variable. There are 18 categories; however, the graph only forms boxplots for 17 of the categories. I am unsure as to why this error is occurring. Any advice or help is appreciated!

    graph box age_weeks , over(vaccines1, gap(*1) label(labsize(vsmall) angle(90))) allcategories showyvars asyvars leg(off) noout graphregion(color(white)) box(1, color(green%50) lcolor(green)) box(2, color(green%50) lcolor(green)) box(3, color(yellow%50) lcolor(yellow)) box(4, color(yellow%50) lcolor(yellow)) box(5, color(yellow%50) lcolor(yellow)) box(6, color(yellow%50) lcolor(yellow)) box(7, color(orange%50) lcolor(orange)) box(8, color(orange%50) lcolor(orange)) box(9, color(orange%50) lcolor(orange)) box(10, color(orange%50) lcolor(orange)) box(11, color(cyan%50) lcolor(cyan)) box(12, color(cyan%50) lcolor(cyan)) box(13, color(cyan%50) lcolor(cyan)) box(14, color(cyan%50) lcolor(cyan)) box(15, color(red%50) lcolor(red)) box(16, color(red%50) lcolor(red)) box(17, color(red%50) lcolor(red)) box(18, color(purple%50) lcolor(purple)) ylab(0 (10) 100, nogrid labsize(vsmall)) ytitle("Age at Vaccination (Weeks)", size(small))

  • #2
    Could you show some descriptive statistics, say the results of

    Code:
    tabstat age_weeks, by(vaccine1) stat(n min p25 p50 p75 max) c(s)
    ?

    Comment


    • #3
      .
      Last edited by Ubaidullah Jamal; 08 Mar 2023, 10:50.

      Comment


      • #4
        I also just noticed that the graph is showing one of the categories twice even though I can see that the label has been defined correctly using tab command.

        Comment


        • #5
          What are the levels of vaccine1, which are included in the tabstat output?

          It doesn't appear that you have 18 distinct categories there as far as those summary statistics are concerned.

          Comment


          • #6

            Here are the categories. Differences in the summary statistics are minute but they do exist as some of the vaccines are administered together per visit.
            Last edited by Ubaidullah Jamal; 08 Mar 2023, 10:59.

            Comment

            Working...
            X