************************************************************** * cfkids-derived.do * ************************************************************** * * * PURPOSE: analysis of FEV1 among CF kids * * * * AUTHOR: P. Heagerty * * * * DATE: 31 March 2005 * ************************************************************** use NewCFkids *** *** save kid-level data *** collapse (mean) f508 gender age0, by(id) save KidData, replace clear *** *** fit a line to each child's data *** use NewCFkids sort id **** can't estimate line if less than 2 observations by id: drop if _N < 2 statsby "reg fev1 ageL" _b, by(id) list in 1/10 ***** merge back with the KidData merge id using KidData ***** ***** summarize b_ageL and b_cons by covariates ***** sort gender by gender: summarize b_ageL ttest b_ageL, by(gender) graph box b_ageL, over(gender) sort f508 by f508: summarize b_ageL xi: reg b_ageL i.f508 graph box b_ageL, over(f508)