
That is why the omitted category is represented by its average value of Y. It might be rare that the A coefficient shifts that much that harvest or visits becomes negative, but it will shift away from its true value to the degree that non-technical readers might find the absolute values not credible and then not trust the rest of the analysis. A technical audience would know that the impact of the treatment can still be read from such a graph, but a non-technical audience would be confused. If we would use the A coefficient together with control variables and fixed effects we would risk ending up with values in the graph that might not make sense, for example negative harvest value or negative number of pre-natal visits. the average of Y for the omitted category is equal to the A coefficient, but that is only true in this very specific case. If there were no control variables, fixed effects etc. This is also the starting point of the other values. To make the graph more easily interpreted by a non-technical audience - but still correct and equally informative to a technical audience - the omitted category (the control group in the dummy OLS and control group in time = 0 in the diff-in-diff) is the average value of Y in that group and not the A coefficient. were used that the values used in the graph is exactly the same as the coefficients for the treatment dummy/dummies in the dummy OLS and the treatment and time dummies in the diff-in-diff. One important note is that it is only if no control variables, fixed effects etc.
#Regress command stata how to#
For technical instructions on how to implement the command in Stata see the help files by typing help iegrpah in Stata. These instructions are meant to help you understand how to use the command. Simply run the regression using the regress command in Stata, and immediately afterwards run iegraph. which is represented by the vector of X in the equation.

The specification may include control variables, fixed effects etc. Y = α + β 1 t m t 1 + β 2 t m t 2 + ⋯ + β n t m t n + β X + ε īoth the treatment dummy and the time dummy are included in the regression as well as the interaction term between them ( D, T and DT in the equation). The first regression model, let's call it dummy OLS for short, is a the specification where each treatment arm is represented by a dummy. This command is implemented and tested to work with two specific models common in impact evaluations, but it is possible that that there are more regression models for which this command works. I illustrate this function in example 7.This generates a graph from regression estimations. The Mata function panelsetup(Q,p) returns a matrix describing the group structure of the data when Q is sorted by the group variable in column p. I do here because I did not want to discuss the group variable or sorting the dataset until I discussed cluster-robust standard errors. In a real program, I would not need to recompute everything. I could have sorted the dataset in Mata, but I usually sort it in Stata, so that is what I illustrated. In example 6, I sort the dataset in Stata, put a copy of the observations on the modified rep78 into the column vector id, and recompute the OLS objects that I need. I use rep78, with the missing values replaced by 6, as the group variable in my example.

See Cameron and Trivedi (2005), Wooldridge (2010), and regress for derivations and discussions.Ĭomputing \(\Mb_c\) requires sorting the data by group. \(\newcommand_j\) is the \(n_j\times 1\) vector of residuals in group \(j\), and \(g\) is the number of groups.
