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

st: RE: Dealing with string variables

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Dealing with string variables
Date   Tue, 10 Aug 2004 15:57:33 +0100

After merging the files, 

. list initial? if initial1 != initial2 

Occasionally with this kind of data, extra
spaces creep in. So I would first do 

. replace initial1 = trim(initial1) 
. replace initial2 = trim(initial2) 

Of course, you might have a problem. If 
your identifier information is not 
very reliable, it might be difficult 
to carry out a -merge-, but the only 
way to find out is to try and see. 

[email protected] 

Banya, Winston 
> I have 2 files that have some variables in common. Some of 
> the variables ate string for example patient's initials. Our 
> forms are scanned and I have programs to check the data 
> quality. However I am not sure of how to distinguish between 
> 2 string variables that should be the same. 
> If in file one I have initial (renamed initial1) as AAA and 
> in file 2 (renamed initial2) as AAH for the same patient what 
> command do I use to pick up the discrepancy? 

*   For searches and help try:

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