<commit_before>{smcl}
{* 15 Dec 2017}{...}
{hline}
help for {hi:iegraph}
{hline}

{title:Title}

{phang2}{cmdab:iegraph} {hline 2} Generates graphs based on regressions with treatment dummies common in impact evaluations. 

{title:Syntax}

{phang2}
{cmdab:iegraph} {varlist} 
, [ {cmdab:basicti:tle(}{it:string}{cmd:)} {cmdab:varl:abels}
{cmdab:save(}{it:string}{cmd:)} {cmdab:grey:scale} {cmdab:yzero}
{cmd:noconfbars} {cmdab:confbarsnone(}{it:varlist}{cmd:)} {cmdab:confintval(}{it:numlist}{cmd:)} 
{cmd:norestore} {cmdab:baropt:ions(}{it:string}{cmd:)} {cmdab:ignoredummytest} 
{it:{help scatter##twoway_options:twoway_scatter_options}}
]

{marker opts}{...}
{synoptset 22}{...}
{synopthdr:options}
{synoptline}
{synopt :{cmdab:basicti:tle(}{it:string}{cmd:)}} Manually sets the title of the graph.{p_end}
{synopt :{cmdab:varl:abels}} Uses variable labels for legends instead of variable names.{p_end}
{synopt :{cmdab:save(}{it:string}{cmd:)}} Sets the filename and the directory to which the graph will be set/exported.{p_end}
{synopt :{cmdab:grey:scale}} Uses greyscales for the bars instead of colors.{p_end}
{synopt :{cmdab:yzero}} Forces y-axis on the graph to start at 0.{p_end}
{synopt :{cmd:noconfbars}} Removes the confidence interval bars from graphs for all treatments.{p_end}
{synopt :{cmdab:confbarsnone(}{it:varlist}{cmd:)}} Removes confidence interval bars from only the {it:varlist} listed.{p_end}
{synopt :{cmdab:confintval(}{it:numlist}{cmd:)}} Sets the confidence interval for the confidence interval bars. Default is .95.{p_end}
{synopt :{cmd:norestore}} Allows you to debug your two way graph settings on the data set prepared by iegraph. To be used with {it:r(cmd)}.{p_end}
{synopt :{cmdab:ignoredummytest}} Ignores the tests that tests if the dummies fits one of the two models below.{p_end}
{synoptline}

{pstd}Any twoway graph scatter options that can be used with normal twoway graph scatter commands can 
	also be used. If any of these commands conflict with any of the built in options, 
	then the user specified settings have precedence. See example 2 for details.{p_end}

{marker desc}
{title:Description}

{pstd}{cmdab:iegraph} This command creates bar graphs on the basis of the coefficients 
	of treatment dummies in regression results. This command is developed for reading 
	stored results from two types of impact evaluation regression models, but there 
	are countless of other examples where the command also can be used. {cmd:iegraph} must 
	be used immediately after running the regression or as long as the regression result is 
	still stored in or restored to Stata's {help ereturn} results. 
	
{pstd}{bf:Model 1: OLS with Treatment Dummies}{break}The most typical impact evaluation regression is 
	to have the outcome variable as the dependent variable and one dummy for each 
	treatment arm where control is the omitted category. These regressions can also include 
	covariates, fixed effects etc., but as long as the treatment status is defined by 
	mutually exclusive dummy variables. See especially examples 1 and 2 below. This command 
	works with any number of treatment arms but works best from two arms (treatment 
	and control) to five treatment arms (4 different treatments and control). More 
	arms than that may result in a still correct but perhaps cluttered graph.
	
{pstd}{bf:Model 2: Difference-in-Differences}{break}Another typical regression model in impact 
	evaluations are difference-in-difference (Diff-in-Diff) models with two treatment arms (treatment 
	and control) and two time periods. If the Diff-in-Diff regression is specified as having the 
	outcome variable as the dependent variable and three dummy variables (time, treatment 
	and timeXtreatment) as the independent variables, then this command will produce a nice 
	graph. Controls, treatment effects etc. may be added to the regression model. See especially example 3.

{pstd}{bf:Graph Output}{break}The graph generated by this command is created using the following values. The 
	control bar is the mean of the outcome variable for the control group. It is not 
	the constant from the regression as those are not identical if, for example, fixed effects 
	and covariates were used. For each treatment group the bar is the sum of the value 
	of the control bar and the beta coefficient in the regression of the corresponding 
	treatment dummy. The confidence intervals are calculated from the variance in the 
	beta coefficients in the regression.{p_end}

{pstd}The graph also includes the N for each treatment arm in the regression and uses 
	that value as labels on the x-axis. Stars are added to this value if the corresponding 
	coefficient is statistically different from zero in the regression{p_end}	
	
{marker optslong}
{title:Options}

{phang}{cmdab:basicti:tle(}{it:string}{cmd:)} Manually sets the title of the graph. To 
	apply formatting like title size, position, etc., use Stata's built 
	in {help title_options:title() option} instead.{p_end}

{phang}{cmdab:varl:abels} Sets the legends to the variable labels for the 
	variables instead of the variable names.{p_end}

{phang}{cmdab:save(}{it:string}{cmd:)} Sets the filename and the directory to which
	the graph will be set. If the filename ends with no extension or '.gph', it will be 
	saved in the graph format. Extensions(png,pdf,tif,wmf,emf,ps,and eps) will be exported. 
	Wmf and Emf are only available for the Windows version of Stata. Png and Tif for all 
	versions of Stata except Console.{p_end}

{phang}{cmdab:grey:scale} Uses greyscales for the bars instead of colors. The color 
	of the control bar will be black and the treatment bar will run in equal shade 
	differences from light grey to dark grey.{p_end}
	
{phang}{cmdab:yzero} Manually sets the y-axis of the graph to start at zero 
	instead of the Stata default. In many cases, we expect that neither the default 
	settings nor this option will make the axes look perfect, but you may use Stata's built 
	in {help axis_option:axis options} that allow you to set the axes to perfectly fit 
	your data. The command will ignore the {cmdab:yzero} option in cases where the graph cannot
	be forced to zero i.e. where the values in the graph extend beyond zero, both positively
	or negatively. A warning will be displayed telling the user that the option has 
	been ignored. Despite the warning, the graph will be produced correctly.{p_end}
	
{phang}{cmd:noconfbars} Removes the confidence interval bars from graphs for all 
	treatments. The default value for the confidence interval bars is 95%. {p_end}
	
{phang}{cmdab:confbarsnone(}{it:varlist}{cmd:)} Removes confidence interval bars 
	from only the {it:varlist} listed. The remaining variables in the graphs which 
	have not been specified in {cmdab:confbarsnone} will still have the confidence
	interval bars. {p_end}

{phang}{cmdab:confintval(}{it:numlist}{cmd:)} Sets the confidence interval for 
	the confidence interval bars. Default is .95. Values between 0 and 1 are allowed.{p_end}	
	
{phang}{cmdab:norestore} Returns the data set that iegraph prepares to create
	the graph. This is helpful when de-bugging how one of Stata's many graph 
	options can be applied to an iegraph graph. This option is meant to be 
	used in combination with the {help return:returned result} in {it:r(cmd)}. {it:r(cmd)} 
	gives you the line of code iegraph prepares to create the graph and {cmdab:norestore} gives you 
	access to the data that code is meant to be used on. This approach will help
	you de-bug how to apply Stata's built in graph options to an iegraph graph.
	Note that this option deletes any unsaved changes made to your data.{p_end}

{phang}{cmd:ignoredummytest} Ignores the tests that test if the dummies fits one 
	of the two models this command is intended for. The two models are described 
	in detail above above. There might be models we have not thought of for which 
	this command is helpful as well. Use this option to lift the restrictions of 
	those two models. But be careful, this command has not been tested for other <commit_msg>iegraph - option descr missing in helpfile<commit_after>{smcl}
{* 15 Dec 2017}{...}
{hline}
help for {hi:iegraph}
{hline}

{title:Title}

{phang2}{cmdab:iegraph} {hline 2} Generates graphs based on regressions with treatment dummies common in impact evaluations. 

{title:Syntax}

{phang2}
{cmdab:iegraph} {varlist} 
, [ {cmdab:basicti:tle(}{it:string}{cmd:)} {cmdab:varl:abels}
{cmdab:save(}{it:string}{cmd:)} {cmdab:grey:scale} {cmdab:yzero}
{cmd:noconfbars} {cmdab:confbarsnone(}{it:varlist}{cmd:)} {cmdab:confintval(}{it:numlist}{cmd:)} 
{cmd:norestore} {cmdab:baropt:ions(}{it:string}{cmd:)} {cmdab:ignoredummytest} 
{it:{help scatter##twoway_options:twoway_scatter_options}}
]

{marker opts}{...}
{synoptset 22}{...}
{synopthdr:options}
{synoptline}
{synopt :{cmdab:basicti:tle(}{it:string}{cmd:)}} Manually sets the title of the graph.{p_end}
{synopt :{cmdab:varl:abels}} Uses variable labels for legends instead of variable names.{p_end}
{synopt :{cmdab:save(}{it:string}{cmd:)}} Sets the filename and the directory to which the graph will be set/exported.{p_end}
{synopt :{cmdab:grey:scale}} Uses greyscales for the bars instead of colors.{p_end}
{synopt :{cmdab:yzero}} Forces y-axis on the graph to start at 0.{p_end}
{synopt :{cmd:noconfbars}} Removes the confidence interval bars from graphs for all treatments.{p_end}
{synopt :{cmdab:confbarsnone(}{it:varlist}{cmd:)}} Removes confidence interval bars from only the {it:varlist} listed.{p_end}
{synopt :{cmdab:confintval(}{it:numlist}{cmd:)}} Sets the confidence interval for the confidence interval bars. Default is .95.{p_end}
{synopt :{cmd:norestore}} Allows you to debug your two way graph settings on the data set prepared by iegraph. To be used with {it:r(cmd)}.{p_end}
{synopt :{cmdab:baropt:ions(}{it:string}{cmd:)}} Allows you to add formatting to the bars.{p_end}
{synopt :{cmdab:ignoredummytest}} Ignores the tests that tests if the dummies fits one of the two models below.{p_end}
{synoptline}

{pstd}Any twoway graph scatter options that can be used with normal twoway graph scatter commands can 
	also be used. If any of these commands conflict with any of the built in options, 
	then the user specified settings have precedence. See example 2 for details.{p_end}

{marker desc}
{title:Description}

{pstd}{cmdab:iegraph} This command creates bar graphs on the basis of the coefficients 
	of treatment dummies in regression results. This command is developed for reading 
	stored results from two types of impact evaluation regression models, but there 
	are countless of other examples where the command also can be used. {cmd:iegraph} must 
	be used immediately after running the regression or as long as the regression result is 
	still stored in or restored to Stata's {help ereturn} results. 
	
{pstd}{bf:Model 1: OLS with Treatment Dummies}{break}The most typical impact evaluation regression is 
	to have the outcome variable as the dependent variable and one dummy for each 
	treatment arm where control is the omitted category. These regressions can also include 
	covariates, fixed effects etc., but as long as the treatment status is defined by 
	mutually exclusive dummy variables. See especially examples 1 and 2 below. This command 
	works with any number of treatment arms but works best from two arms (treatment 
	and control) to five treatment arms (4 different treatments and control). More 
	arms than that may result in a still correct but perhaps cluttered graph.
	
{pstd}{bf:Model 2: Difference-in-Differences}{break}Another typical regression model in impact 
	evaluations are difference-in-difference (Diff-in-Diff) models with two treatment arms (treatment 
	and control) and two time periods. If the Diff-in-Diff regression is specified as having the 
	outcome variable as the dependent variable and three dummy variables (time, treatment 
	and timeXtreatment) as the independent variables, then this command will produce a nice 
	graph. Controls, treatment effects etc. may be added to the regression model. See especially example 3.

{pstd}{bf:Graph Output}{break}The graph generated by this command is created using the following values. The 
	control bar is the mean of the outcome variable for the control group. It is not 
	the constant from the regression as those are not identical if, for example, fixed effects 
	and covariates were used. For each treatment group the bar is the sum of the value 
	of the control bar and the beta coefficient in the regression of the corresponding 
	treatment dummy. The confidence intervals are calculated from the variance in the 
	beta coefficients in the regression.{p_end}

{pstd}The graph also includes the N for each treatment arm in the regression and uses 
	that value as labels on the x-axis. Stars are added to this value if the corresponding 
	coefficient is statistically different from zero in the regression{p_end}	
	
{marker optslong}
{title:Options}

{phang}{cmdab:basicti:tle(}{it:string}{cmd:)} Manually sets the title of the graph. To 
	apply formatting like title size, position, etc., use Stata's built 
	in {help title_options:title() option} instead.{p_end}

{phang}{cmdab:varl:abels} Sets the legends to the variable labels for the 
	variables instead of the variable names.{p_end}

{phang}{cmdab:save(}{it:string}{cmd:)} Sets the filename and the directory to which
	the graph will be set. If the filename ends with no extension or '.gph', it will be 
	saved in the graph format. Extensions(png,pdf,tif,wmf,emf,ps,and eps) will be exported. 
	Wmf and Emf are only available for the Windows version of Stata. Png and Tif for all 
	versions of Stata except Console.{p_end}

{phang}{cmdab:grey:scale} Uses greyscales for the bars instead of colors. The color 
	of the control bar will be black and the treatment bar will run in equal shade 
	differences from light grey to dark grey.{p_end}
	
{phang}{cmdab:yzero} Manually sets the y-axis of the graph to start at zero 
	instead of the Stata default. In many cases, we expect that neither the default 
	settings nor this option will make the axes look perfect, but you may use Stata's built 
	in {help axis_option:axis options} that allow you to set the axes to perfectly fit 
	your data. The command will ignore the {cmdab:yzero} option in cases where the graph cannot
	be forced to zero i.e. where the values in the graph extend beyond zero, both positively
	or negatively. A warning will be displayed telling the user that the option has 
	been ignored. Despite the warning, the graph will be produced correctly.{p_end}
	
{phang}{cmd:noconfbars} Removes the confidence interval bars from graphs for all 
	treatments. The default value for the confidence interval bars is 95%. {p_end}
	
{phang}{cmdab:confbarsnone(}{it:varlist}{cmd:)} Removes confidence interval bars 
	from only the {it:varlist} listed. The remaining variables in the graphs which 
	have not been specified in {cmdab:confbarsnone} will still have the confidence
	interval bars. {p_end}

{phang}{cmdab:confintval(}{it:numlist}{cmd:)} Sets the confidence interval for 
	the confidence interval bars. Default is .95. Values between 0 and 1 are allowed.{p_end}
	
{phang}{cmdab:norestore} Returns the data set that iegraph prepares to create
	the graph. This is helpful when de-bugging how one of Stata's many graph 
	options can be applied to an iegraph graph. This option is meant to be 
	used in combination with the {help return:returned result} in {it:r(cmd)}. {it:r(cmd)} 
	gives you the line of code iegraph prepares to create the graph and {cmdab:norestore} gives you 
	access to the data that code is meant to be used on. This approach will help
	you de-bug how to apply Stata's built in graph options to an iegraph graph.
	Note that this option deletes any unsaved changes made to your data.{p_end}
	
{phang}{cmdab:baropt:ions(}{it:string}{cmd:)}} Allows you to add formatting 
	option that are applied to each bar and not the graph itself. Example of 
	such option are {help twoway_bar} options and {help axis_options} options.

{phang}{cmd:ignoredummytest} Ignores the tests that test if the dummies fits one 
	of the two models this command is intended for. The two models are described 
	in detail above above. There might be models we have not thought of for which 
	this command is helpful as well. Use this option to lift the restrictions of 
	those two models. But be careful, this command has not been tested for other 
{'fraction_non_alphanumeric': 0.07433907349017706, 'fraction_numerical': 0.00327431481930633, 'mean_word_length': 4.9498556998557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '789451', 'n_tokens_mistral': 4962, 'n_tokens_neox': 4654, 'n_words': 2265}