BookmarkSubscribeRSS Feed
hellohere
Pyrite | Level 9

I have dataset with 4 time-series information (pic is below), _B, _S, _P and _M. 

 

SGPlot155.png

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, 

 

11 REPLIES 11
hellohere
Pyrite | Level 9
Aroun tickindex=4500, red/_P is "ahead" of black/_M. The peak comes first.
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
hellohere
Pyrite | Level 9
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).
ballardw
Super User

@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.

 

PaigeMiller
Diamond | Level 26

@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

--
Paige Miller
hellohere
Pyrite | Level 9
Or just take as Interest Rate and Inflation, and need find which lead the others. Clear?
ballardw
Super User

@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
Pyrite | Level 9
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.
mkeintz
PROC Star

@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.

  1. How many peaks are in your graph?
  2. Do each of the 4 time series have the same number of peaks?
    1. And if they don't have the same number of peaks, which ones are considered extra?
--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
ballardw
Super User

@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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Multiple Linear Regression in SAS

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.

Discussion stats
  • 11 replies
  • 1425 views
  • 2 likes
  • 4 in conversation