Announcement

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

  • Graphs - censor low n size

    Hello,

    Is there a way for a graph command to automatically censor groups with a low n size? For example,
    Code:
     graph bar (mean) var1, over(var2)
    I realize this is possible to do manually in the data beforehand (create a new variable that is the count by var2, set values of var1 to missing if the count is too low).

    Thank you.

  • #2
    Originally posted by Alex Weckenman View Post
    I realize this is possible to do manually in the data beforehand (create a new variable that is the count by var2, set values of var1 to missing if the count is too low).
    That is how you should do that. Look at this from the perspective of someone designing the command. You can think of many things that might be useful, but if you implement them all you get a command with so many options it becomes too confusing for the user. So you are better of designing a command that does one thing well then try to create commands that does all the things.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      I almost agree with Maarten. I disagree on the detail of setting values to missing. Rather you should ignore small groups if that is what you want to do.

      Code:
      bysort groupvar : gen freq = _N 
      
      … if freq < 5 
      is for example technique for ignoring groups with frequencies less than 5. Here the dots would be some graph command.

      Comment


      • #4
        Thank you both!

        Comment

        Working...
        X