📄 contract.hlp
字号:
{smcl}
{* 22feb2005}{...}
{cmd:help contract}{right:dialog: {bf:{dialog contract}}}
{hline}
{title:Title}
{p2colset 5 21 23 2}{...}
{p2col :{hi:[D] contract} {hline 2}}Make dataset of frequencies and
percentages{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 17 2}
{cmd:contract}
{varlist}
{ifin}
{weight}
[{cmd:,} {it:options}]
{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab :Options}
{synopt :{opth f:req(newvar)}}name of frequency table; default is {opt _freq}
{p_end}
{synopt :{opth cf:req(newvar)}}create cumulative frequency variable{p_end}
{synopt :{opth p:ercent(newvar)}}create percentage variable{p_end}
{synopt :{opth cp:ercent(newvar)}}create cumulative percentage variable{p_end}
{synopt :{opt float}}generate percentage variables as type {opt float}{p_end}
{synopt :{opth form:at(format)}}display format for new percentage variables;
default is {cmd:format(%8.2f)}{p_end}
{synopt :{opt z:ero}}include combinations with frequency zero{p_end}
{synopt :{opt nomiss}}drop observations with missing values{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{opt fweight}s are allowed; see {help weight}.
{p_end}
{title:Description}
{pstd}
{opt contract} replaces the dataset in memory with a new dataset consisting
of all combinations of {varlist} that exist in the data and a new
variable that contains the frequency of each combination.
{title:Options}
{dlgtab:Options}
{phang}
{opth freq(newvar)} specifies a name for the frequency
variable. If no name is specified, {opt _freq} is used. The name must be new.
{phang}
{opth cfreq(newvar)} specifies a name for the
cumulative frequency variable. If no name is specified, no cumulative frequency
variable is created. The name must be new.
{phang}
{opth percent(newvar)} specifies a name for the percentage variable.
If not specified, no percent variable is created. The
name must be new.
{phang}
{opth cpercent(newvar)} specifies a name for the
cumulative percentage variable. If not specified, no cumulative percentage
variable is created. The name must be new.
{phang}
{opt float} specifies that the percentage variables specified by
{opt percent()} and {opt cpercent()} will be generated as variables of type
{helpb data types:float}. If {opt float} is not specified, these variables
will be generated as variables of type {helpb double}. All generated variables
are compressed to the smallest storage type possible without loss of
precision; see {helpb compress}.
{phang}
{opth format(format)} specifies a
display format for the generated percentage variables specified
by {opt percent()} and {opt cpercent()}. If {opt format()} is not specified,
these variables will have the display format {cmd:%8.2f}.
{phang}
{opt zero} specifies that combinations with frequency zero be included.
{phang}
{opt nomiss} specifies that observations with missing values on any of
the variables in {varlist} be dropped. If {opt nomiss} is not specified, all
observations possible are used.
{title:Examples}
{phang}{cmd:. contract foreign rep78}{p_end}
{phang}{cmd:. contract foreign rep78, zero}{p_end}
{phang}{cmd:. contract foreign rep78, f(count) zero nomiss}{p_end}
{phang}{cmd:. contract foreign rep78, p(percentage) cf(cumfreq) cp(cumperc)}{p_end}
{phang}{cmd:. contract _all}{p_end}
{title:Also see}
{psee}
Manual: {bf:[D] contract}
{psee}
Online: {helpb collapse}, {helpb duplicates},
{helpb expand}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -