i have a dataset example below
id visit_number date value test
1 2 2020-10-01 16:00 140 sodium
79 34 2011-07-10 09:15 . xray
in these columns id is a patient unique identifier, visit_number is a visit unique identifier, data: date of visit ; test - has up to 65 different test names (coded as numbers) and value is the result of the test.
few qs:
1. i want to creat a unique identifier combining id and visit number, say A B to AB
2. how can i create new variable columns from test using the test label using a foreach loop since there are 65 different variables in that column. i have created numeric labels for each test
many thanks, hal
Related Posts with Creating multiple new variable columns from an existing
Question on an Issue with StataHello, The tab command gave wrong output ( I have been working on the data set for a long time and t…
Creating new observations by groupDear Statalist members, I am working with data about nutritional intake where participants describe…
Question on merging lat/long to a Census tractHello all, I have downloaded a large dataset from the City of Los Angeles which tracks the number a…
Multiple Stata Installations on the same Operating SystemI need to run many do files concurrently. Using parallel and batcher packages, I have experimented w…
Need Help Merging Two DatasetsDear all, I am using Stata 16, on mac. First I collapsed the first dataset I have by state_fire_yea…
Subscribe to:
Post Comments (Atom)
0 Response to Creating multiple new variable columns from an existing
Post a Comment