代码拉取完成,页面将自动刷新
同步操作将从 连享会/eda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
********************************************************************************
* Description of the Program - *
* EDA subroutine used to create pie charts *
* *
* Program Output - *
* Creates pie chart GPH and PDF as well as entries in the LaTeX document *
* *
* Lines - *
* 98 *
* *
********************************************************************************
*! edapie
*! v 0.0.1
*! 17jul2018
// Drop program from memory if already loaded
cap prog drop edapie
// Define program
prog def edapie
// Version used to interpret code
version 14
// Syntax structure for edabar subroutine
syntax varlist(min=1) [if] [in], root(string asis) ///
[PIECHartopts(string asis) ///
scheme(passthru) ///
keepgph MISSing byvars(varlist) byseq ]
// Mark only the observations to use
marksample touse, strok novarlist
// No byvars argument
if `"`byvars'"' == "" {
// Add subheading to the LaTeX file
file write doc "\subsubsection{Pie Charts}" _n
// Create bar graphs for the categorical variables
foreach v of var `varlist' {
// Get number of rows for the legend for this variable
loc leg legend(rows(`:char `v'[lrows]') symy(1.85) symx(1.85))
// Create pie chart
gr pie if `touse', over(`v') `piechartopts' ti(`:char `v'[title]') ///
note("Created on: `c(current_date)' at: `c(current_time)'") ///
`missing' `scheme'
// Export to .pdf file
qui: gr export `"`root'/graphs/pie`v'.pdf"', as(pdf) replace
// Check if user wants to keep the GPH files
if "`keepgph'" != "" {
// Define local macro with syntax to remove file
qui: gr save `"`root'/graphs/pie`v'.gph"', replace
} // End IF Block to remove .gph files
// Get LaTeX formatted variable name
texclean `"`v'"', r
// Store the variable name in vref
loc vref `r(clntex)'
// Get LaTeX formatted variable label
texclean `"`: var l `v''"'
// Store the variable label in vlab
loc vlab `r(clntex)'
// Add the graph to the LaTeX file
file write doc "\begin{figure}[h!]" _n
file write doc `"\caption{Pie Chart of `vlab' \label{fig:pie`vref'}}"' _n
file write doc `"\includegraphics[width=\textwidth]{pie`v'.pdf}"' _n
file write doc "\end{figure} \newpage\clearpage" _n
} // End loop over categorical variables
} // End IF Block for no byvars argument
// sequential by graphs
else if `"`byvars'"' != "" & "`byseq'" != "" {
} // End ELSEIF Block for sequential by graphs
// Lattice graphs
else if `"`byvars'"' != "" & "`byseq'" == "" {
} // End ELSE IF Block for Lattice style graphs
// End of subroutine definition
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。