Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Data Manipulation Question

From   "Nick Cox" <>
To   <>
Subject   RE: st: Data Manipulation Question
Date   Sun, 19 Nov 2006 17:23:57 -0000

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?

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. 


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:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index