Announcement

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

  • Creating Tables

    Hey there

    I am desperatly trying to create a table with following information: Number of observations, mean, std. dev., value of first and last observation.
    Could anyone please tell me how to achieve that?

    Thanks in advance!

  • #2
    This question simply cannot be answered without seeing an example of your data. There are many possible ways your data cold be arranged, and each would call for a different solution. Please use the -dataex- command to post your example. Run -ssc install dataex- to get the command and then run -help dataex- to see the simple instructions for using it.

    Comment


    • #3
      Janu Dinklage Welcome to the Stata Forum/Statalist.

      It striked me as odd that you're feeling desperate to perform an introductory command in Stata.

      Frankly, I fail to envisage a reason for despair, since you have a cornucopia of alternatives to tackle the issue:

      Indeed, you can find (not necessarily in this order) the information you want in a) the Stata Manual; b) Tutorials on the web; c) Video classes, including the Stata Channel; d) Books, including the ones from StataCorp;e) A nice search in the FAQ as well as the Stata Forum.

      Please do take some time to learn by reading, watching and performing introductory commands in Stata.

      As a matter of fact, it is an experience that will reward you exponentially, so to speak.

      That said, and considering you didn't give much detail concerning the wishful table, below you will find an example.

      Hopefully it will apply to your needs.

      Code:
      . sysuse auto
      (1978 Automobile Data)
      
      . tabstat mpg price weight length, statistics( count mean sd min max ) columns(statistics)
      
          variable |         N      mean        sd       min       max
      -------------+--------------------------------------------------
               mpg |        74   21.2973  5.785503        12        41
             price |        74  6165.257  2949.496      3291     15906
            weight |        74  3019.459  777.1936      1760      4840
            length |        74  187.9324  22.26634       142       233
      ----------------------------------------------------------------
      Edit: I took "values of the first and last observations" as the minimum and maximum values, since your query didn't give further information.
      Last edited by Marcos Almeida; 02 Sep 2017, 16:42.
      Best regards,

      Marcos

      Comment

      Working...
      X