Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: overlaid graphics

From   "John D. Levendis" <>
To   statalist <>
Subject   st: overlaid graphics
Date   Sun, 15 Feb 2004 23:40:37 -0600

Hello Statalisters,

I've got a question regarding how to overlay two time series.

Let say I've got a Price Series (Pr) and from it, I generate a Price Index (PI) 
that just divides Pr by it's base year value:
. gen PI = Pr/Pr[1]

Appropriately scaled these two series, when overlaid should match up perfectly.
What I would like to do is graph both these series, and if I look at the units 
on the left hand side of the graph, I get the Price values, and if I look at 
the units on the right hand side, I get the Index values.

I thought something like:
. twoway (connected Pr year) (connected PI year, yaxis(2))

But they don't line up exactly. How can I force them to?

This problem holds even in the simpler case where:
. gen Pr2 = Pr + 100
. twoway (connected Pr year) (connected Pr2 year, yaxis(2))

Many thanks.


John D. Levendis
W210 Pappajohn Bus. Bldg
University of Iowa
Iowa City, IA 52242
Can you imagine being from Oz
and moving to Kansas?!

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index