{smcl} {* *!version 2.0 31/1/2024}{...} {cmd:help rctable} {hline} {title:Title} {phang} {bf:rctable} {hline 2} tables for Randomized Controlled Trials {title:Syntax} {p 8 17 3} {cmdab:rctable} {depvar} [if] {weight} {cmd:,} {it:options} {synoptset 20 tabbed}{...} {synopthdr} {synoptline} {syntab:Main} {synopt:{opth treat:ment(treatvar)}} specify the treatment variable to be used. Multiple branches are possible. In that case, a dummy variable for each treatment branch should be included i.e. each dummy should take value 1 if treatment and 0 otherwise. Do not include a dummy for the control group. Factor variables cannot be used. Hterogeneous analysis is possible if you include the interaction terms in the treatment options (as if they were additional treatment branches) {p_end} {synopt:{opth est:imator(esttype)}} either ITT or LATE (default is ITT) {p_end} {synopt:{opth treated(varname)}} for LATE estimate, specify the "treated" variable {p_end} {synopt:{ opth clust:er(varname)}} specify the clustering variable if any {p_end} {synopt:{ opt pval}} display pvalues in square parenthesis under the standard error {p_end} {synopt:{ opth control(varlist)}} specify the variables used for baseline covariate adjustment. These variables are used for every single outcome variables. You may use factor variable (fixed effects) but only if in numeric format. For control variables specific to each outcome see basecontrol option. {p_end} {synopt:{ opth basecontrol(varlist)}} specify a specific variable use for each outcome variable. The number of outcome variables should be equal to the number of basecontrol variables. {p_end} {synopt:{ opt keep }} instead of dropping the columns after running, the program keeps them in the dataset. {p_end} {synopt:{ opt sd }} display the standard deviations of the average and of the control group below in square parenthesis. {p_end} {synopt:{ opt quiet }} do not show the regression outcomes. {p_end} {synopt:{ opt sheet(string asis[, replace|modify])}} replace a worksheet in an already existing excel document. Sub-options replace or modify are necessary if the worksheet already exists (see export excel command) {p_end} {synopt:{ opt qval(name)}} display the qvalues in square parenthesis underneath the standard error. You cannot specifify pvalue and qvalue. The qvalues are computed using the qqvalue command and the fdr sharpened qvalue strategy by Anderson(2008). Varname specifies the multiple-test procedure method to be used for calculating the q-values from the input P-values. The method is one of bonferroni | sidak | holm | holland | hochberg | simes | yekutieli | bky. These method names specify that the q-values will be calculated from the input P-values by inverting the multiple-test procedure specified by the method() option of the same name for the multproc option of the smileplot package. bky method does not rely on qqvalue command but corresponds to the sharpened qvalue developped by Benjamini etal. (2006) and described in Anderson(2008). Command qqvalue is automatically installed from SSC when option qvalue is specified. {synoptline} {p2colreset}{...} {p 4 6 2} {cmd:if} is allowed.{p_end} {p 4 6 2} {cmd:fweight, aweight, pweight}s are allowed; see {help weight}. {p_end} {title:Description} {pstd} {cmd:rctable } creates regressions and tables (with the subcommand using) for experimental studies. rctable is particularly well adadpted to Randomized Controlled Trial or any analysis comparing different (experimental) groups. rctable creates several variables: VAR (the variable name) LAB (its label) A (the average in both groups) C (the average in the control group), and COEF1 [COEF2...], which record the differences between a treatment branch and the control group. With the using option, rctable exports the table in an excel, csv or text format. The variables created are then dropped, unless the keep option is specify. rctable can also be used without using. The command accepts multiple treatment branches and can also be used to create tables with interaction terms. For multiple treatment branches, include one dummy per treatment branch but do not include a control dummy. {pstd} The csv, excel or text document created with the using subcommand can be used either directly or be linked to another master excel document. This way, the master document can be formatted and edited independantly while the excel documents generated by the command are updated. rctable table can also be used with listtex to create Latex tables. {pstd} {cmd:rctable } now accept a qvalue option to account for multi-hypothesis testing. The pvalue used for the multi-hypothesis testing originates from the varlist regressions. qvalue accepts many different methods (see qvalue option). {title:Examples} {phang} Perform a simple ITT regression on several dependant varibles : {break} {cmd:. rctable unemployment_rate health_score cognitive_score noncognitive_score, treat(treat_variable)} {phang} Save the results in a xlsx document : {break} {cmd:. rctable unemployment_rate health_score cognitive_score noncognitive_score using "myxlsx.xlsx" , treat(treat_variable) control(i.country)} {phang} Perform a simple LATE regression on several dependant varibles : {break} {cmd:. rctable unemployment_rate health_score cognitive_score noncognitive_score, treat(treat_variable) estimator(LATE) treated(treated_variable)} {phang} Edit a simple Latex table using listtex and the keep option : {break} {cmd:. rctable unemployment_rate health_score cognitive_score noncognitive_score, treat(treat_variable) estimator(ITT) treated(treated_variable) keep save(C:\mytable.txt) } #delimit ; listtex LAB N_ind N_clust A C COEF if COEF!="" | LAB!="" using "C:\mytable.txt", replace rstyle(tabular) head(" \begin{table}[htbp] \centering \begin{threeparttable}[b] \medskip \begin{tabularx}{10cm}{l c c c c c \toprule & N & Cluster & Average & C & {T-C} \\ \midrule") foot("\hline \end{tabularx} \fignote{} \end{threeparttable} \end{table}"); #delimit cr {title:References} {p 4 6 2} Benjamini, Yoav and Krieger, Abba M and Yekutieli, Daniel (2006), Adaptive linear step-up procedures that control the false discovery rate, Biometrika, vol.93, n 3, pages 491--507,{p_end} {p 4 6 2} Michael L. Anderson (2008), Multiple Inference and Gender Differences in the Effects of Early Intervention: A Reevaluation of the Abecedarian, Perry Preschool, and Early Training Projects}, Journal of the American Statistical Association, volume 103, number 484, pages 1481-1495. {p_end} {title:Author} Adrien Bouguen, Santa Clara University