capture log close log using gcpaper01-desc-tab1, replace text // program: gcpaper01-desc-tab1.do // task: table 1 - descriptive statistics // project: Group comparisons in logit and probit // using predicted probabilities // author: jsl \ 2009-05-26 // #0 // program setup version 10 clear all set linesize 80 matrix drop _all set scheme s2manual local pgm "gcpaper01" local dte "2009-05-26" // #1 // load the tenure data use gc_tenure01, clear datasignature confirm keep if allisonsmr // use allison sample // #2 // compute descriptive statistics and create table local varlist "tenure year yearsq select articles presthi prestige" matrix table1 = J(8,6,.) matrix rownames table1 = `varlist' matrix colnames table1 = W_mean W_SD M_mean M_SD C_Mean C_SD mat list table1 local irow = 0 foreach var in `varlist' { local ++irow * women qui sum `var' if female local mn = r(mean) local sd = r(sd) local n = r(N) matrix table1[`irow',1] = `mn' matrix table1[`irow',2] = `sd' matrix table1[8,1] = `n' * women qui sum `var' if male local mn = r(mean) local sd = r(sd) local n = r(N) matrix table1[`irow',3] = `mn' matrix table1[`irow',4] = `sd' matrix table1[8,3] = `n' * all qui sum `var' local mn = r(mean) local sd = r(sd) local n = r(N) matrix table1[`irow',5] = `mn' matrix table1[`irow',6] = `sd' matrix table1[8,5] = `n' } // #3 // table 1 - descriptive statistics for male and female biochemists // using person-year observations. nmlab `varlist' matrix list table1, format(%9.3f) log close exit