Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: calculating proportions

 From Ekaterina Hertog To "statalist@hsphsun2.harvard.edu" Subject Re: st: calculating proportions Date Mon, 20 Feb 2012 23:47:13 +0000

```Hello Oliver,
Here is as far as I got:

table income sex, c(freq) replace
rename table1 freq
bysort sex: egen totrefsex=total(freq)
gen populincprop = (freq*100)/totrefsex

```
As a result I have a table which gives me proportions of the total population of each sex for every income level reported. What I need, however is to calculate the proportions of members of the opposite sex that earn as much, more and less than self and I cannot think of a neat way to do this.
```Ekaterina

On 20/02/2012 12:11, Oliver Jones wrote:
```
```Hello Ekaterina,

it would be helpful if you provide the code you have written.

Kind regards
Oliver

Am 20.02.2012 12:49, schrieb Ekaterina Hertog:
```
```Dear all,
I use Stata 12. I have a dataset which includes id number, sex and income information for
every individual. I would like to construct for every man 3 variables: what is the proportion
of the total female population that earns as much as he does, that earns less than he does,
and that earns more than he does. I have tried creating a table which gives me frequencies of
individuals by sex by income, but am getting stuck at that stage.
Any help would be appreciated,
Ekaterina

*
* 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/
```
```
*
*   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/
```