proportion
The share of rows in each category, with a margin of error.
What we have
- the share in each category, with standard errors
Coming later
- a survey design; use svy: proportion
You may shorten it to prop.
How you write it
proportion var
Square brackets mean optional. A vertical bar means choose one.
What it does
proportion sector gives the fraction rural and the fraction urban, each with a standard error and confidence interval. tabulate gives you the same shares without the precision; this adds it.
Try it
Every example below was run after sysuse vira.sample02, clear.
. proportion sector
Proportion estimation
Number of obs = 6,000
Design df = 5,999
| Proportion Std. err. [95% conf. interval]
-----------------+--------------------------------------------------------
sector=Rural | .6645 .006096131 .6525494 .6764506
sector=Urban | .3355 .006096131 .3235494 .3474506
The same thing in pandas and in R
pandas
# proportion of ['sector'] with linearised standard errors
R
# no R form for `proportion` yet -- see docs/r-equivalents.md