Hello.
I have a long do-file. When I select all the commands in do-file and execute them, Stata skips some of the commands. But, does not give any error message or I cannot know if (and which) line of commands it has skipped. I only know that some of them were not executed when I want to do further analysis. But, there is no issue when I run the commands line by line.
For example
use "$data", clear
keep ParticipantID BaseT_* Received T3_Year_of_Received Year_of_Assessment
gen wave=1
save "BaseT.dta", replace
use "$data", clear
keep ParticipantID Sixmfu_* Sixmonths_* Sixmontht_* Year_of_Assessment sixmontht_* sixmonths_* Received T3_Year_of_Received OffWorkDM_6mths_Days_1
gen wave=2
save "6month.dta", replace
use "$data", clear
keep ParticipantID ___12montht_* Twelvemfu_*
gen wave=3
save "12month.dta", replace
append using "6month.dta"
append using "BaseT.dta"
append using "24month.dta"
replace wave=4 if wave==.
save "mindfourwaves_long.dta", replace
Then when I tab ‘wave’ I find
tab wave, m
This happens for other commands too.
Does anyone has any idea what the issue is?
Thanks a lot.
Ama
I have a long do-file. When I select all the commands in do-file and execute them, Stata skips some of the commands. But, does not give any error message or I cannot know if (and which) line of commands it has skipped. I only know that some of them were not executed when I want to do further analysis. But, there is no issue when I run the commands line by line.
For example
use "$data", clear
keep ParticipantID BaseT_* Received T3_Year_of_Received Year_of_Assessment
gen wave=1
save "BaseT.dta", replace
use "$data", clear
keep ParticipantID Sixmfu_* Sixmonths_* Sixmontht_* Year_of_Assessment sixmontht_* sixmonths_* Received T3_Year_of_Received OffWorkDM_6mths_Days_1
gen wave=2
save "6month.dta", replace
use "$data", clear
keep ParticipantID ___12montht_* Twelvemfu_*
gen wave=3
save "12month.dta", replace
append using "6month.dta"
append using "BaseT.dta"
append using "24month.dta"
replace wave=4 if wave==.
save "mindfourwaves_long.dta", replace
Then when I tab ‘wave’ I find
tab wave, m
wave | Freq. | Percent | Cum. |
1 | 1,340 | 26.5 | 26.5 |
2 | 1,340 | 26.5 | 53.01 |
3 | 1,340 | 26.5 | 79.51 |
. | 1,036 | 20.49 | 100 |
Total | 5,056 | 100 |
Does anyone has any idea what the issue is?
Thanks a lot.
Ama
Comment