{smcl} {* 21July2017}{...} {hi:help corr2docx} {hline} {title:Title} {phang} {bf:corr2docx} {hline 2} Report Pearson&Spearman coefficient of correlation to formatted table in DOCX file. {marker syntax}{...} {title:Syntax} {p 8 17 2} {cmdab:corr2docx} {it:varlist} [{it:if}] [{it:in}] [{it:weight}] {it:using filename} {cmd:,} [{it:options}] where varlist is a list of non-string variables, or _all. The * and ? wildcards are allowed in varlist. {marker description}{...} {title:Description} {pstd} {cmd:corr2docx} can report coefficient of correlation which can be reported in detail model. Users can also append the output from {cmd:corr2docx} to other docx documents, which is more likely to be generated by {cmd:putdocx}, {cmd:reg2docx}, {cmd:sum2docx} and {cmd:t2docx}, either using the {it:append} option or the command can be as following: {p_end} {phang} {stata `"putdocx append d:/mytable0.docx d:/mytable1.docx d:/mytable2.docx, saving(d:/mytable.docx,replace)"'} {p_end} {marker options}{...} {title:Options for corr2docx} {phang} {opt replace} permits to overwrite an existing file. {p_end} {phang} {cmd:append[(}{help putdocx_begin##apopts:{it:apopts}}{cmd:)]} permits to append the output to an existing file and change style definitions along with page break, header, and footer settings. {p_end} {phang} {cmd:margin(}{help putdocx_begin##type:{it:type}}{cmd:, #[}{help putdocx_begin##unit:{it:unit}}{cmd:])} set page margins for the document. {p_end} {phang} {opt fmt(fmt)} specify the display format of the coefficient of correlation. The defulat is %9.3f. {p_end} {phang} {opt title(string)} specify the title of the table. The default is title("Correlation Coefficient"). {p_end} {phang} {opt pagesize(psize)} sets the page size of the document. {it:psize} may be letter, legal, A3, A4, or B4JIS. The default is pagesize(A4). {p_end} {phang} {opt font(fontname[, size[, color]])} sets the font, font size, and font color for the document. Note that the font size and font color may be specified individually without specifying fontname. Use font("", size) to specify font size only. Use font("", "", color) to specify font color only. The default is font("Times New Roman"). {p_end} {phang} {opt landscape} changes the document orientation from portrait to landscape. {p_end} {phang} {cmd:note(}{it:string}[{cmd:,} {help putdocx_table##cellfmtopts:{it:cell_fmt_options}}]{cmd:)} adds notes under the table. {p_end} {phang} {opth layout:(putdocx_table##layouttype:layouttype)} adjust column width. {p_end} {phang} {opt star}{opt [}{opt (symbol level [...])}{opt ]} must specify the significance level of the coefficient of correlation from higher to lower.By defulat,it's *** p<0.01, ** p<0.05, * p<0.1 {p_end} {phang} {opt starsps} set the format of symbols to be superscript. {p_end} {phang} {opt varname} output variables' names in the first row and the first column of the table. {p_end} {phang} {opt varlabel} output variables' labels instead of names in the first row and the first column of the table. {p_end} {phang} {opt nodiagonal} do not add number 1 to the main diagonal of correlation matrix. {p_end} {phang} {opt pearson(string)} the followings can be specified in this option: {p_end} {pmore} {opt pw} display all pairwise correlation coefficients. {p_end} {pmore} {opt bonferroni} use Bonferroni-adjusted significance level. {p_end} {pmore} {opt sidak} use Sidak-adjusted significance level. {p_end} {pmore} {opt ignore} do not report pearson correlation coefficients. {p_end} {phang} {opt spearman(string)} the followings can be specified in this option: {p_end} {pmore} {opt pw} calculate all pairwise correlation coefficients by using all available data. {p_end} {pmore} {opt bonferroni} use Bonferroni-adjusted significance level. {p_end} {pmore} {opt sidak} use Sidak-adjusted significance level. {p_end} {pmore} {opt ignore} do not report spearman correlation coefficients. {p_end} {marker example}{...} {title:Example} {pstd} {phang} {stata `"sysuse auto, clear"'} {p_end} {pstd} Report Pearson&Spearman coefficient of correlation for variable mpg weight length rep78 and foreign {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, replace"'} {p_end} {phang} {stata `"corr2docx mpg weight length rep78 if foreign == 1 using d:/temp1.docx, replace note("foreign car")"'} {p_end} {pstd} Add significance of the coefficient of correlation {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, replace star"'} {p_end} {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, append star(* 0.05 ** 0.01)"'} {p_end} {pstd} Add the table title {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, replace star note(Noting about what you want to) title("this is the coefficient of correlation")"'} {p_end} {pstd} Do not add number 1 to the main diagonal of correlation matrix {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, replace star nodiagonal"'} {p_end} {pstd} Display all pairwise correlation coefficients in pearson correlation coefficients and do not report spearman correlation coefficients {phang} {stata `"corr2docx mpg weight length rep78 foreign using d:/temp1.docx, replace star pearson(pw) spearman(ignore)"'} {p_end} {title:Author} {pstd}Chuntao LI{p_end} {pstd}China Stata Club(爬虫俱乐部){p_end} {pstd}Wuhan, China{p_end} {pstd}chtl@zuel.edu.cn{p_end} {pstd}Zhengxuan ZHAO{p_end} {pstd}China Stata Club(爬虫俱乐部){p_end} {pstd}Wuhan, China{p_end} {pstd}Zhengxuan_ZHAO@foxmail.com{p_end} {pstd}Haitao SI{p_end} {pstd}China Stata Club(爬虫俱乐部){p_end} {pstd}Wuhan, China{p_end} {pstd}sht_finance@foxmail.com{p_end} {title:Updated by} {pstd}Yuan XUE{p_end} {pstd}China Stata Club(爬虫俱乐部){p_end} {pstd}Wuhan, China{p_end} {pstd}xueyuan19920310@163.com{p_end} {title:Also see} {synoptset 30 }{...} {synopt:{help reg2docx} (if installed)} {stata ssc install reg2docx} (to install){p_end} {synopt:{help t2docx} (if installed)} {stata ssc install t2docx} (to install){p_end} {synopt:{help sum2docx} (if installed)} {stata ssc install sum2docx} (to install){p_end} {p2colreset}{...}