This is an FAQ.
replace Parent = Parent[_n-1] if missing(Parent)
would work in this example.
More generally, see
How can I replace missing values with previous or following nonmissing values?
How can I replace missing values within sequences?
http://www.stata.com/support/faqs/data/missing.html
Bob Yaffee's approach based on pretending that this is a panel
data set can thus be avoided. His further suggestion of
using -destring- wouldn't work, as -Parent- has no numeric
interpretation, and is also unnecessary, as the logic of
the device above applies to both numeric and string variables.
Nick
[email protected]
Socrates Mokkas
> I have a question related to data manipulation. My data sample is
> like that:
>
> Parent Subsidiary
> A B
> C
> D
> F
> X J
> L
> Z T
>
> What I want is to fill the gaps of the ParName.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/