Statalist


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

st: AW: how to check that demographic values within the same zipcode are identical?


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: how to check that demographic values within the same zipcode are identical?
Date   Sun, 16 Aug 2009 20:38:02 +0200

<> 

Another take on this is to check for the sd within variables and zipcodes.
Any deviation from zero prompts you to investigate...


*************
clear*

input str10 zipcode var1 /* 
 */ var2 var3 var4 var5  
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0183204"	90	8	8	8	0
"0183204"	90	8	8	8	0
"0183331"	772	81	64	62	17
"0183331"	772	81	64	62	17
"0183331"	772	81	64	62	17
"0183505"	1816	262	218	211	44
"0183505"	1816	262	218	211	44
end

compress
list, noobs /* 
 */ sepby(zipcode)

collapse (sd) var1 var2 /* 
 */ var3 var4 var5, /* 
 */ by(zipcode)

list, noobs
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Ekaterina
Hertog
Gesendet: Sonntag, 16. August 2009 17:54
An: [email protected]
Betreff: st: how to check that demographic values within the same zipcode
are identical?

Dear all,
I am trying to check the dataset I am working with. It is a dataset of
neighbourhood demographic values and I want to confirm that the demographic
variables associated with each zipcode are identical. 
The data looks as follows:
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0182801"	1253	144	115	113	29
"0183204"	90	8	8	8	0
"0183204"	90	8	8	8	0
"0183331"	772	81	64	62	17
"0183331"	772	81	64	62	17
"0183331"	772	81	64	62	17
"0183505"	1816	262	218	211	44
"0183505"	1816	262	218	211	44
The first variable is the zipcode the rest are demographics.

I tried something like:
by zipcode: assert   totalwom1519[_n]==totalwom1519[_n+1]
but it clearly did not do what I wanted it to.
Would anyone know how to do it?
Sincerely yours,
Ekaterina


-- 
Ekaterina Hertog (nee Korobtseva)
Nissan Institute of Japanese Studies
27 Winchester Road, Oxford
OX2 6NA

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


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index