STATA为什么会提示以下错误?
. drop _all
.
. set more 1
.
. macro drop _all
.
. #delimit ;
Unknown #command
.
.
.
.
.
. *THIS FILE SHOWS SUMMARY STATS ON PRODUCTION WORKER EARNINGS AND EMPLOYMENT FOR ALL M
> ANUFACTUING AND OUTSOURCING INDUSTRIES IN US AND MEXICO TO BE
.
. USED FOR FIGURE 1 IN BFH PAPER. THE DATA USED FROM THE EXERCISE ARE SEASONALLY ADJUST
> ED, LOGGED, HP FILTERED DATA ON MEXICAN AND US INDUSTRIES.
unrecognized command: USED
r(199);
.
. THE RESULTS ARE FOR THE BERGIN, FEENSTRA, HANSON AER PAPER;
unrecognized command: THE
r(199);
.
.
.
. use us-filtered.dta;
invalid ';'
r(198);
.
. label list indlbl;
value label indlbl not found
r(111);
.
. label list statelbl;
value label statelbl not found
r(111);
.
. keep if state==0;
state not found
r(111);
.
. *drop hpf_pdn;
.
. *ren hpf_emp hpf_pdn;
.
. keep m ind state pdn wgbill hpf_pdn hpf_wgbill;
no variables defined
r(111);
.
. label list indlbl;
value label indlbl not found
r(111);
.
. ren ind indus;
no variables defined
r(111);
.
. gen industry=0;
0; invalid name
r(198);
.
. replace industry=1 if indus==30 | indus==6;*SELECT INDUSTRIES TO BE INCLUDED IN SAMP
> LE;
no variables defined
r(111);
.
. replace industry=2 if indus==315 | indus==2;
no variables defined
r(111);
.
. replace industry=3 if indus==335 | indus==4;
no variables defined
r(111);
.
. replace industry=4 if indus==334 | indus==5;
no variables defined
r(111);
.
. replace industry=5 if indus==336 | indus==3;
no variables defined
r(111);
.
. drop if industry==0;
industry not found
r(111);
.
. gen year=yofd(dofm(m));
Unknown function ()
r(133);
.
. gen month=month(dofm(m));
Unknown function ()
r(133);
.
. drop m;
no variables defined
r(111);
.
. sort year month industry;
no variables defined
r(111);
.
. save x0, replace;
option ; not allowed
r(198);
.
.
.
. use mx-filtered.dta;
invalid ';'
r(198);
.
. label list indlbl;
value label indlbl not found
r(111);
.
. *drop hpf_obr;
.
. *ren hpf_emp hpf_obr;
.
. keep m ind obr sal hpf_obr hpf_sal;
no variables defined
r(111);
.
. label list indlbl;
value label indlbl not found
r(111);
.
. ren ind indus;
no variables defined
r(111);
.
. gen industry=0;
0; invalid name
r(198);
.
. replace industry=1 if indus==30 | indus==6;*SELECT INDUSTRIES TO BE INCLUDED IN SAMP
> LE;
no variables defined
r(111);
.
. replace industry=2 if indus==315 | indus==2;
no variables defined
r(111);
.
. replace industry=3 if indus==335 | indus==4;
no variables defined
r(111);
.
. replace industry=4 if indus==334 | indus==5;
no variables defined
r(111);
.
. replace industry=5 if indus==336 | indus==3;
no variables defined
r(111);
.
. drop if industry==0;
industry not found
r(111);
.
. gen year=yofd(dofm(m));
Unknown function ()
r(133);
.
. gen month=month(dofm(m));
Unknown function ()
r(133);
.
. drop m;
no variables defined
r(111);
.
. sort year month industry;
no variables defined
r(111);
.
. merge year month industry using x0; tab _merge; drop if _merge~=3; drop _merge;
no variables defined
r(111);
.
. save x1, replace;
option ; not allowed
r(198);
.
.
.
. gen time=year+((month-1)/12);
year not found
r(111);
.
. label var time "Date";
no variables defined
r(111);
.
. label var hpf_obr "Mexico Apparel"; label var hpf_pdn "US Apparel (NAICS 315)";
no variables defined
r(111);
.
. gr7 hpf_obr hpf_pdn time if year<2006 & indus==2, c(l[-]l) s(..) border ylab xlab(199
> 6,1998,2000,2002,2004,2006) saving(fig1a,replace);
no variables defined
r(111);
.
. label var hpf_obr "Mexico Transport Equip."; label var hpf_pdn "US Transport Equip.
> (NAICS 336)";
no variables defined
r(111);
.
. gr7 hpf_obr hpf_pdn time if year<2006 & indus==3, c(l[-]l) s(..) border ylab xlab(199
> 6,1998,2000,2002,2004,2006) saving(fig1b,replace);
no variables defined
r(111);
.
. label var hpf_obr "Mexico Electrical Mach."; label var hpf_pdn "US Electrical Mach.
> (NAICS 335)";
no variables defined
r(111);
.
. gr7 hpf_obr hpf_pdn time if year<2006 & indus==4, c(l[-]l) s(..) border ylab xlab(199
> 6,1998,2000,2002,2004,2006) saving(fig1c,replace);
no variables defined
r(111);
.
. label var hpf_obr "Mexico Electronic Materials"; label var hpf_pdn "US Electronics
> (NAICS 334)";
no variables defined
r(111);
.
. gr7 hpf_obr hpf_pdn time if year<2006 & indus==5, c(l[-]l) s(..) border ylab xlab(199
> 6,1998,2000,2002,2004,2006) saving(fig1d,replace);
no variables defined
r(111);
.
. gr7 using fig1a fig1d fig1c fig1b, saving(fig1,replace);
file fig1a.gph not found
r(601);
.
.
.
. for num 0 1 2 : erase xX.dta;
-> erase x0.dta;
invalid ';'
r(198);
源程序:
drop _all
set more 1
macro drop _all
#delimit ;
*THIS FILE SHOWS SUMMARY STATS ON PRODUCTION WORKER EARNINGS AND EMPLOYMENT FOR ALL MANUFACTUING AND OUTSOURCING INDUSTRIES IN US AND MEXICO TO BE
USED FOR FIGURE 1 IN BFH PAPER. THE DATA USED FROM THE EXERCISE ARE SEASONALLY ADJUSTED, LOGGED, HP FILTERED DATA ON MEXICAN AND US INDUSTRIES.
THE RESULTS ARE FOR THE BERGIN, FEENSTRA, HANSON AER PAPER;
use us-filtered.dta;
label list indlbl;
label list statelbl;
keep if state==0;
*drop hpf_pdn;
*ren hpf_emp hpf_pdn;
keep m ind state pdn wgbill hpf_pdn hpf_wgbill;
label list indlbl;
ren ind indus;
gen industry=0;
replace industry=1 if indus==30 | indus==6; *SELECT INDUSTRIES TO BE INCLUDED IN SAMPLE;
replace industry=2 if indus==315 | indus==2;
replace industry=3 if indus==335 | indus==4;
replace industry=4 if indus==334 | indus==5;
replace industry=5 if indus==336 | indus==3;
drop if industry==0;
gen year=yofd(dofm(m));
gen month=month(dofm(m));
drop m;
sort year month industry;
save x0, replace;
use mx-filtered.dta;
label list indlbl;
*drop hpf_obr;
*ren hpf_emp hpf_obr;
keep m ind obr sal hpf_obr hpf_sal;
label list indlbl;
ren ind indus;
gen industry=0;
replace industry=1 if indus==30 | indus==6; *SELECT INDUSTRIES TO BE INCLUDED IN SAMPLE;
replace industry=2 if indus==315 | indus==2;
replace industry=3 if indus==335 | indus==4;
replace industry=4 if indus==334 | indus==5;
replace industry=5 if indus==336 | indus==3;
drop if industry==0;
gen year=yofd(dofm(m));
gen month=month(dofm(m));
drop m;
sort year month industry;
merge year month industry using x0; tab _merge; drop if _merge~=3; drop _merge;
save x1, replace;
gen time=year+((month-1)/12);
label var time "Date";
label var hpf_obr "Mexico Apparel"; label var hpf_pdn "US Apparel (NAICS 315)";
gr7 hpf_obr hpf_pdn time if year<2006 & indus==2, c(l[-]l) s(..) border ylab xlab(1996,1998,2000,2002,2004,2006) saving(fig1a,replace);
label var hpf_obr "Mexico Transport Equip."; label var hpf_pdn "US Transport Equip. (NAICS 336)";
gr7 hpf_obr hpf_pdn time if year<2006 & indus==3, c(l[-]l) s(..) border ylab xlab(1996,1998,2000,2002,2004,2006) saving(fig1b,replace);
label var hpf_obr "Mexico Electrical Mach."; label var hpf_pdn "US Electrical Mach. (NAICS 335)";
gr7 hpf_obr hpf_pdn time if year<2006 & indus==4, c(l[-]l) s(..) border ylab xlab(1996,1998,2000,2002,2004,2006) saving(fig1c,replace);
label var hpf_obr "Mexico Electronic Materials"; label var hpf_pdn "US Electronics (NAICS 334)";
gr7 hpf_obr hpf_pdn time if year<2006 & indus==5, c(l[-]l) s(..) border ylab xlab(1996,1998,2000,2002,2004,2006) saving(fig1d,replace);
gr7 using fig1a fig1d fig1c fig1b, saving(fig1,replace);
for num 0 1 2 : erase xX.dta;