{smcl}
{* *! version 1.1  6sep2008}{...}
{cmd:help repshow}
{hline}

{title:Title}

    {hi:repshow} - Replace observations and show what has been changed


{title:Syntax}

{p 8 17 2}
{cmd:replace}
{it:oldvar}
{cmd:=}{it:exp}
{ifin}
[{cmd:,} {opt nop:romote} {opth id(varname)} {opth l:istvars(varlist)} {opt v:erbose} *]

{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:Main}
{synopt:{opt nop:romote}}prevent promotion of a variable type{p_end}
{synopt:{opth id(varname)}}variable to identify listed observations{p_end}
{synopt:{opth l:istvars(varlist)}}additional variable(s) listed for changed observations{p_end}
{synopt:{opt v:erbose}}provide additional details on the operation{p_end}
{synopt:{opt *}}options passed through to the {help list} command{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{cmd:by} is not allowed; see {manhelp by D}.{p_end}
{p 4 6 2}
{cmd:weight}s are not allowed; see {help weight}.


{title:Description}

{pstd}
{cmd:repshow} shows the changes made by the {help replace} command.
Basic syntax is exactly like {help replace}. Options {opth id(varname)}
and {opth l:istvars(varlist)} display the values of other variables for
the same observations that are changed by the {help replace} command.
These options are for information only. {cmd:repshow} makes use of the
{opt mean} and {opt N} options of the {help list} command to display these
summary statistics for the changed observations. In addition any options
which typically apply to the {help list} commmand can be added. 

{title:Options}

{phang}
{opt nopromote} prevents {opt replace} from promoting the 
{help data types:variable type} to accommodate the change.  
See help for {help replace} for details.

{phang}
{opt id} selects a variable for the first column of the output so the user 
can identify the changed observations.

{phang}
{opt listvars} selects additional variables to be displayed to give the user 
further information about the changed observations.

{phang}
{opt verbose} adds some explanatory text to the output, but does not change 
the results.


{title:Remarks}

{pstd}
The {cmd:repshow} command does NOT work on string variables.  If {it:oldvar} 
is a string variable, {cmd:repshow} produces the error message "type mismatch" 
even when this is not correct.

{pstd}
The {cmd:repshow} command lists the old and new versions of the replaced 
variable for every replaced observation.  Thus if the user intends 
to change the values of hundreds of observations the replaced command 
may be more convenient.


{title:Example}

{com}. repshow rxc1 = 1000 if code==15, id(nation) listvars(rxc2 art year) verbose
{txt}(17 real changes made)

Comparison of -{res}rxc1{txt}- before and after execution of -replace-
  The column -{res}nation{txt}- identifies the observations
  The column -{res}Old vrsn{txt}- gives the values of -{res}rxc1{txt}- before the replace.
  The column -{res}New vrsn{txt}- gives the values of -{res}rxc1{txt}- after the replace.
  The column(s) {res}rxc2 art year{txt} are for information only.

      {c TLC}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c TRC}
      {c |} {res} nation   Old vrsn   New vrsn    rxc2   art   year {txt}{c |}
      {c LT}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c RT}
 205. {c |} {res}Bolivia          .      1,000       .     .   2004 {txt}{c |}
 206. {c |} {res}Bolivia          .      1,000       .     .   2005 {txt}{c |}
 207. {c |} {res}Bolivia        222      1,000   2,123   299   2006 {txt}{c |}
 208. {c |} {res}Bolivia        222      1,000   2,123   288   2007 {txt}{c |}
 209. {c |} {res}Bolivia        222      1,000   2,123   290   2008 {txt}{c |}
      {c LT}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c RT}
 210. {c |} {res}Bolivia        222      1,000   2,123   298   2009 {txt}{c |}
 211. {c |} {res}Bolivia        222      1,000   2,123   307   2010 {txt}{c |}
 212. {c |} {res}Bolivia        222      1,000   2,123   318   2011 {txt}{c |}
 213. {c |} {res}Bolivia        222      1,000   2,123   331   2012 {txt}{c |}
 214. {c |} {res}Bolivia        222      1,000   2,123   346   2013 {txt}{c |}
      {c LT}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c RT}
 215. {c |} {res}Bolivia        222      1,000   2,123   363   2014 {txt}{c |}
 216. {c |} {res}Bolivia        222      1,000   2,123   379   2015 {txt}{c |}
 217. {c |} {res}Bolivia        222      1,000   2,123   397   2016 {txt}{c |}
 218. {c |} {res}Bolivia        222      1,000   2,123   414   2017 {txt}{c |}
 219. {c |} {res}Bolivia        222      1,000   2,123   430   2018 {txt}{c |}
      {c LT}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c RT}
 220. {c |} {res}Bolivia        222      1,000   2,123   447   2019 {txt}{c |}
 221. {c |} {res}Bolivia        222      1,000   2,123   462   2020 {txt}{c |}
      {c LT}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c RT}
 Mean {c |} {res}               222      1,000   2,123   358   2012 {txt}{c |}
    N {c |} {res}                15         17      15    15     17 {txt}{c |}
      {c BLC}{hline 9}{c -}{hline 10}{c -}{hline 10}{c -}{hline 7}{c -}{hline 5}{c -}{hline 6}{c BRC}


{title:Author}

{p 4 8 20} 
{browse "http://www.cgdev.org/content/experts/detail/10007/":Mead Over},
Center for Global Development, Washington, DC 20036 USA. Email:
{browse "mailto:mover@cgdev.org":MOver@CGDev.Org} if you observe any
problems. 

