📄 duplicates.hlp
字号:
{smcl}
{* 28mar2005}{...}
{cmd:help duplicates}{right:dialogs: {dialog duplicates_report:report} {dialog duplicates_examples:examples} {dialog duplicates_list:list}}
{right: {dialog duplicates_browse:browse} {dialog duplicates_tag:tag} {dialog duplicates_drop:drop}{space 5}}
{hline}
{title:Title}
{p2colset 5 23 25 2}{...}
{p2col :{hi:[D] duplicates} {hline 2}}Report, tag, or drop duplicate observations{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Report duplicates
{p 8 10 2}
{cmd:duplicates} {opt r:eport} [{varlist}] {ifin}
{phang}
List examples of duplicates
{p 8 10 2}
{cmd:duplicates} {opt e:xamples} [{varlist}] {ifin}
[{cmd:,} {it:{help duplicates##options:options}}]
{phang}
List all duplicates
{p 8 10 2}
{cmd:duplicates} {opt l:ist} [{varlist}] {ifin}
[{cmd:,} {it:{help duplicates##options:options}}]
{phang}
View duplicates in browser
{p 8 10 2}
{cmd:duplicates} {opt b:rowse} [{varlist}] {ifin}
[{cmd:,} {opt nol:abel}]
{phang}
Tag duplicates
{p 8 10 2}
{cmd:duplicates} {opt t:ag} [{varlist}] {ifin}
{cmd:,} {opth g:enerate(newvar)}
{phang}
Drop duplicates
{p 8 10 2}
{cmd:duplicates} {opt drop} {ifin}
{p 8 10 2}
{cmd:duplicates} {opt drop} {varlist} {ifin}
{cmd:, force}
{synoptset 23 tabbed}{...}
{marker options}{...}
{synopthdr}
{synoptline}
{syntab :Main}
{synopt :{opt c:ompress}}compress width of columns in both table and display formats{p_end}
{synopt :{opt noc:ompress}}use display format of each variable{p_end}
{synopt :{opt fast}}synonym for {opt nocompress}; no delay in output of large datasets{p_end}
{synopt :{opt ab:breviate(#)}}abbreviate variable names to {it:#} characters; default is {cmd:ab(8)}{p_end}
{synopt :{opt str:ing(#)}}truncate string variables to {it:#} characters; default is {cmd:string(10)}{p_end}
{syntab :Options}
{synopt :{opt t:able}}force table format{p_end}
{synopt :{opt d:isplay}}force display format{p_end}
{synopt :{opt h:eader}}display variable header once; default is table mode{p_end}
{synopt :{opt noh:eader}}suppress variable header{p_end}
{synopt :{opt h:eader(#)}}display variable header every {it:#} lines{p_end}
{synopt :{opt clean}}force table format with no divider or separator lines{p_end}
{synopt :{opt div:ider}}draw divider lines between columns{p_end}
{synopt :{opt sep:arator(#)}}draw a separator line every {it:#} lines; default is {cmd:separator(5)}{p_end}
{synopt :{opth sepby(varlist)}}draw a separator line whenever {it:varlist} values change{p_end}
{synopt :{opt nol:abel}}display numeric codes rather than label values{p_end}
{syntab :Summary}
{synopt :{opt mean}[{cmd:(}{varlist}{cmd:)}]}add line reporting the mean for each of the (specified) variables{p_end}
{synopt :{opt sum}[{cmd:(}{varlist}{cmd:)}]}add line reporting the sum for each of the (specified) variables{p_end}
{synopt :{opt N}[{cmd:(}{varlist}{cmd:)}]}add line reporting the number of nonmissing values for each of the (specified) variables{p_end}
{synopt :{opth lab:var(varname)}}substitute {opt Mean}, {opt Sum}, or {opt N} for {it:varname} in last row of table{p_end}
{syntab :Advanced}
{synopt :{opt con:stant}[{cmd:(}{varlist}{cmd:)}]}separate and list variables that are constant only once{p_end}
{synopt :{opt notr:im}}suppress string trimming{p_end}
{synopt :{opt abs:olute}}display overall observation numbers when using {opt by} {it:varlist}{cmd::}{p_end}
{synopt :{opt nodotz}}display numerical values equal to {opt .z} as field of blanks{p_end}
{synopt :{opt subvar:name}}substitute characteristic for variable name in header{p_end}
{synopt :{opt line:size(#)}}columns per line; default is {cmd:linesize(79)}{p_end}
{synoptline}
{p2colreset}{...}
{title:Description}
{pstd}
{cmd:duplicates} reports, displays, lists, browses, tags,
or drops duplicate observations, depending on the subcommand specified.
Duplicates are observations with identical values either on all
variables if no {varlist} is specified or on a specified {it:varlist}.
{pstd}
{cmd:duplicates report} produces a table showing observations
that occur as one or more copies and indicating how many observations are
"surplus" in the sense that they are the second (third, ...) copy of the first
of each group of duplicates.
{pstd}
{cmd:duplicates examples} lists one example for each group of
duplicated observations. Each example represents the first occurrence of each
group in the dataset.
{pstd}
{cmd:duplicates list} lists all duplicated observations.
{pstd}
{cmd:duplicates browse} opens the Data Editor on the duplicated
observations. You may not change the data while in the Editor.
See {helpb browse}.
{pstd}
{cmd:duplicates tag} generates a variable representing the number of
duplicates for each observation. This will be 0 for all
unique observations.
{pstd}
{cmd:duplicates drop} drops all but the first occurrence of each group
of duplicated observations. The word {opt drop} may not be abbreviated.
{pstd}
Any observations that do not satisfy specified {opt if} and/or {opt in}
conditions are ignored when you use {opt report}, {opt examples}, {opt list},
{opt browse}, or {opt drop}. The variable created by {opt tag} will have
missing values for such observations.
{title:Options for duplicates examples and duplicates list}
{dlgtab:Main}
{phang}
{opt compress}, {opt nocompress}, {opt fast}, {opt abbreviate(#)},
{opt string(#)}; see {helpb list}.
{dlgtab:Options}
{phang}
{opt table}, {opt display}, {opt header}, {opt noheader}, {opt header(#)},
{opt clean}, {opt divider}, {opt separator(#)}, {opth sepby(varlist)},
{opt nolabel}; see {helpb list}.
{dlgtab:Summary}
{phang}
{opt mean}[{cmd:(}{varlist}{cmd:)}], {opt sum}[{cmd:(}{it:varlist}{cmd:)}],
{opt N}[{cmd:(}{it:varlist}{cmd:)}], {opt labvar(varname)}; see {helpb list}.
{dlgtab:Advanced}
{phang}
{opt constant}[{cmd:(}{varlist}{cmd:)}], {opt notrim}, {opt absolute}, {opt nodotz}, {opt subvarname}, {opt linesize(#)}; see {helpb list}.
{title:Option for duplicates browse}
{phang}
{cmd:nolabel} displays the underlying numeric values rather than the
label values in the Editor for variables with value labels.
This option is seldom specified.
{title:Option for duplicates tag}
{phang}
{opth generate(newvar)} is required and specifies the name of a new variable
that will tag duplicates.
{title:Option for duplicates drop}
{phang}
{opt force} specifies that observations duplicated with respect to a named
{varlist} be dropped. The {cmd:force} option is required when such
a {it:varlist} is given as a reminder that information may be lost by dropping
observations, given that those observations may differ on any of the variables
not included in {it:varlist}.
{title:Examples}
{phang}{cmd:. duplicates report}
{phang}{cmd:. duplicates examples}
{phang}{cmd:. duplicates list}
{phang}{cmd:. duplicates browse}
{phang}{cmd:. duplicates tag, generate(tag)}
{phang}{cmd:. duplicates drop}
{phang}{cmd:. duplicates drop a b c, force}
{title:Also see}
{psee}
Manual: {bf:[D] duplicates}
{psee}
Online: {helpb codebook}, {helpb contract}, {helpb edit}, {helpb isid},
{helpb list}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -