Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: filling in missing string


From   "Terra Curtis" <terra.curtis@cambridgefinance.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: filling in missing string
Date   Fri, 6 Jan 2006 16:45:15 -0500

Nick,

There are multiple products per molecule...

What does putting "molecule" in parentheses do in this line:
bysort product (molecule) : replace... 

Thanks again.


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Friday, January 06, 2006 4:36 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: filling in missing string

If there is a one-to-one match between -product- and -molecule-, then 

bysort product (molecule) : replace molecule = molecule[_N] if mi(molecule) 

may be what you want, as the non-missing strings get sorted to the end of
each block. 

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

Terra Curtis
 
> I have a dataset which looks like:
> 
> 	Product	company	molecule
> 	A		X		x1
> 	A		Y		
> 	A		Z		x1
> 	.		.		.
> 	.		.		.
> 	.		.		.
> 
> I have several examples of this throughout a large dataset.  
> I want to fill
> in the missing "x1" under the molecule variable.  Is there some way to 
> do this using -by product- ?

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