楼主: zhangtao
16814 3

STATA为什么会提示以下错误 [推广有奖]

  • 3关注
  • 42粉丝

已卖:431份资源

学科带头人

41%

还不是VIP/贵宾

-

威望
0
论坛币
2302 个
通用积分
908.3324
学术水平
114 点
热心指数
120 点
信用等级
83 点
经验
52009 点
帖子
1552
精华
1
在线时间
2357 小时
注册时间
2005-1-13
最后登录
2024-5-21

楼主
zhangtao 发表于 2010-3-14 21:20:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
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;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Stata tata unrecognized outsourcing Electronics Stata 提示

沙发
gebitan 发表于 2010-3-14 21:56:42
好长啊,不知道也不懂,希望有人给楼主解答

藤椅
田甜 发表于 2010-3-14 22:53:07
同问,好复杂的问题。

板凳
蓝色 发表于 2010-3-15 07:52:39
你上面的#delimit; 命名不能在command 窗口中执行,所以后面全部出错。

你的写在do文件中,然后在do文件中运行
已有 1 人评分学术水平 热心指数 收起 理由
nlm0402 + 1 + 1 好的意见建议

总评分: 学术水平 + 1  热心指数 + 1   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-16 12:59