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?
LoopHello fellow Stata users, I have a question regarding the forvalues loop, this is the first time I …
Help creating a bar graph over multiple variablesGreetings, When creating a graph bar and dividing it over a variable, I cant figure out a way to add…
Meta proportionHi to everybody... after running the "metaprop" command if it is possible to write instead of "ES" "…
Trouble working with %tc datesHello, I have a variable "EndDate" whose format is double yet displays as if it was %tc. I need to …
Regression of a few selected observationsI have a set of data but would only require to use of a few observations from the entire dataset. I …
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