do nlsw_data_setup
tabout south race union sex using table1.html, ///
replace c(freq col) f(0c 1) ///
style(htm) font(bold) cwidth(70) ///
title(Table 1: A Simple Example) ///
fn(Source: nlsw88.dta) open
tabout south race union sex using table2.html, ///
replace c(col row) f(1) style(htm) ///
font(italic) twidth(650) ///
title(Table 2: Some refinements, ///
including the sample size) ///
fn(Source: nlsw88.dta) ///
npos(both) nlab(Sample size) open
tabout south race union sex using table3.html, ///
replace style(htm) font(italic) ///
c(col row) f(1) npos(both) nlab(Sample size) ///
layout(cb) h3(nil) twidth(600) ///
title(Table 3: Further refinements, ///
using column block layout) ///
fn(Source: nlsw88.dta) open
do cancer_data_setup
tabout stime died using table4.html, ///
replace c(freq col cum) style(htm) ///
font(italic) twidth(700) ///
f(0 1) clab(No. Col_% Cum_%) ///
title(Table 4: Example of a simple ///
cross tabulation) fn(Source: cancer.dta) ///
open
do nlsw_data_setup
tabout south race collgrad [iw=wt] ///
using table5.html, replace style(htm) ///
c(freq row col) f(0c 1 1) layout(rb) ///
h3(nil) font(bold) cwidth(80) ///
title(Table 5: Example of cross tabulation ///
using panels) fn(Source: nlsw88.dta) open
tabout south race collgrad [iw=wt] ///
using table6.html, replace style(htm) ///
c(freq row col) f(0c 1p 1p) layout(rb) ///
clab(_ _ _) h3(nil) font(bold) twidth(500) ///
title(Table 6: Same example with ///
refinements) fn(Source: nlsw88.dta) open
tabout south collgrad race ///
using table7.html, replace style(htm) ///
c(col) f(1) npos(row) font(bold) ///
clab(Col_%) cwidth(80) stats(chi2) ///
title(Table 7: Example of sample ///
counts and stats) fn(nlsw88.dta) open
tabout south collgrad race using table8.html, ///
replace style(htm) font(bold) ///
c(col) f(1) clab(Col_%) cwidth(80) ///
stats(chi2) stpos(col) stlab(Chi2) ///
plab(Signif) stars ///
npos(row) nlab(Sample size) ///
title(Table 8: Same example with ///
customisation) fn(nlsw88.dta) open
tabout industry occupation [iw=wt] ///
using table9.html, replace style(htm) ///
font(bold) oneway c(freq col cum) f(0c 1) ///
clab(Count Col_% Cum_%) ///
cwidth(80) npos(col) nlab(Sample) ///
title(Table 9: A oneway table) ///
fn(Source: nlsw88.dta) open
sysuse auto, clear
tabout rep78 foreign using table10.html, ///
replace style(htm) font(italic) ///
c(mean weight) f(0c) sum cwidth(100) ///
h1(Car type (mean weight in lbs.)) h3(nil) ///
title(Table 10: Simple twoway summary ///
table of means) fn(auto.dta) open
sysuse voter, clear
tabout inc candidat using table11.html, ///
replace style(htm) font(italic) ///
c(median pfrac) f(1) clab(%) sum cwidth(80) ///
title(Table 11: Simple twoway summary ///
table of medians) fn(voter.dta) open
sysuse auto, clear
tabout foreign rep78 using table12.html, ///
replace style(htm) font(bold) twidth(700) ///
sum npos(tufte) ///
c(mean mpg mean weight mean length ///
median price median headroom) ///
f(1c 1c 1c 2cm 1c) h2(Mean Median) h2c(3 2) ///
clab(MPG Weight_(lbs) Length_(in) ///
Price Headroom_(in)) ///
title(Table 12: Oneway summary table ///
illustrating multiple summary measures) ///
fn(Source: auto.dta) open ptotal(none)
do cancer_data_setup
tabout died drug using table13.html, ///
replace style(htm) font(italic) cwidth(90) ///
sum c(mean age iqr age median studytime ///
min studytime max studytime) f(1) ///
title(Table 13: Oneway summary table ///
with default headings) fn(Source: cancer.dta) ///
open
tabout died drug using table14.html, ///
replace style(htm) font(italic) cwidth(90) ///
sum c(mean age iqr age median studytime ///
min studytime max studytime) f(1) ///
h2c(2 3) ltrim(1) h2(Patient_age_(years) ///
Length_of_study_(months)) ///
clab(Mean IQR Median Minimum Maximum) ///
title(Table 14: Same oneway summary ///
table
with customised headings) ///
fn(Source: cancer.dta. Note that IQR ///
is interquartile range) open
use "http://www.stata-press.com/data/r14/nhanes2b", clear
svyset psuid [pweight=finalwgt], strata(stratid)
svy: tabulate race diabetes, row ci format(%7.3f)
svy: tabulate sex diabetes, row ci format(%7.3f)
la var race "Race"
la var sex "Sex"
la var diabetes "Diabetes"
la def ny 0 "No" 1 "Yes", modify
la val diabetes ny
tabout race sex diabetes using table16.html, ///
replace style(htm) font(italic) twidth(700) ///
c(row ci) svy stats(chi2) f(3) cisep(-) ///
npos(col) nlab(Sample size) h2c(2 2 1) ///
title(Table 16: Survey data example) ///
fn(Source: nhanes2b) open
tabout race sex diabetes using table17.html, ///
replace style(htm) font(italic) cwidth(80) ///
c(row lb ub) svy stats(chi2) f(3) dpc ///
npos(col) nlab(Sample size) h2c(3 3 1) ///
title(Table 17: Survey data example with lb ///
and ub options) fn(Source: nhanes2b. ///
Note: lb lower bound; ub upper bound.) open
tabout race sex diabetes using table18.html, ///
replace style(htm) font(italic) cwidth(80) ///
c(row se) svy stats(chi2) f(1 3) per ///
npos(col) nlab(Sample size) h2c(2 2 1) ///
title(Table 18: Survey data example with ///
standard errors) fn(Source: nhanes2b.) open
tabout race sex diabetes using table19.html, ///
replace style(htm) font(italic) cwidth(100) ///
c(row se) svy f(1 3) per seb ///
npos(col) nlab(Sample size) h2c(2 2 1) ///
stats(chi2) stpos(col) ppos(only) stars ///
title(Table 19: Survey data with stars for ///
significance) fn(Source: nhanes2b.) open
do nlsw_data_setup
svyset [pw=wt]
tabout occupation south race collgrad ///
using table20.html, replace style(htm) ///
font(italic) cwidth(80) c(mean wage se) ///
f(2 2) clab(Mean_wage SE) sum svy ///
npos(lab) h2c(2 2 2) ///
title(Table 20: Twoway summary table with ///
survey data) fn(Source: nslw88.dta) open
tabout occupation south collgrad ///
using table21.html, replace style(htm) ///
font(italic) cwidth(100) c(mean wage ci) ///
f(2 2) clab(_ (90%_CI)) sum svy ///
level(90) npos(lab) layout(row) ///
h3(