I have dataset with 4 time-series information (pic is below), _B, _S, _P and _M.
They are quite close, but visual tells one is ahead of the others at certain spots.
Now how to use standard metrics to tell which is ahead? How to sample code?! Thanks,
What do you mean by "ahead"?
Okay, and perhaps you could describe the problem in a lot more detail. Is the problem to figure out "ahead" only at 4500, or is it everywhere, or just some places on the X-axis. How do you define "peak"? Does the noise in the data make any difference? And please provide any other relevant details that I have not asked about?
@hellohere wrote:
Sir:
I am not at academic. Just need reasonable metrics to tell which come first(not necessary just 4500/peak, need all time range).
What I need is a couple of varies metrics and find the best (with validation later).
Your data has hundreds of "peaks". Almost every other value appears to be a "peak" of some sort. So the definition in terms of your problem of "peak" is important. As is a clear definition of "best".
With a variable name including stuff like "max_min_dif" perhaps you need to tell us what the max/min/dif is about. If you summarized data to get to this point then perhaps a discussion of what has gone before is useful.
@hellohere wrote:
Sir:
I am not at academic. Just need reasonable metrics to tell which come first(not necessary just 4500/peak, need all time range).
What I need is a couple of varies metrics and find the best (with validation later).
I'm going to agree with @ballardw , there's just too many unanswered questions for us to give any meaningful advice. And just because you are not an academic does not mean you are exempt from answering reasonable questions about what you want from the analysis.
Please, also go to your favorite internet search engine and type in:
how to detect peaks in time series
@hellohere wrote:
Or just take as Interest Rate and Inflation, and need find which lead the others. Clear?
Not really as we have no idea how your graph relates to "Interest Rate and Inflation". You have not described the data at all.
@hellohere wrote:
Say there is a time-series plot of monthly reading of Interest Rate and Inflation, one guy comes up to you and ask which is leading... what are you going to do? ! just curious.
I'd ask the guy what he means by "leading".
But let's operationalize my response, with reference to your graph.
@hellohere wrote:
Say there is a time-series plot of monthly reading of Interest Rate and Inflation, one guy comes up to you and ask which is leading... what are you going to do? ! just curious.
Ask what is meant by "leading" and what the values shown in the graph represent. Depending on those answers there might be other questions related to things like what are those values on the axis actually are, 45000 is not any date type value I am familiar with (and I've used a moderate number of them) or the y values and differences between what the colors indicate in real world terms. There is nothing in your graph I can see as "monthly". There is nothing in your graph labeling "Interest Rate" or "Inflation" or what the measures of the values represent.
Many industries and activities have a plethora of jargon. Expect to explain jargon to outsiders. If I showed you something that looked a bit like a map and asked you to describe something about the FEBA shown what would your response be? Unless you have a similar background to mine you are unlikely to recognize a military jargon term that dropped from favor over 30 years ago.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.