# [EpiData-list] How to: Create SPC graphs with same x period axis value for two consecutive periods

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Wed Nov 23 09:54:12 CST 2005

```Question to info at Epidata:

I have two successive periods: 1 and 2
I wish a graph where the first 6 observations in each period are included
and on the graph the x axis should say 1 2 3 4 5 6 in both of them

Using the Ichart.rec example included in installation of EpiData Analysis:

file: ichart.rec which has 27 observations
variables:
lege : counts for a given doctor (lege is doctor in Norwegian)
dag : consecutive number of observations (values are 1 - 27)

Assume that period 1 in the study was observation 1-14 and observation
15-27 was period 2.

Read the data en calculate as indicated after the "//" is comments
................................................................................................
define d ##
d = _n                  // _n is the same as recnumber the observation
number of the data
if d > 15 then d = d -15                  // now d is the correct number
withing each period
select if d < 7                                 // only include first 6
observations from each period
ichart dag lege                                 // this would show x
axis with values of variable dag
ichart dag lege /break=7 /xlabel=d   // this would make a break for the
two periods and use d as label
................................................................................................

Similarly for date variables:
................................................................................................
ichart tid lege /break="01/01/2003"   /xlabel=d     // if the value of
"tid" was "01/01/2003"   for observation 7
................................................................................................
The format of the break value should for dates be the same as the x axis
variable.
The graph above will show a gap btw. the two periods since the x-axis
variable has values from 1 to 27

If one has consecutive numbers e.g. 1-12 and you wish to have larger
separation of the two periods:
................................................................................................
define d1 ##
d1 = _n
if d1 > 6 then d1 = d1+2             // experiment a bit if you wish 1,
ichart d1 lege /break=7 /xlabel=d   // this would move the two parts of
the graph apart
................................................................................................
Regards
Jens Lauritsen
EpiData Association
ps. Unfortunately the /xlabel option is not in the current commands and
functions reference.
Will be added to next release.

```