I am hoping someone can point me in the right direction. I have two datasets that contain the same variable/observation structure. There are 2,362 variables in each dataset, each representing a groundwater well. Each well has 3,621 observations, the unique identifier of which is the date (dmy) the well was sampled. The dates are the same in each database. One of data categorizes the wells at each point in time depending on whether or not the groundwater level was above or below certain thresholds (call this category.dta). Values range from 0 to 3. The second contains how much water was pumped from each well over the date period (which are in 5-day increments, call this pumping.dta). I want to create a new dataset with the same structure with each value being based on values for the same variable/observation in category.dta and pumping.dta. So for example, if the category.dta value for the well on a specific DMY is 1 and pumping is equal to zero for the same well/DMY in the pumping.dta dataset, I want to assign that well/date combination a "1" in a new dataset or output file. if the category.dta value for the well on a specific DMY is 2 and pumping is greater than zero for the same well/DMY in the pumping.dta dataset, I want to assign that well/date combination a "3" in a new dataset or output file. There are a total of four such combinations.
I am struggling with how to structure this and where to get started - i have been reading about looping, etc. and have researched all day without much to show for it. I am hoping someone can point me in the right direction! Thank you.
I am struggling with how to structure this and where to get started - i have been reading about looping, etc. and have researched all day without much to show for it. I am hoping someone can point me in the right direction! Thank you.
Comment