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: Filling missing rank information


From   "Trelle Sven" <strelle@ctu.unibe.ch>
Subject   st: Re: Filling missing rank information
Date   Mon, 25 Oct 2010 17:44:21 +0200

Dear all,
It is Monday... My solution I found out myself is using a second file with only the fixed ranks 2-9 and merge it with the datafiles. Sorry to bother you. Sven

--

Am 25.10.2010 um 16:54 schrieb "Trelle Sven" <strelle@ctu.unibe.ch>:

> Dear all,
> I have several datasets with two variables: rank (integer) and prop
> (numeric variable). All datasets should have 8 observations in the end
> and ranks should range from 2 to 9. However, some datasets have less
> than 8 observations due to missing information (the number of missing
> ranks is different in the different datasets, however). I want to fill
> in the missing rank variable with the missing ranks (and replace the
> prop variable for these ranks with 0 which obviously isn't a problem). 
> I started to program a very complicated way but are currently stuck and
> can imagine that there is an easy way to do it ... (I can easiliy fill
> in ranks if they are missing at the extremes but if ranks are missing in
> the middle?).
> Does anybody have an idea?
> 
> Below is an extract of possible datasets 
> 
> Thanks for any help in advance.
> Sven
> 
> ex1
> rank    prop
> 5    0.1
> 6    0.5
> 9    0.01
> 
> => should be
> rank    prop
> 2    0
> 3    0
> 4    0
> 5    0.1
> 6    0.5
> 7    0
> 8    0
> 9    0.01
> 
> ex2
> rank    prop
> 2    0.006
> 3    0.03
> 4    0.005
> 
> ex3
> rank    prop
> 2    0.006
> 3    0.03
> 4    0.005
> 5    0.1
> 6    0.5
> 9    0.01


*
*   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