Hello,
I am working with NHANES data and have been merging datasets together using a 1:1 merge with a unique identifier "seqn." Each survey respondent is assigned a different sequence number (seqn) which makes it easy to merge the different datasets. This was all going well, but one of the datasets I want to merge (on prescription drug data) with the others contains multiple entries for each "seqn" so that it is not a unique identifier. In other words, if a person were taking multiple prescription drugs there would be multiple data entries that correspond to the same sequence number. I am trying to figure out a way to reorganize the data so that there is a single sequence number that corresponds to each drug a person is taking. Please let me know how best I can do this. I am new to stata.
Related Posts with Modifying a dataset to facilitate merging
Change the unit size on Vertical AxisHi Stata Experts, I am using the code below to draw a quadratic graph. qui xtgee DV c.IV ##c.IV Co…
Browse command and "Data editor" screenIs there a way to prevent Stata from switching to the "Data Editor" screen when the output of the "b…
Code to run ttests and effect sizes on many variables at once?I have about 20 variables that I would like to conduct two sample t-tests (with unequal variances) a…
Loop over variables for each observationDear Listers, I have a dataset which looks like id es1 es2 es3 es4 es5 es6 es7 es8 es9 1 1 1 1 1 1…
Will Stata for Mac make the ARM transition?Apple is rumored to be announcing a future transition away from Intel-based processors to ARM proces…
Subscribe to:
Post Comments (Atom)
0 Response to Modifying a dataset to facilitate merging
Post a Comment