0

I'm trying to run the following Stata code with comment delimiters (///) included to break up long lines. Despite following the manual, carefully, I receive an error message. Can someone please tell me what I'm doing wrong?

Thanks,

Steve

* 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
Steve Thomas
  • 11
  • 1
  • 3
  • you want to break the sentence to the next line? or comment the line out? – doe Sep 09 '15 at 08:39
  • have a look at this [Break command into several lines][1]: http://stackoverflow.com/questions/25299247/break-a-command-into-several-lines-in-do-file-in-stata – doe Sep 09 '15 at 08:42
  • 2
    You have pending feedback on at least two of your last three posts. Please see http://stackoverflow.com/help/someone-answers on what to do when someone answers. Even a comment is better than nothing. – Roberto Ferrer Sep 09 '15 at 16:08
  • A review of the "reputation" section of the author's profile suggests that participation in Stack Overflow is limited to asking for help. Despite repeated requests, no feedback has been given, no answer marked accepted, no questions from others answered, nothing done to enhance the author's reputation by rewarding those whose help was proffered. –  Sep 10 '15 at 02:25

1 Answers1

0

What error message do you receive?

The code works fine:

. 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
Roberto Ferrer
  • 11,024
  • 1
  • 21
  • 23
  • Thank you. I'm new to Stata and relatively new to this forum. I think my problem may have been cutting and pasting the code from my do file, while I was executing sections of it. Have you experienced this problem before? My humblest apologies for not responding as expected. – Steve Thomas Sep 11 '15 at 05:44