cap log close clear log using StataLog, replace include "http://staff.pubhealth.ku.dk/~linearpredictors/datafiles/readFever.do" /* Tab 7.4.4 */ gen newweight=weight if weight>0 gen ga=(gwbirth>31)+(gwbirth>32)+(gwbirth>33)+(gwbirth>34)+(gwbirth>35)+(gwbirth>36)+(gwbirth>37)+(gwbirth>38)+(gwbirth>39)+(gwbirth>40) gen parity2=(parity>0) if parity<. gen bw1=newweight if ga==1 summarize bw1, detail gen sga1=(newweight