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
Interaction terms to check if variables are interdependent?I have the potentially endogenous variables Loan size and the loan rate. Loan rate is my dependent v…
Compute returns based on lag variableHello, Can you please help me with the following issue: I want to form quantiles based on the credi…
generate new variable using egen with sum/countHello everyone, hope you all have a good day ahead. So i want to ask 1 question.. i have a data set…
How to assign different Treatment depending on the date of birthHello, I have two different datasets, in the first one i have a ID identifier for each person and th…
Calculating media of several variables with missing dataGood afternoon, I like would to calculate the media of several variables with missing data. Code: …
Subscribe to:
Post Comments (Atom)
0 Response to Creating multiple new variable columns from an existing
Post a Comment