Statalist The Stata Listserver


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

st: RE: Fillin missing values, probability for new value


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Fillin missing values, probability for new value
Date   Wed, 18 Jan 2006 17:41:34 +0100

Hi Pamela,

You could do:
replace st = 1 if runif()<prob1 & st==.
replace st = 2 if st==.

This will ensure that you get each code with the right probability.

Even better would be to make multiple completed datasets this way. If you type -findit multiple imputation- you find several tools that help you analyse multiply imputed datasets.

HTH,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Pamela Mueller
Sent: woensdag 18 januari 2006 17:29
To: statalist@hsphsun2.harvard.edu
Subject: st: Fillin missing values, probability for new value

I  need to fill in missing values in my dataset. For most sectors I know
how many start-ups there were for each year, but the data was not given
if the number of startups (st) is less than 3 (hence one or two).
Therefore, I know if the missing is 1 or 2 and I know the probability
for either one. I also know how often 1 or 2 should be each given in
total for each year.
I tried recode, impute, mvencode but it did not work.
Maybe someone has a hint? Thanks
Pamela

for each year and region the data looks like this:
sect         st         prob1      prob2
1             4
2             3          
3             .            0.3           0.7
4             8
5             0
6              .           0.45         0.55
7             3
8             5
9              .           0.48         0.52

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Pamela Mueller

Max Planck Institute of Economics
Kahlaische Strasse 10
07745 Jena, Germany

tel +49 3641 686 723
fax +49 3641 686 710

pmueller@econ.mpg.de
www.econ.mpg.de

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

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



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