box plot of average diurnal variations
lcrilley
I am new to IGOR and my data is 5 min concentration of chemical species over a couple of weeks like so
1/09/2011 18:05 0.311107
1/09/2011 18:10 0.277637
1/09/2011 18:15 0.282964
1/09/2011 18:20 0.232187
I would like to do a box plot by the hour ie showing the mean, median etc for each hour of the day over the length of my data. I am aware of the decimation function which will average the data by the hour for me but the problem is where I have data missing, the function will give a blank cell for that hour even though there are other points during that hour period. Is there a way to get it calculate the average when there is missing data?
I would also appreciate any help with sorting the data by the time of day.
Any help would be greatly appreciated as I am struggling with this.
If you post an Igor experiment containing your data or an easily loaded text file, I will take a look at it.
Provide further details of what you want to do if there's anything more to say about it. For example, do you want the mean for each hour of each day or do you want the mean for each hour of all days.
Have you loaded the data into Igor as two columns (date/time and concentration) or as three (date, time, and concentration)?
I have posted a snippet that sorts by time of day. I have tested it only very briefly.
February 2, 2012 at 01:42 pm - Permalink
Thanks your reply. I have uploaded a csv file of a section of my data.
I have only two columns, date_time and concentration.
I am after the average for each hour across all the days, for example the mean concentration for 12-1pm across all the dates I collected the data. So I can see the average daily cycle of concentration using a box plot or something like that.
Thanks again
February 2, 2012 at 03:54 pm - Permalink
I have some experiences in generating diurnal variation using high time resolution data. I'm afraid you would have to write some procedure. But it's actually quite easy.
My way of doing this is:
(1) extract data with same hour-value into a new temp wave. You may use the "extract" operation and set logical expression as filter, e.g. hour-value = 1, 2, 3, ..., 23, 24; or concentration >= detection limit; etc. Even there's data lost, the final result would not be affected. (Of course we don't expect too many data lost, otherwise there's not lots of points to do any statistical analysis for this particular hour)
(2) do statistical analysis on this temp wave, to obtain avg/stdev, median/percentiles, etc.
(3) repeat (1)-(2) for each hour-value.
Hope it helps.
February 3, 2012 at 12:00 am - Permalink
The procedures first create an XY pair consisting of timeOfDay and concentration.
They then create hour-by-hour statistics.
Finally they create a table of the resulting statistics and a graph.
Download the attached experiment, open in Igor Pro 6.20 or later, and follow the instructions.
February 3, 2012 at 11:45 am - Permalink
Thanks again
February 6, 2012 at 08:32 pm - Permalink
This is just great! :) But I would like to ask you about possibility of writing similar function that, instead of diurnal averages, would produce simple hourly averages for the whole time series?
best regards
Jakub
November 13, 2013 at 07:51 am - Permalink