Announcement

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

  • Table Creation

    Hii,
    I have a hospitals data. There is variable named districts, blocks and hospital_name, there are some blocks in each district and within each blocks there are many hospitals. I want to know how many blocks in a district. Is there anyone who can help me out in this?? thank you

  • #2
    Possibly for "a district".

    Code:
    tab block if district == "Whatever" 
    display r(r)
    Do you mean in each district, meaning all of them?

    Comment


    • #3
      thanks Nick,
      Yes I mean all of them.

      Comment


      • #4
        Possibly

        Code:
        egen tag = tag(block district) 
        egen blocks = total(tag), by(district) 
        label var blocks "# of blocks" 
        tabdisp district, c(blocks)
        For the principles here, read and study https://www.stata-journal.com/sjpdf....iclenum=dm0042

        Comment


        • #5
          thanks Nick,
          It worked.

          Comment

          Working...
          X