Click here to see the SAS code.
Click here to see the example.

---------------------------------------------------------------

Note that a variation of this example is included in the book SAS/Graph: Beyond the Basics,
and all the 'tricks' used to create it are described in great detail!

---------------------------------------------------------------

For more info about biorhythm charts in general, see the 
wikipedia biorhythm page.

As far as the SAS plot goes, this is a pretty simple plot.
The 'tricky' part is calculating the values to plot - and 
although I "think" my equations are working correctly, I 
haven't rigorously tested them, and I can't 100% guarantee
that they are correct...


First you calculate the number of days between when the person
was born, and the day you're plotting - this is pretty simple, 
just subtract the numeric value for the person's birthday from 
the numeric value of day in question.

Then calculate where along the 23, 28, and 33-day cycles you
are for based on the number of days you've been alive on that
date, using the sin() function.  Remember that the sas sin()
funciton operates on values in radians rather than degrees.
Personally I "think" in terms of degrees, so I use 360 degrees
in my calculations, and then convert to radians at the last
minute.

In my plot, I center it on "today" (for whatever day the code
is run), and show the 30 days prior, and 30 days after today.

I have also written a sas/intrnet version of this sample, which
allows users to enter their birthdate, and it calculates their
plot on-the-fly :)

Back to Samples Index