To duplicate as many examples from SAS’s publication Proc Tabulate by Example, by Lauren E. Haworth, 1st Edition.
data = read.table("http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data",
sep=",",header=F,col.names=c("age", "type_employer", "fnlwgt", "education",
"education_num","marital", "occupation", "relationship", "race","sex",
"capital_gain", "capital_loss", "hr_per_week","country", "income"),
fill=FALSE,strip.white=T)
html5(summary_table(sex ~ age + income + education_num, data),
fragment=TRUE, inline="lancet.css", caption = "HTML5 Table Lancet Style", id="tbl4"
)
N | Female | Male | Test Statistic | |
10771 | 21790 | |||
age | 32561 | 253546 | 293848 | F1,32559 = 331.36,P = 0.0001 |
income : >50K | 32561 | 0 . 10910.9 117910771 | 0 . 30630.6 666221790 | χ2 1 = 1518.89,P = 0.0002 |
education_num | 32561 | 91012 | 91013 | F1,32559 = 1.29,P = 0.2571 |