Hey guys --
I'm having an odd issue where sometimes (not always) the same piece of code containing a "collapse" function executes without errors, but then the un-collapsed dataset is still loaded into Stata. And as I said sometimes it won't happen, or sometimes if I copy paste the statement and run it a second time immediately after it will work. This seems like a hard thing to explain properly and I may sound confusing, so let me give you the example:
I have a monthly data set of ID numbers and dollar amounts across 6 months (so 6 observations for each ID number, one for each month) -- here is a small sample of dummy data with the same structure & fields:
Trying to get the resulting dataset:
I want to use the following code for this:
collapse (mean) mean_balance = Balance , by(ID)
However when I run this portion of code from the do file editor, it will show that it ran properly without any errors in the results window, but when I browse the dataset it is exactly as before (still containing the monthly values) as if literally nothing was ran. Also -- if I include a 'save' statement right after the collapse [save "D:\Average_Bals.dta" , replace], and then I open that saved dataset after running the code, the saved dataset is collapsed properly, even though it looked to be uncollapsed in the data browser after running the collapse.
I know that it is important to do my own research on the issue and show what I've tried thus far to remedy the problem, but I could not find anything regarding this type of issue after a couple hours of browsing through the stata manual & Google, and outside of closing Stata, deleting temp files, and rebooting my computer, I am at a complete loss as to what else to try.
Also my specs for my computer & Stata are as follows:
Stata Version:
Stata 13.1 MP - 4 Core License
(I don't think the problem is OS specific, but just including all information just in case):
Computer Stata is being run from:
OS: Windows Server 2012 R2 Standard; 64 Bit
Processor: Intel(R) Xeon(R) CPU E5-2650 @ 2.0 GHz; x64-based
RAM: 324 GB
I'm having an odd issue where sometimes (not always) the same piece of code containing a "collapse" function executes without errors, but then the un-collapsed dataset is still loaded into Stata. And as I said sometimes it won't happen, or sometimes if I copy paste the statement and run it a second time immediately after it will work. This seems like a hard thing to explain properly and I may sound confusing, so let me give you the example:
I have a monthly data set of ID numbers and dollar amounts across 6 months (so 6 observations for each ID number, one for each month) -- here is a small sample of dummy data with the same structure & fields:
Month | ID | Balance |
Sep-14 | 1 | 100 |
Oct-14 | 1 | 90 |
Nov-14 | 1 | 95 |
Dec-14 | 1 | 100 |
Jan-15 | 1 | 80 |
Feb-15 | 1 | 95 |
Sep-14 | 2 | 25 |
Oct-14 | 2 | 18 |
Nov-14 | 2 | 29 |
Dec-14 | 2 | 30 |
Jan-15 | 2 | 30 |
Feb-15 | 2 | 31 |
Sep-14 | 3 | 5 |
Oct-14 | 3 | 7 |
Nov-14 | 3 | 3 |
Dec-14 | 3 | 4 |
Jan-15 | 3 | 9 |
Feb-15 | 3 | 3 |
ID | mean_balance |
1 | 93.33 |
2 | 27.17 |
3 | 5.17 |
I want to use the following code for this:
collapse (mean) mean_balance = Balance , by(ID)
However when I run this portion of code from the do file editor, it will show that it ran properly without any errors in the results window, but when I browse the dataset it is exactly as before (still containing the monthly values) as if literally nothing was ran. Also -- if I include a 'save' statement right after the collapse [save "D:\Average_Bals.dta" , replace], and then I open that saved dataset after running the code, the saved dataset is collapsed properly, even though it looked to be uncollapsed in the data browser after running the collapse.
I know that it is important to do my own research on the issue and show what I've tried thus far to remedy the problem, but I could not find anything regarding this type of issue after a couple hours of browsing through the stata manual & Google, and outside of closing Stata, deleting temp files, and rebooting my computer, I am at a complete loss as to what else to try.
Also my specs for my computer & Stata are as follows:
Stata Version:
Stata 13.1 MP - 4 Core License
(I don't think the problem is OS specific, but just including all information just in case):
Computer Stata is being run from:
OS: Windows Server 2012 R2 Standard; 64 Bit
Processor: Intel(R) Xeon(R) CPU E5-2650 @ 2.0 GHz; x64-based
RAM: 324 GB
Comment