clear; # delimit ; cap log close; *************************************************************; * Caschool.do * Prepare Final Data for Text book * California School District Data *************************************************************; log using ch4.log,replace; set more 1; ***********************************; *** Modify the next line so that the path is correct for your data; use caschool.dta; *; *; * Decription of Data; * dist_code -- district Code; * Read_scr -- avg Reading Score; * Math_scr -- avg Math Score; * County -- county; * District -- District; * gr_span -- grade span of district; * enrl_tot -- total enrollment; * teachers -- number of teachers; * computer -- number of computers; * testscr -- avg test score (= (read_scr+math_scr)/2 ); * comp_stu -- computers per student ( = computer/enrl_tot); * expn_stu -- expentitures per student; * str -- student teacher ration (teachers/enrl_tot); * el_pct -- percent of English Learners; * Meal_pct -- Percent qualifying for reduced-price lunch; * clw_pct -- Percent qualifying for CalWorks; * aving -- district average income (in $1000's); **************************************************************; ***** Table 4.1 ****** **************************************************************; summarize str str; pctile pct_tsc = testscr, nq(20) genp(pctx); pctile pct_str = str, nq(20); list pctx pct_str pct_tsc in 1/20; **************************************************************; ***** Correlation ****** **************************************************************; cor str testscr; **************************************************************; ***** Equation 4.11 ****** **************************************************************; reg testscr str, r; **************************************************************; ***** Equation 4.33 ****** **************************************************************; gen d = (str<20); reg testscr d, r; log close; clear; exit;