*** *** Stata Code for creating the 4-level factors for alcohol consumption and for tobacco consumption. * * Create a four level tobacco group variable with ranges: * * tob4 * 1 = 0- 9 grams per day * 2 = 10-19 * 3 = 20-29 * 4 = 30+ * * We have a tobacco group variable, tobgp, defined in 9 categories as: * * tobgp * 0 = None * 1 = 1- 4 grams per day * 2 = 5- 9 * 3 = 10-14 * 4 = 15-19 * 5 = 20-29 * 6 = 30-39 * 7 = 40-49 * 8 = 50+ * * We create tob4 by copying tobgp and recoding its categories gen tob4 = tobgp recode tob4 (0/2 = 1) (3/4 = 2) (5 = 3) (6/8 = 4) * Alcohol consumption, alc, is given in grams per day. We create a * categorical variable for alcohol consumption with the categories: * * alc4 * 1 = 0- 39 grams per day * 2 = 40- 79 * 3 = 80-119 * 4 = 120+ * * We create alc4 by copying alc and recoding it as: gen alc4 = alc recode alc4 (0/39 = 1) (40/79 = 2) (80/119 = 3) (120/max = 4) * (end.of.file)