Hey Guys,
I would like to merge Stata files. The observations I would like to merge have not an id yet. My Intention is to allocate an id to each Observation which is composed of the year, the id of the house and the id of the Refrigerator.
I have the variables year, houseid, refrigeratorid and now I would like to create a variable id [year][houseid][refrigeratorid]
With the command generate I tried to do that but regrettably this does not work:
gen id = "year""houseid""refrigeratorid" but stata does not recognize that year is a variable and therefore gives the variable always the value "year".
Moreover I wonder whether there is a command in that which creates new Folders. If I want stata to save a file or to access a path which does not exist yet, Stata aborts running through my dofile.
Could somebody please help me?
Thank you very much in advance.
Thomas
I would like to merge Stata files. The observations I would like to merge have not an id yet. My Intention is to allocate an id to each Observation which is composed of the year, the id of the house and the id of the Refrigerator.
I have the variables year, houseid, refrigeratorid and now I would like to create a variable id [year][houseid][refrigeratorid]
With the command generate I tried to do that but regrettably this does not work:
gen id = "year""houseid""refrigeratorid" but stata does not recognize that year is a variable and therefore gives the variable always the value "year".
Moreover I wonder whether there is a command in that which creates new Folders. If I want stata to save a file or to access a path which does not exist yet, Stata aborts running through my dofile.
Could somebody please help me?
Thank you very much in advance.
Thomas
Comment