Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: cmogram command for Regression Discontinuity Design

 From Nick Cox <[email protected]> To [email protected] Subject Re: st: cmogram command for Regression Discontinuity Design Date Mon, 5 Sep 2011 19:36:53 +0100

```We do ask that all new joiners read the FAQ before posting.

As implied, you can also fudge your 0s to small positives so that they
fall within the right bin (so to speak). Otherwise your graph won't
show a cutpoint at 0, which is important for your problem. But you'd
need to fudge all boundary values consistently.

Personally I like the convention that bins are as far as possible
[lower, upper) but -cmogram- follows the opposite rule.

The choice may seem arbitrary, but in most problems I look at it seems
more natural that 0 is not only a bin boundary but belongs with small
positives rather than small negatives. The substantive reason is often
that 0 may just mean not detected, but negatives mean something
different. But problems and tastes vary.

By the way, -cmogram- is just a convenience command. It is just a
couple of lines to set up bins that you like and summaries for those
bins, e.g.

sysuse auto
gen weight2 = 500 * floor(weight/500)
egen mean = mean(mpg), by(weight2)

after which you call up some graph of choice.

On Mon, Sep 5, 2011 at 7:09 PM, Borgomeo, Letizia
<[email protected]> wrote:
> I am sorry I should have read the Statalist FAQ more carefully, since I am an absolute beginner. The command I am talking about is indeed the one created by Christopher Robert and available from SCC.
> The -cutpoint()- option seems to automatically include in the last bin on the left the value specified in the brackets. Then, in order to get the 0 values to the right, I may also artificially set the option -cutpoint(-0.5)- since my forcing variable is discrete. Thanks for your suggestions
> Letizia
>
>
> ________________________________________
> Da: [email protected] [[email protected]] per conto di Nick Cox [[email protected]]
> Inviato: lunedě 5 settembre 2011 19.58
> A: [email protected]
> Oggetto: Re: st: cmogram command for Regression Discontinuity Design
>
> Naturally I agree with Maarten's general stance.
>
> I found that in -cmogram- you can't mix -start()- in -histopts()- and
> -cutpoint()-:
>
> ... histopts(start(-1500) width(500)) cutpoint(0)
>
> won't work.
>
> I also just remembered this beast
>
> SJ-6-1  gr26_1  . . . . . . . . . . . . . . . . . .  Software update for binsm
>        (help binsm if installed) . . . . . . . . . . . . . . . . .  N. J. Cox
>        Q1/06   SJ 6(1):151
>        rewritten to support modern Stata graphics
>
> STB-37  gr26  . . . . . . . . . . . Bin smoothing and summary on scatter plots
>        (help binsm if installed) . . . . . . . . . . . . . . . . .  N. J. Cox
>        5/97    pp.9--12; STB Reprints Vol 7, pp.59--63
>        alternative to graph, twoway bands(); produces a scatterplot
>        of yvar against xvar with one or more summaries of yvar for bins
>        of xvar
>
> Nick
>
> On Mon, Sep 5, 2011 at 4:32 PM, Maarten Buis <[email protected]> wrote:
>> On Mon, Sep 5, 2011 at 5:04 PM, Borgomeo, Letizia wrote:
>>> I am using the cmogram command for plotting the means-per-bin of an outcome variable against the assignment variable in a RDD. I am wondering if there is any way of setting the bins in order to have all the treated observations to the right and the untreated to the left of the cutoff. The forcing variable range is [-37;61] and I need the last bin in the LHS not to include the observations with a 0 value of the assignment variable, since they are exposed to treatment. Yet  both with histopts(width()) and histopts(bin()) I do not manage to do it.
>>
>> -cmogram- is an user written program, so per the Statalist FAQ, you
>> must say where you got it from. These are not rules to "trick" you,
>> rule is that there are typically multiple version of user written
>> programs floating around in cyberspace, so if you do not tell us which
>> exact version you are using, we are likely talking about different
>> programs, and the resulting advise may very well be useless to you.
>> You can find a link to the Statalist FAQ at the bottom of each post to
>> Statalist (including this one).
>>