我应该如何使用stata的评论(///)命令来打破长代码行?
How should I use stata's comment (///) command to break long code lines?
我正在尝试 运行 以下包含注释分隔符 (///) 的 Stata 代码,以分隔长行。尽管仔细阅读了手册,但我还是收到一条错误消息。有人可以告诉我我做错了什么吗?
谢谢,
史蒂夫
* SCHEXPR 3: SCHOOL-LEAVER DESTINATIONS
. label variable schexpr3 "School-leaver destinations"
. label define school_leaver 1 "Do nothing" 2 "Get more training or education" ///
3 "Start work or look for a job" 4 "Start a family" 5 "Go overseas to study" ///
6 "Go overseas to work" 7 "Go back to my country of birth" 8 "I have no plans"
. label values schexpr3 school_leaver
* SCHEXPR 4: TIMES ABSENT FROM SCHOOL
. label variable schexpr4 "Times absent from school"
. label define absent 1 "Never" 2 "Hardly ever" 3 "About once a week" 4 "Most days" ///
5 "Every day"
. label values schexpr4 absent
您收到什么错误信息?
代码运行良好:
. label define school_leaver 1 "Do nothing" 2 "Get more training or education" ///
> 3 "Start work or look for a job" 4 "Start a family" 5 "Go overseas to study" ///
> 6 "Go overseas to work" 7 "Go back to my country of birth" 8 "I have no plans"
.
. label define absent 1 "Never" 2 "Hardly ever" 3 "About once a week" 4 "Most days" ///
> 5 "Every day"
.
. label list
absent:
1 Never
2 Hardly ever
3 About once a week
4 Most days
5 Every day
school_leaver:
1 Do nothing
2 Get more training or education
3 Start work or look for a job
4 Start a family
5 Go overseas to study
6 Go overseas to work
7 Go back to my country of birth
8 I have no plans
.
end of do-file
我正在尝试 运行 以下包含注释分隔符 (///) 的 Stata 代码,以分隔长行。尽管仔细阅读了手册,但我还是收到一条错误消息。有人可以告诉我我做错了什么吗?
谢谢,
史蒂夫
* SCHEXPR 3: SCHOOL-LEAVER DESTINATIONS
. label variable schexpr3 "School-leaver destinations"
. label define school_leaver 1 "Do nothing" 2 "Get more training or education" ///
3 "Start work or look for a job" 4 "Start a family" 5 "Go overseas to study" ///
6 "Go overseas to work" 7 "Go back to my country of birth" 8 "I have no plans"
. label values schexpr3 school_leaver
* SCHEXPR 4: TIMES ABSENT FROM SCHOOL
. label variable schexpr4 "Times absent from school"
. label define absent 1 "Never" 2 "Hardly ever" 3 "About once a week" 4 "Most days" ///
5 "Every day"
. label values schexpr4 absent
您收到什么错误信息?
代码运行良好:
. label define school_leaver 1 "Do nothing" 2 "Get more training or education" ///
> 3 "Start work or look for a job" 4 "Start a family" 5 "Go overseas to study" ///
> 6 "Go overseas to work" 7 "Go back to my country of birth" 8 "I have no plans"
.
. label define absent 1 "Never" 2 "Hardly ever" 3 "About once a week" 4 "Most days" ///
> 5 "Every day"
.
. label list
absent:
1 Never
2 Hardly ever
3 About once a week
4 Most days
5 Every day
school_leaver:
1 Do nothing
2 Get more training or education
3 Start work or look for a job
4 Start a family
5 Go overseas to study
6 Go overseas to work
7 Go back to my country of birth
8 I have no plans
.
end of do-file