Hello All,
I have a panel dataset with 28 years and several U.S. states. Currently, I am trying to create a new 'United States' observation which is the yearly average of other states. I am doing this by first collapsing my data and then appending it to my original dataset. However, I am getting a really weird issue where my collapse command is 'working' but nothing is happening. This is the command I am using:
collapse Cigarette_Cap , by(Year GeoName)
I have no clue what the issue here is ... anyone have any ideas?
EDIT: If I can add, my data collapses when I do by(GeoName) or by(Year) but not when I do both. Is there an issue with how I am defining my varlist?
Thanks,
Mitchell
Related Posts with Problem Collapsing Data
Can Inverse probability of censoring weighting (IPCW) approach be applied in stata?Hi all, I wonder if anyone is familar with IPCW model and has revelant example with stata codes to …
Help to interpret psmatch2 messages and resultsHi, I want to run a regression to compáre yield at issuance of green and non-green bonds. In order t…
Changing a string variable with various characters into a numerical (categorical) variableHi! I am fairly new to Stata and looking to organize one of my variables within a dataset. it is a l…
Fixed effects in a mlogitHello StataCorp, I want to control for country fixed effects in a mlogit I have tried the followin…
Identify where in variable list a certain value appearsSorry for the basic question. I have a dataset with 100-variable list from v1-v100 with >10k obs…
Subscribe to:
Post Comments (Atom)
0 Response to Problem Collapsing Data
Post a Comment