来自 SSC的社区贡献命令fre
允许将数据集中未出现的标记值列表为具有零频率。这是一个例子:
. sysuse auto, clear
(1978 Automobile Data)
. fre foreign
foreign -- Car type
----------------------------------------------------------------
| Freq. Percent Valid Cum.
-------------------+--------------------------------------------
Valid 0 Domestic | 52 70.27 70.27 70.27
1 Foreign | 22 29.73 29.73 100.00
Total | 74 100.00 100.00
----------------------------------------------------------------
. label def origin 42 "Extraterrestrial", add
. fre foreign
foreign -- Car type
----------------------------------------------------------------
| Freq. Percent Valid Cum.
-------------------+--------------------------------------------
Valid 0 Domestic | 52 70.27 70.27 70.27
1 Foreign | 22 29.73 29.73 100.00
Total | 74 100.00 100.00
----------------------------------------------------------------
. fre foreign, includelabeled
foreign -- Car type
-------------------------------------------------------------------------
| Freq. Percent Valid Cum.
----------------------------+--------------------------------------------
Valid 0 Domestic | 52 70.27 70.27 70.27
1 Foreign | 22 29.73 29.73 100.00
42 Extraterrestrial | 0 0.00 0.00 100.00
Total | 74 100.00 100.00
-------------------------------------------------------------------------
. ssc desc fre
--------------------------------------------------------------------------------------------------------
package fre from http://fmwww.bc.edu/repec/bocode/f
--------------------------------------------------------------------------------------------------------
TITLE
'FRE': module to display one-way frequency table
DESCRIPTION/AUTHOR(S)
fre displays, for each specified variable, a univariate
frequency table containing counts, percent, and cumulative
percent. Variables may be string or numeric. Labels, in full
length, and values are printed. By default, fre only tabulates
the smallest and largest 10 values (along with all missing
values), but this can be changed. Furthermore, values with zero
observed frequency may be included in the tables. The default
for fre is to display the frequency tables in the results
window. Alternatively, the tables may be written to a file on
disk, either tab-delimited or LaTeX-formatted.
KW: data management
KW: frequencies
KW: frequency table
KW: tabulation
Requires: Stata version 9.2
Distribution-Date: 20150603
Author: Ben Jann, University of Bern
Support: email jann@soz.unibe.ch
INSTALLATION FILES (type net install fre)
fre.ado
fre.hlp
ANCILLARY FILES (type net get fre)
fre.zip
--------------------------------------------------------------------------------------------------------
(type ssc install fre to install)