POLMETH Archives

Political Methodology Society

POLMETH@LISTSERV.WUSTL.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Moshe Haspel <[log in to unmask]>
Reply To:
Political Methodology Society <[log in to unmask]>
Date:
Sat, 6 May 2006 13:28:38 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (96 lines)
Jamie,

There's probably a better or (certainly more elegant) way to accomplish
this, but overlaying a "range plot with area shading" (rarea) should do as
a quick and dirty solution.

Let's say you had the following 10 data points and wanted to do a
scatterplot:

IV      DV
.1      .05
.3      .27
.35     .56
.5      .47
.5      .5
.67     .53
.7      .75
.45     .82
.9      .68
1       .9

1) create 2 addidional observations to anchor the minimum and maximum
values of your IV (we started with 10 data points, so we need 12 all day).

set obs 12

2) create 2 new variables to form the boundaries of your reference area.

gen ref45 = .45
gen ref55 = .55

3) set the new observations to hold the minimum and maximum values for
your IV (For this example, let's assume that the IV has a theoretical
range of 0 to 1).

replace IV = 0 in 11
replace IV = 1 in 12

4) graph! You'll want to customize this output (especially the legend)
further... but this should get you headed in the right direction.

twoway rarea ref45 ref55 IV, sort bcolor(gs14) || scatter DV IV

NB: STATA does its graphs in the order specified. So if you do scatter
before rarea, the shading will block out any points within the reference
area. The sort option makes certain that the reference box will cover the
entire area. The bcolor option makes the box in a light gray so that the
points will show up well.

=============================================
Moshe Haspel, Ph.D.
Assistant Professor, Department of Political Science
Spelman College
Giles 215
350 Spelman Lane SW, Box 207
Atlanta, GA  30314
404-270-5654 (phone)
404-270-5666 (fax)

Political Methodology Society <[log in to unmask]> wrote on
05/05/2006 05:26:17 PM:

> I'm creating a graph in STATA with a yaxis scaled 0 to 1. I want to put
a
> shaded region between y = .45 and y = .55.  Could someone suggest how to
do
> this?
>
> Thanks,
> Jamie Chandler
> CUNY Grad Center
>
> **********************************************************
>              Political Methodology E-Mail List
>         Editor: Karen Long Jusko <[log in to unmask]>
> **********************************************************
>         Send messages to [log in to unmask]
>   To join the list, cancel your subscription, or modify
>            your subscription settings visit:
>
>           http://polmeth.wustl.edu/polmeth.php
>
> **********************************************************

**********************************************************
             Political Methodology E-Mail List
        Editor: Karen Long Jusko <[log in to unmask]>
**********************************************************
        Send messages to [log in to unmask]
  To join the list, cancel your subscription, or modify
           your subscription settings visit:

          http://polmeth.wustl.edu/polmeth.php

********************************************************** 

ATOM RSS1 RSS2