Hi all,
I have made a dataset containing variables like so: (sorry my dataex wont install properly!) cdeath=deathcode mdeath indicates death caused by tb - made this by using strpos if it includes 'tb' in description and correct code from cdeath.
Patid tdeath description deathdate __tbdeath(indicator)
1 ___A1 ____tb ______12/01/1996 __1
1 ___A3 ____non tb ___06/06/1995__ 0
1 ___A3 ____non tb____
2 ___A4
2___ A5
2 ___A6
I am trying to reduce the dataset to 1 row per person , and tb death should equal 1 if they have ANY malaria related death records and 0 if they had no malaria records.
Any help would be greatly appreciated!
Related Posts with Reducing dataset
Code that picks up sudden spikes in prices Code: * Example generated by -dataex-. To install: ssc install dataex clear input double op …
Multiple Regression analysis: Explanatory Variable as percentageIn STATA when I do a regression analysis and the y variable is expressed in a percentage, I normally…
Dropping individuals when missing observations and change in variableHi, I am running panel data analysis in Stata and work with Survey data from Germany. The period co…
Instrumental Variable HelpHi, I'm having trouble with a new instrumental variable. So I'm trying to find some causality, betw…
Creating a variable containing number of decimal points of another variable's valuesHi, I have a variable measuring speed. The values are double and vary in the number of decimal point…
Subscribe to:
Post Comments (Atom)
0 Response to Reducing dataset
Post a Comment