Announcement

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

  • Producing descriptive statistics table

    Click image for larger version

Name:	desc table.PNG
Views:	1
Size:	20.0 KB
ID:	1754555



    I want to produce a descriptive table with categorical variables like this and generate a tex file as an output. What commands should I use? Thanks in advance

  • #2
    Hello there..this is often called a `Table ` .If you are using Stata 17 or 18, you can use the `Statistics`, `Summary Tables and Tests` then `Descriptive Table`....I might have forgotten the path.

    You can watch the following tutorials from STATA

    Stata 17: https://youtu.be/ug0LihyIzvM?si=NJ7MMO2GZD3uXMvJ
    Stata 18: https://youtu.be/NGLJig-nfZU?si=Zo9h3buPIcBu-pzW

    Comment


    • #3
      hello people I tried to run this but it tells me "c_censured_vector_1_20 not found" Please if one one have an idea

      *** Multidimensional Poverty Index (MPI) ***
      foreach j of numlist 1 {
      foreach k of numlist 20 26 50 {
      bysort Residence: sum c_censured_vector_`j'_`k' [iw = sample_weight] if sample_`j'==1
      }
      bysort Residence: sum c_censured_vector_`j'_26 [iw = sample_weight] if sample_`j'==1
      }

      Comment


      • #4
        Hello.

        Did you eventually manage?

        Comment


        • #5
          Well, the problem that is precipitating the error message in #3 is that Stata finds no variable named c_censured_vector_1_20. To get the code to run, he will have to review the code that precedes what was shown to find out why the variable c_censured_vector_1_20 either never was brought into memory or was, perhaps inadvertently, dropped.

          That said, the code shown is not well organized. Since the only value that j will take on is 1, there is no reason for a loop over j. Also, the separate -bysort Residence: sum c_censured_vector_`j'_26 [iw = sample_weight] if sample_`j'==1- command serves no purpose because the same calculations will have already been done when `k' == 26 in the loop. So a more straightforward way to code this calculation is:
          Code:
          sort Residence
          foreach k of numlist 20 26 50 {
              by Residence: sum c_censured_vector_1_`k' [iw = sample_weight] if sample_1==1
          }

          Comment

          Working...
          X