BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jpprovost
Quartz | Level 8

Hi there,

 

I really don't know if I am at the right place to ask this, but I  have datas (obs) from the past 5 years (each month = new data).

 

I want to use PROC ARIMA (I don't know how to use it very well, but I read it could be the good tool to do what I want) to know if the last data produced from last month (e.g. October) is "valid" within a forecast of past values.

 

By example, I have the number of obs (nobs) stocked in a dataset DATA1. I have 62 observations and I want to know if the 63rd is valid within the predicted values. My table DATA1 is updated monthly by adding a new line with the latest datas. The trend is that the nobs should always increase, but for quality control I'd like to validate that the new data is correct and within the "margins" of the past datas. If I'm not clear, do not hesitate since English is not my native language.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Well, that's too bad, as I said your specific problem is what PROC SHEWHART does.

 

In the simplest case, you create limits based upon your 62 observations, and then see if observation 63 is within those limits. The limits are usually computed as (mean ± k*sigma), where k is some constant, perhaps k=3, and sigma is the standard deviation of the 62 observations. So that case can be computed and graphed without PROC SHEWHART. However more advanced cases would be more difficult to program.

--
Paige Miller

View solution in original post

9 REPLIES 9
PaigeMiller
Diamond | Level 26

I have the number of obs (nobs) stocked in a dataset DATA1. I have 62 observations and I want to know if the 63rd is valid within the predicted values.

 

Sounds like a problem perfect for PROC SHEWHART.

--
Paige Miller
jpprovost
Quartz | Level 8

@PaigeMiller wrote:

I have the number of obs (nobs) stocked in a dataset DATA1. I have 62 observations and I want to know if the 63rd is valid within the predicted values.

 

Sounds like a problem perfect for PROC SHEWHART.


 

Hi there,

 

It seems that I don't have this PROC.

 

ERROR: Procedure SHEWHART not found.

 

😞

PaigeMiller
Diamond | Level 26

Well, that's too bad, as I said your specific problem is what PROC SHEWHART does.

 

In the simplest case, you create limits based upon your 62 observations, and then see if observation 63 is within those limits. The limits are usually computed as (mean ± k*sigma), where k is some constant, perhaps k=3, and sigma is the standard deviation of the 62 observations. So that case can be computed and graphed without PROC SHEWHART. However more advanced cases would be more difficult to program.

--
Paige Miller
jpprovost
Quartz | Level 8
I'll try to do that.
Thanks Paige 🙂
jpprovost
Quartz | Level 8

@PaigeMiller wrote:

Well, that's too bad, as I said your specific problem is what PROC SHEWHART does.

 

In the simplest case, you create limits based upon your 62 observations, and then see if observation 63 is within those limits. The limits are usually computed as (mean ± k*sigma), where k is some constant, perhaps k=3, and sigma is the standard deviation of the 62 observations. So that case can be computed and graphed without PROC SHEWHART. However more advanced cases would be more difficult to program.


I just thought of something. How can I define those limits if my observations are increasing? By example, if I have the market_value as an observation, it will increase from the past 5 years, etc.

 

No?

ballardw
Super User

@jpprovost wrote:

@PaigeMiller wrote:

Well, that's too bad, as I said your specific problem is what PROC SHEWHART does.

 

In the simplest case, you create limits based upon your 62 observations, and then see if observation 63 is within those limits. The limits are usually computed as (mean ± k*sigma), where k is some constant, perhaps k=3, and sigma is the standard deviation of the 62 observations. So that case can be computed and graphed without PROC SHEWHART. However more advanced cases would be more difficult to program.


I just thought of something. How can I define those limits if my observations are increasing? By example, if I have the market_value as an observation, it will increase from the past 5 years, etc.

 

No?


One way might be to look at the rate of change. If the value you are concerned with averages a change of 10 per month then you have something to investigate. Such as the count for the current month is less than or equal to the count of the previous month +10 (or some fudge factor). Or if the increase would be better expressed as a percentage then: current count <= pervious month *(1 + percent change).

 

For example with something like this (simulating some data)

data example;
   count=100;
   do month= 1 to 60;
      m2m = 10 + rand('integer',1,4);
      count= count + m2m;
      output;
   end;
run;

proc means data=example;
   var m2m;
run;

You will likely get mean value somewhere between 12.3 and 12.7 for the mean change from month to month, the m2m variable. And a standard deviation about 1.2 so the mean plus or minus 2 standard deviations are likely to be "reasonable" bounds for the current month change from last month.

If you plot your month to month change and see a notable pattern then you might want to consider an adjustment, possibly based on a regression of the curve.

PaigeMiller
Diamond | Level 26

@jpprovost wrote:


I just thought of something. How can I define those limits if my observations are increasing? By example, if I have the market_value as an observation, it will increase from the past 5 years, etc.

For anyone else reading along, PROC SHEWHART has tools to handle this. I understand that @jpprovost doesn't have the proper license to use PROC SHEWHART.

--
Paige Miller
jpprovost
Quartz | Level 8

You are right. Unfortunately, I don't have PROC SHEWHART. I'd love to have it to be honest!

Thanks @PaigeMiller !

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 1058 views
  • 2 likes
  • 3 in conversation