proc summary

Reply
Occasional Contributor
Posts: 5

proc summary

Dear SAS Community,

 

I'm looking for advice on the simplest way to summarize a dataset. I have data from a number of temperature loggers which recorded the temperature at 10-minute intervals throughout the day. I want to find the mean nightly temperature for each night at each site. My dataset has three variables: var1=site ID, var2=date and time of temperature reading, var3=temperature. It seems like this would be pretty straight forward using a where statement in proc summary. The problem is sunrise and sunset changed almost every night. Does anyone have suggestions?  

Trusted Advisor
Posts: 1,784

Re: proc summary

Before you use PROC SUMMARY, in the actual dataset, assign a value of "DAY" or "NIGHT" (or whatever words you choose) to each observation, based on the time of the observation and the sunrise and sunset for that day.

 

Then use PROC SUMMARY on only those observations where the variable has the value "NIGHT".

Super User
Posts: 11,114

Re: proc summary

Is "night" defined as the same time of day every day or does it change by season, i.e. daylight vs non-daylight hours?

Ask a Question
Discussion stats
  • 2 replies
  • 206 views
  • 0 likes
  • 3 in conversation