📄 mvencode.hlp
字号:
{smcl}
{* 23feb2005}{...}
{cmd:help mvencode}, {cmd:help mvdecode} {right:dialogs: {bf:{dialog mvencode}} {bf:{dialog mvdecode}}}
{hline}
{title:Title}
{p2colset 5 21 23 2}{...}
{p2col :{hi:[D] mvencode} {hline 2}}Change missing values to numeric values and vice versa{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Change missing values to numeric values
{p 8 18 2}
{cmd:mvencode} {varlist} {ifin}{cmd:,} {cmd:mv(}{it:#}|{it:mvc}{cmd:=}{it:#} [{bind:{cmd:\} {it:mvc}{cmd:=}{it:#}}...]
[{bind:{cmd:\} {cmd:else=}{it:#}}]{cmd:)} [{opt o:verride}]
{phang}
Change numeric values to missing values
{p 8 18 2}
{cmd:mvdecode} {varlist} {ifin}{cmd:,}
{cmd:mv(}{it:numlist} | {it:numlist}{cmd:=}{it:mvc}
[{bind:{cmd:\} {it:numlist}{cmd:=}{it:mvc}}...]{cmd:)}
{phang}
where {it:mvc} is one of {cmd:.}|{cmd:.a}|{cmd:.b}|...|{cmd:.z}
{title:Description}
{pstd}
{cmd:mvencode} changes missing values in the specified {varlist} to numeric
values.
{pstd}
{cmd:mvdecode} changes occurrences of a {it:{help numlist}} in the specified
{varlist} to a missing-value code.
{pstd}
Missing-value codes may be sysmiss {cmd:(.)} and the extended missing value
codes {cmd:.a}, {cmd:.b}, {cmd:...}, {cmd:.z}.
{pstd}
String variables in {varlist} are ignored.
{title:Options}
{dlgtab:Main}
{phang}
{cmd:mv(}{it:#}|{it:mvc}{cmd:=}{it:#} [{bind:{cmd:\} {it:mvc}{cmd:=}{it:#}}...] [{cmd:\} {opt else=}{it:#}]{cmd:)} is required and specifies the
numeric values to which the missing values are to be changed.
{pmore}
{opt mv(#)} specifies that all types of missing values be changed to {it:#}.
{pmore}
{opt mv(mvc=#)} specifies that occurrences of missing-value code {it:mvc} be
changed to {it:#}. Multiple transformation rules may be specified, separated
by a backward slash {cmd:\}. The list may be terminated by the special rule
{opt else=}{it:#}, specifying that all types of missing values not yet
transformed be set to {it:#}.
{pmore}
Examples: {cmd:mv(9)}, {cmd:mv(.=99\.a=98\.b=97)}, {cmd:mv(.=99\else=98)}
{phang}
{cmd:mv(}{it:numlist} | {it:numlist}{cmd:=}{it:mvc} [{cmd:\} {it:numlist}{cmd:=}{it:mvc}...]{cmd:)}
is required and specifies the numeric values that are to be changed to missing
values.
{pmore}
{cmd:mv(}{it:numlist}{cmd:=}{it:mvc}{cmd:)} specifies that the
values in {it:numlist} be changed into missing-value code {it:mvc}. Multiple
transformation rules may be specified, separated by a backward slash {cmd:\}.
See {helpb numlist} for the syntax of a numlist.
{pmore}
Examples: {cmd:mv(9)}, {cmd:mv(99=.\98=.a\97=.b)}, {cmd:mv(99=.\100/999=.a)}
{phang}
{opt override} specifies the protection provided by {cmd:mvencode} be
overridden. Without this option, {cmd:mvencode} refuses to make the requested
change if any of the numeric values are already used in the data.
{title:Examples}
{p 4 4 2}
Change numeric values to missing value codes
{p 8 12 2}{cmd:. mvdecode income, mv(-1)}{p_end}
{p 8 12 2}{cmd:. mvdecode _all, mv(9999 99999)}{p_end}
{p 8 12 2}{cmd:. mvdecode religion, mv(7/9=. \ 10/15=.a)}
{p 4 4 2}
Change missing value codes to numeric values
{p 8 12 2}{cmd:. mvencode income, mv(-1)}{p_end}
{p 8 12 2}{cmd:. mvencode _all, mv(999) override}{p_end}
{p 8 12 2}{cmd:. mvencode religion, mv(.=99 \ .a=999 \ else=9999)}{p_end}
{title:Also see}
{psee}
Manual: {bf:[D] mvencode}
{psee}
Online: {helpb generate}, {helpb recode}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -