\begin{Schunk}
\begin{Sinput}
 pctable20 <- pctable(gunlaw ~ owngun, data = dat, rvlab = "Stance on Gun Registration", cvlab = "Does Respondent Own a Gun?")
\end{Sinput}
\begin{Soutput}
Count (column %)
                          Does Respondent Own a Gun?
Stance on Gun Registration YES        NO          REFUSED Sum 
                    FAVOR  464(70.7%) 1085(84.9%) 17(63%) 1566
                    OPPOSE 192(29.3%) 193(15.1%)  10(37%) 395 
                    Sum    656        1278        27      1961
\end{Soutput}
\begin{Sinput}
 require(tables)
 require(Hmisc)
 tabsum <- summary(pctable20, rowpct = FALSE, colpct = TRUE)
 tabsum <- apply(tabsum, 1:2, function(x) {gsub("%", "\\\\%", x) })
 tabsum.hmisc <- Hmisc::latex(tabsum, file = "tmpout/t-pctable20a.tex")
\end{Sinput}
\end{Schunk}
