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
Creating a binary varible from a date variableI would like to create a variable where there is only two variables (0=heating, 1=non-heating) I ha…
Reverse coefficients after regression on ihs transformed netwealthDear Stata Forum, I am doing regressions with dependent var netwealth transformed with the hyperbol…
Combine cases, but keep values from each.I'd like to combine cases, but in an unusual way -- by keeping values from each. For example, start …
Minutes off in datetime formattingHello, I am working on a load profile with 30-minute invervals of electricity demand that I wish to…
How to execute a Matlab script from StataHi all, I'd like to run a Matlab script from within my Stata Do-File. Haven't done this before, but…
Subscribe to:
Post Comments (Atom)
0 Response to Creating multiple new variable columns from an existing
Post a Comment