I am trying to use merge on two data sets, one which has a value for PID for approximately 1700 observations. The other data set has variables named PID which have values for 366 days of a year, but to merge them I need to create a variable for those with the name PID so I have something to merge to.
Trick is, how to create a new variable with the string name to match what is in the other dataset?
Or there may be easier ways to do this. Everything I see in merge requires I have a variable with which to merge or joinby.
Thank you.
dp
Array Array
Related Posts with How to create a string variable with the string value of the variable name?
Out-of-sample logit: applying estimated coefficients on a new series (w/o observing 0s/1s)Hello STATA community, This is both a methodological question and a programming question, for which…
using * in a for-loopHello, I can't figure out what does * mean in front of a for-loop. Here you can see an example: fo…
Identifying peaks and throughsDear all, By following the method of Bry and Boschan (1971), full reference placed below, I want to…
tabulate two variables to show the value of a third variable; save dataset as matrix; multiple plots using plotmatrixHi all, I have data: Code: * Example generated by -dataex-. To install: ssc install dataex clear…
Calculate pairwise differencesHi friends, I have data: Code: * Example generated by -dataex-. To install: ssc install dataex cl…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a string variable with the string value of the variable name?
Post a Comment