Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Average over a period of time

    Hi All,

    I have been using multiple real-time devices to collect air measurements., Now that I have the readings I would like to average them by the minute. I took six readings per minute. Is there any way, I can calculate the average in some sort of loop in order to have 60 readings per hour?

  • #2
    Code:
    collapse (mean) air_measurement_variable, by(minute_indexed_variable)
    Note that (mean) is not necessary to add, as it is the default of collapse. You should list all of the measurements you want to take the average of by minute next to air_measurement_variable in a varlist, as the others will be dropped. You can get more details with
    Code:
    help collapse

    Comment

    Working...
    X