# Need STATA Help! Using Egen/tabstat Function

• November 14th 2013, 05:29 AM
damasta06
Need STATA Help! Using Egen/tabstat Function
Go to the web site of one of the paper's authors, Professor
* Andrew Bernard of Dartmouth University:
* Andrew B. Bernard - Tuck School of Business
* Once there, click on "Olympic Predictions."
* version - not journal formatted." (The pages in the two papers are different.)
* Also download the data set that was used in the published paper (an MS Excel file.)

*Import the MS Excel "RESTAT Olympic Data" set and
* produce the standard descriptive statistics for the dataset.

I have done the above portion and am stuck on this following portion below using the egen and tabstat function:

"Calculate medal shares for total medals won, for each country, by year. The medal share for country in a year is the proportion of the total number of medals awarded in that year's Olympics that is awarded to the country. To calculate the medal shares, first use an egen function to calculate the total number of medals won in each Olympic year. Then you can generate the yearly medal shares for each country. Label the new variable appropriately."

"Use the tabstat command to check that your calculation of the
* new medal share variable is correct. Tabulate the the total medals won and
* the medal share by year.
* Include the the following statistics:
* the number of observations, the sum, the minimum, the maximum, and the mean."