I'm a beginner with Stata, so was hoping for some help.
I have two variables: age and qualification
The qualification variable looks like this:
Value 1 CSE or equivalent/GCSE (grades D-G)
Value 2 O level or equivalent/GCSE (Grades A-C)
Value 3 A level or equivalent
Value 4 Degree or equivalent
Value 5 Postgraduate degree or equivalent
Value 6 None of these
I want to construct a years of schooling variable as follows:
If the individual is over 40 AND has value 6, then in the new variable, years of schooling = 10
If the individual is under and including 40 AND has value 6, then in the new variable, years of schooling = 11
For the others, age is not important, so if the value of the qualification variable is 3, for example, the years of schooling value should be 13. If it's 4, years of schooling should be 16 etc
How would I go about writing a command to do this?