The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 yearly averages
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

felixs

USA
5 Posts

Posted - 11/19/2022 :  10:32:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022 (64-bit)
9.9.0.220 (Academic)
Win10 64

I have a time-series spreadsheet with daily data (some entries are missing) covering 8 years. The x-axis is date and the y-axis a measurement going from 0-1000. I would like to plot the data on a yearly basis, ie x-axis goes from January-December. And I would love to get yearly averages. Is there an elegant solution to do this?

thanks a ton!
Felix

snowli

USA
1417 Posts

Posted - 11/20/2022 :  2:35:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can highlight Y data, choose Analysis: Data Manipulation:
Reduce by Group.
Set Subgroup method as By X Increment, e.g. 1 year
and Set X Start.

Then plot the result.

Thanks, Snow
Go to Top of Page

felixs

USA
5 Posts

Posted - 11/20/2022 :  3:29:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

You can highlight Y data, choose Analysis: Data Manipulation:
Reduce by Group.
Set Subgroup method as By X Increment, e.g. 1 year
and Set X Start.

Then plot the result.

Thanks, Snow



Dear Snow,
thanks for this pointer! It is almost what I want. Unfortunately, some of my data are missing, which trips up the unevenly spaced data warning, probably because it does not know how to deal with the average. I am fine with some months/years having fewer data entries than others, do a conditional average would do just fine (add to sum if a number and divide by # of existing datapoints).
So to reformulate as a slightly downsized question, can I plot multiyear data where the x-axis is days/months only and does not take into account the year?
Felix

Edited by - felixs on 11/20/2022 4:41:14 PM
Go to Top of Page

snowli

USA
1417 Posts

Posted - 11/21/2022 :  11:34:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Felixs,

Do you mind sharing your data since i don't see the unevenly spaced data warning even if i delete some rows of XY or only delete some Y data.

Meanwhile here is another way u can try:
Extract year info. to a new column C.
Then use Analysis: Data Manipulation: Reduce Duplicate X menu with C as X and B as Y.



We use Julian date for date value so year info. will be considered when plotting graph. So it can't plot multi-year into 1 year's axis range.

Thanks, Snow
Go to Top of Page

snowli

USA
1417 Posts

Posted - 05/11/2023 :  2:07:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Felix,
We are thinking of improving this in future version (ORG-27067). Could you share the user story?

Thanks, Snow

quote:
Originally posted by felixs
So to reformulate as a slightly downsized question, can I plot multiyear data where the x-axis is days/months only and does not take into account the year?
Felix

Go to Top of Page

felixs

USA
5 Posts

Posted - 05/11/2023 :  2:24:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Snow,
happy to share, but not sure what you want me to share?
Felix

quote:
Originally posted by snowli

Hi Felix,
We are thinking of improving this in future version (ORG-27067). Could you share the user story?

Thanks, Snow

quote:
Originally posted by felixs
So to reformulate as a slightly downsized question, can I plot multiyear data where the x-axis is days/months only and does not take into account the year?
Felix



Go to Top of Page

snowli

USA
1417 Posts

Posted - 05/11/2023 :  2:38:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is regarding your question "can I plot multiyear data where the x-axis is days/months only and does not take into account the year"

I suppose you have XY data with x of multi-year date, u want to plot y as multiple plots from e.g. Jan 1st to Dec. 31st no matter which year it is?

Do u just want to plot them to visually compare same period of different years or u want to do some further analysis on them? If so, what analysis.

Thanks, Snow
Go to Top of Page

felixs

USA
5 Posts

Posted - 05/11/2023 :  9:52:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am measuring e.g. water use over time. Every day (almost) I am reading the meter and subtract the reading from the day before. This gives me how much water was used on a particular day. Date is x, daily water use is y. This gives me a good idea on what is going on over the years. There are obviously seasonal fluctuations and maybe long-term trends. To see whether water use over the years changes and if so during which season, it would be cool to show the data as Jan-Dec on the x-axis, on Dec31 2022 at the end of the x-axis, it simply wraps around to Jan01, 2023 at the start of the x-axis. The very same x-axis location where the Jan01 2022 data started.
Note that since not all measurements were made or recorded, I cannot simply use 365 measurements/year. Also, I might want to start with July1 if I am looking at consumer data and the fiscal year starts on July1.
Does this make sense?
You gave me some work-arounds which worked but were not ultimately just very cumbersome.
Felix

quote:
Originally posted by snowli

This is regarding your question "can I plot multiyear data where the x-axis is days/months only and does not take into account the year"

I suppose you have XY data with x of multi-year date, u want to plot y as multiple plots from e.g. Jan 1st to Dec. 31st no matter which year it is?

Do u just want to plot them to visually compare same period of different years or u want to do some further analysis on them? If so, what analysis.

Thanks, Snow

Go to Top of Page

snowli

USA
1417 Posts

Posted - 05/12/2023 :  09:17:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Exactly. it's doable in Origin but cumbersome as you said.

We are trying to improve in how to plot graph in same period, e.g. can be daily, monthly, yearly, etc. but not limited to date/time x. can be for other kinds of x with repeated patterns. Not sure what's a good name for such graph.

Thanks, Snow




Go to Top of Page

snowli

USA
1417 Posts

Posted - 05/12/2023 :  10:40:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Felix,
Do you mind sharing a data file?

Thanks, Snow
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000