My colleague has passed to me a query to which I can't find a
straightforward answer. I am hoping some of the experts in this group
could help?
She has hourly barometric pressure data for many days. So the dataset
contains the variables
year month day hour pressure
(with 24 hourly observations per day). During any day the pressure may
rise and fall. She wishes to generate a new variable containing the
maximum fall (constant within year-month-day groups). That is, for a
fictitious series of pressure readings
90 100 90 80 70 80 65 70 90 80 70
the maximum fall is 100-70=30. This is not simply the maximum - minimum
(100-65), since the pressure rises for one interval in that period
(70->80).
She also makes the points:
- there may be more than one drop per day... i want the largest one
- if pressure has not dropped at all through out the day, the value
returned should be zero or negative
Any suggestions?
Many thanks, Chris.
[...]