Sorry I will try to be more clear. I would like to compare temperature values after each day. high_1 is found by comparing 3 consecutive days (day 3,2,1). Because temp(day 2) > temp(day1) and temp(day2) > temp(day 3) this would be the first local high. A local high cannot be found at day 1 because there is not 3 days of temperatures to compare yet (I can compare temperatures after day 3). I want the high_1 data/value to have day and temperature information. low_1 is found by comparing 3 consecutive days (day 6,5,4). Because temp(day5) < temp(day4) and temp(day5) < temp(day6), day 5 would be considered a local low. I thought about having SAS graph the temperatures over time, then compare the change in temperature between 2 days (the slope of the change). When the slope transitions from positive to negative, that would be a local high (and local low when the slope transitions from negative to positive). Could SAS label each high (low) value (using the change in slope coefficient)? Another solution I was thinking about was having SAS drop values when the following is not true: If temp(yesterday) > temp(today) and temp(yesterday) > temp(2 days ago) or If temp(yesterday) < temp(today) and temp(yesterday) < temp(2 days ago) This would create a dataset with only local high and low values [along with information about which day was a high(low)] However, I was hoping there was a code to generate high_i (low_i) if my dataset had a decade worth of temperature data, rather than deleting values from the original data set to only include local high(low) values Thanks
... View more