I've been trying to get out of Excel and managing all my data transformations within Stata. But I can't figure out how to do a few things that I can't seem to find online: at least anything that worked for me.
For Zillow time-series datasets the default format is to include columns for each month ex. 1996m4, 1996m5, 1996m6 etc. So in Stata this of course is a variable for each corresponding column. Naturally I needed to transpose this so that I have a variable holding all time information. For both Xpose or reshape the commands don't come out correctly to show me Year on a new variable and a delta of 1 mo. b/w obs. I got stuck at stubnames and not knowing how to prefix only selected columns that denoted time, with X, so I could indicate which variables I needed reshaped. The closest I got was with xpose but it generated dozens of new varnames not correctly specifying Year; or not including the first observation as the variables name .etc. What's the best way of going about this transformation? How do you prefix or suffix a group of vars but not all of them to use reshape?
Zillow Zip Data ex:
Zip Code, Size Rank, County, City, State, 1996m4, 1996m5, 1996m6... etc
Thanks a million for any help.
For Zillow time-series datasets the default format is to include columns for each month ex. 1996m4, 1996m5, 1996m6 etc. So in Stata this of course is a variable for each corresponding column. Naturally I needed to transpose this so that I have a variable holding all time information. For both Xpose or reshape the commands don't come out correctly to show me Year on a new variable and a delta of 1 mo. b/w obs. I got stuck at stubnames and not knowing how to prefix only selected columns that denoted time, with X, so I could indicate which variables I needed reshaped. The closest I got was with xpose but it generated dozens of new varnames not correctly specifying Year; or not including the first observation as the variables name .etc. What's the best way of going about this transformation? How do you prefix or suffix a group of vars but not all of them to use reshape?
Zillow Zip Data ex:
Zip Code, Size Rank, County, City, State, 1996m4, 1996m5, 1996m6... etc
Thanks a million for any help.
Comment