The DHS Program User Forum - RDF feed
https://userforum.dhsprogram.com/index.php
Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=7104&th=4482#msg_7104
JREY2015-08-24T07:13:49-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8111&th=4482#msg_8111
Bridgette-DHS2015-08-25T11:48:45-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8112&th=4482#msg_8112
JREY2015-08-25T12:05:06-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8118&th=4482#msg_8118
I can understand why you are having difficulty. I see that this information was not coded onto the PR file in an efficient way. Every record in the household has all the information about the visits of all the members. It would have been better to code the information about, say, the person on line 3, just onto line 3. I think the best way to deal with this is to separate the information you need out, organize it by line number, and then merge back with the PR file.
The attached program will do this. It is a text file; you will probably want to put it into the Stata do file editor. You will need to change the paths. You will want to add more variables; I have shown where to do this.
The program puts the health information about each person onto that person's record. The file will only include the specific people who have had a visit. Let me know if you have questions.
]]>Bridgette-DHS2015-08-25T16:26:42-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8121&th=4482#msg_8121
JREY2015-08-26T08:22:49-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8123&th=4482#msg_8123
I realized that there is a simpler and more direct way to do the same thing that was described in my previous response. This Stata program will also put the variables sh209, sh210, etc., onto the record for the correct person in the household, but without requiring a merge. The result should be the same.
]]>Bridgette-DHS2015-08-26T10:55:55-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8131&th=4482#msg_8131
I am also interested in creating a similar file for each member in the household who were sick/injured in the last 30 days.I am using the command that you sent but replaced the variables with the relevant ones. However, I got stuck in the looping command after I generated the seqno variable. I changed the sequence number to 12 and the person's line number to sh203, but it is still not working. Could you please help me on this?
Thank you.
]]>JREY2015-08-27T09:00:55-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8149&th=4482#msg_8149
Please try the attached program. The main problem is that some of the indexed variables, such as sh203, have indices with a leading 0--for example, 01, 02, 03, rather than 1, 2, 3. Stata has a very powerful rename command, so you need to include " rename *_0* *_* " to get rid of those 0's.
Hope this will work.
]]>Bridgette-DHS2015-08-28T17:38:04-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8160&th=4482#msg_8160
Does it make sense to merge the "sick/injured" file and the "healthcare utilization" file into one dataset using the hv001 hv002 and hvidx as the ID?
Again thank you very much! ]]>JREY2015-08-31T08:44:41-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8230&th=4482#msg_8230
Yes, if you do the kind of reshaping I suggested earlier for both, then you can merge them back together. It would also be possible to reshape both types of variables within a single program. Either way would work. ]]>Bridgette-DHS2015-09-18T18:15:39-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8235&th=4482#msg_8235
JREY2015-09-19T04:29:40-00:00Re: Restructuring Healthcare data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=8570&th=4482#msg_8570
Bridgette-DHS2015-11-17T14:14:24-00:00