Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: To expand the value of a constant variable across the panel


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: To expand the value of a constant variable across the panel
Date   Thu, 1 Apr 2010 18:54:40 +0100

This point is addressed in detail in an FAQ. 

FAQ     . . . . . . . . . . . . . . . . . . . . . . . Replacing missing values
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        2/03    How can I replace missing values with previous or
                following nonmissing values?
                http://www.stata.com/support/faqs/data/missing.html

See also 

FAQ     . . . . . .  Listing observations in a group that differ on a variable
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        11/01   How do I list observations in a group that differ
                on a variable?
                http://www.stata.com/support/faqs/data/diff.html

Nick 
n.j.cox@durham.ac.uk 

Eduardo Nunez

I have longitudinal data where patients have information on several timepoints.
Some values from constant variables are missing. How should I fill in
these observations across the panel (pte id)?

Example:
pid  visit#  gender
1      1          1
1      2           .
1      3           .
1      4           1
2      1           .
2      2           .
2      3           0
2      4           .
etc..................

I did tried the ssc program "enlarge" but reported error when values
existed more than once (as in pte 1).


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index