[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: easy way to put frequencies distribution output in a table |

Date |
Sat, 6 Dec 2008 15:05:59 +0100 |

Mandy,

********* sysuse auto, clear xtile quintmpg = mpg, nquantiles(5) contract quintmpg rep78 foreign by quint for, sort : egen float percent = pc(_freq) format percent %3.1fc tabdisp rep f , cellvar(percent) by( quintmpg) ********* HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Friday, December 05, 2008 8:29 PM Subject: st: easy way to put frequencies distribution output in a table

Hi all, Could someone please help me with an easy way to put frequencies distribution output in a table? What I want to do is to fill the following table of male and females distribution of education attainment in each IQ score quintile( eg. to calculate the percentages shown for quin tile 1 below) ___________________________________________ male female (%) (%)IQ score quintile 1 100.00100.00a. high school graduates and lower 80.00 85.00b. some college 10.0010.00c. college graduates 8.006.00d. advanced degrees 2.004.00IQ score quintile 2 a. high school graduates and lower b. some college c. college graduates d. advanced degrees IQ score quintile 3 a. high school graduates and lower b. some college c. college graduates d. advanced degrees .......................................... __________________________________________ If I use command like: . by IQquintile: tabulate education if male==1 . by IQquintile: tabulate education if female==1 (variable "IQquintile" means IQ score quintile. "education" is the category variable for the four education groups seen above. ) I could get the numbers I want to fill the above table. But I need to copy and paste each number into the table or type the numbers one by one. This process takes time, if there are lots of groups. So, I was wondering if there's any easier way to do this. Thanks for your help! Mandy * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Re: easy way to put frequencies distribution output in a table***From:*"Mandy fu" <mandy.fu1@gmail.com>

**References**:**st: easy way to put frequencies distribution output in a table***From:*"Mandy fu" <mandy.fu1@gmail.com>

- Prev by Date:
**st: Re: IV tests in Stata** - Next by Date:
**Re: st: Re: graph matrix by(x, norescale) doesn't work** - Previous by thread:
**st: Re: easy way to put frequencies distribution output in a table** - Next by thread:
**Re: st: Re: easy way to put frequencies distribution output in a table** - Index(es):

© Copyright 1996–2017 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |