hi, I have an aggregate dataset that I would like to do simple chi square and t-test on. I imagine this is a simple task but I am stuck. I would like a three way summary looking at 2 separate tables of fatalities and non-fatalities, each looking at the mean of injuries by airline and gender. I can do this very easily with my code below. But I also have the total number of flights for each airline, airline 1, n = 553 and airline 2, n = 678. I am not sure how to incorporate these two totals into the analysis. Do I create a new variable by airline that has repeated values of these Ns? How do I incorporate the Ns into the analysis? Do I use them as weight factors? Thank you in advance.
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
----------------------- copy starting from the next line -----------------------
Code:
keep if fatality==1 bysort airline gender: sum (injuries)
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(airline injuries) double gender byte fatality 1 11 0 1 1 7 0 0 1 7 1 0 1 19 0 0 2 9 0 0 2 4 1 1 2 3 1 0 2 1 1 0 2 3 0 1 end