Hello Everyone,
I am face with another challenge, I am pretty sure I will get the solution. below is the sample of my dataset
hhid is the household id repeats for all entries in the household
memberid is theid assigned to each member within the household
relationship indicates hierarchy within the household (1 is for head of the household)
phoneno stored the phone number
the last column stored the telephone number of the household. I want to
1. ensure that all member of the household have the same phone number using the phone number assigned to the head of the household (relationship ==1);
2. ensure that the phone number is 11 digits.
3. list out all the household that did not meet the above criteria for further cleaning.
I am face with another challenge, I am pretty sure I will get the solution. below is the sample of my dataset
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 hhid str9 memberid float relationdhip str10 phoneno "1" "1" 1 "0803431100" "1" "1" 2 "0803431100" "1" "2" 2 "0803431100" "1" "3" 3 "0803431100" "2" "1" 1 "0709849988" "2" "2" 5 "0709823420" "3" "1" 1 "0812782771" "3" "2" 2 "08126377" "3" "3" 4 "0812782771" "3" "4" 3 "081279882" "4" "1" 1 "0809588399" "5" "1" 2 "0907626666" "5" "2" 1 "0907626666" end
memberid is theid assigned to each member within the household
relationship indicates hierarchy within the household (1 is for head of the household)
phoneno stored the phone number
the last column stored the telephone number of the household. I want to
1. ensure that all member of the household have the same phone number using the phone number assigned to the head of the household (relationship ==1);
2. ensure that the phone number is 11 digits.
3. list out all the household that did not meet the above criteria for further cleaning.
Comment