Using Stata Creating a Table of Descriptive Statistics

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 13

  • @RosatiSamuel
    @RosatiSamuel 9 หลายเดือนก่อน

    Say I have a variable age grouped into three or four levels 0-25 years e.t.c and I want to get the mean and standard deviation age of each group. How do I go about that?

    • @jasonburns2579
      @jasonburns2579  9 หลายเดือนก่อน +1

      Great question! To do that you can use what Stata calls "factor notation." This means that you tell Stata that a given variable is categorical. To do that, use the prefix "i." before a variable. Say that your variable is called "age." You would enter "i.age" in the command and it will then create a separate line in the table for each category. This video walks gives an example starting at around the 6:00 mark.

    • @RosatiSamuel
      @RosatiSamuel 9 หลายเดือนก่อน

      @@jasonburns2579 Great. At that point in the clip, we get proportions in decimal places. Could I use that for mean in representing Table 1 of summary statistics say for a numerical variable coded with levels like age or BMI?

    • @jasonburns2579
      @jasonburns2579  9 หลายเดือนก่อน +1

      @@RosatiSamuel For that you would want to create a crosstabluation or two-way table. The idea with that is you declare your categorical variable as the row variable and then specify which descriptive statistics you want in each row. A simple way to do that would be to use the command "tabstat BMI, by(age)" You can customize it more using the table and tabulate commands. I have a video on crosstabs you may find helpful in this scenario.

    • @RosatiSamuel
      @RosatiSamuel 9 หลายเดือนก่อน

      @@jasonburns2579 Thanks alot.

  • @mariacastiglione4480
    @mariacastiglione4480 ปีที่แล้ว +2

    how do you get a percentage

    • @HaciendoLQMDLG
      @HaciendoLQMDLG ปีที่แล้ว

      you can use the command "tab1 [varlist]" to generate a frequency distribution table

  • @mbout3456
    @mbout3456 2 ปีที่แล้ว

    Hello Jason, Thank you for the video. What does the standard deviation mean in your last table for the categorical vatiables? Thanks again.

    • @jasonburns2579
      @jasonburns2579  2 ปีที่แล้ว

      Hi and great question! When specifying a variable as an indicator (using "i."), in the backgroun Stata then treats each value of the variable as binary where 1 means that an observation is in that group and 0 means that it is not. That is then used to calculate proportions (in the mean column) and standard deviations. Hope this helps!

    • @mbout3456
      @mbout3456 2 ปีที่แล้ว

      @@jasonburns2579 thanks Jason, however I still don’t know how to interpret the standard deviation stats in this case.

    • @jasonburns2579
      @jasonburns2579  2 ปีที่แล้ว

      @@mbout3456 Ah ok. Here the standard deviations can be interpreted as a standard deviation for a proportion. The text here is unfortunately a but clunky but there are some good sources with more detail on this topic that can be found online

  • @kebedetaye-o7j
    @kebedetaye-o7j ปีที่แล้ว

    I am student please reales as free the data of stata

    • @jasonburns2579
      @jasonburns2579  ปีที่แล้ว

      You can download a copy of the data from my website at www.jasonburnsphd.com/new-jersey-school-performance-data but you will need your own copy of Stata