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

 

Background:

I have a PROC SHEWHART step that creates a control chart based on the sample number.

However, I want to override the sample number with the date rather than sample number.

 

I was going to do this by using a macro variable list and passing that into the AXIS Value option. However, I now see the AXIS Value option only replaces the major ticks and I have a macro variable for every single data point. Also, I don't know how SAS determines the number of major ticks and increments. 

 

Thank you in advance for your help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

How many tick marks do you want? After about 25, they become of limited value anyway.

 

If you have date or datetime variables and unevenly spaced data in time, and you want the date or datetime variables on the x-axis, the link I gave you in your other thread is probably the best solution

https://documentation.sas.com/?docsetId=qcug&docsetTarget=qcug_shewhart_sect473.htm&docsetVersion=15...

 

There is no way to put tick marks at exactly the date or datetime values you want in the case of unevenly spaced data.

--
Paige Miller

View solution in original post

7 REPLIES 7
Reeza
Super User
Can you use a format to replace the sample number with the date instead?
PaigeMiller
Diamond | Level 26

How many tick marks do you want? After about 25, they become of limited value anyway.

 

If you have date or datetime variables and unevenly spaced data in time, and you want the date or datetime variables on the x-axis, the link I gave you in your other thread is probably the best solution

https://documentation.sas.com/?docsetId=qcug&docsetTarget=qcug_shewhart_sect473.htm&docsetVersion=15...

 

There is no way to put tick marks at exactly the date or datetime values you want in the case of unevenly spaced data.

--
Paige Miller
narnia649
Obsidian | Level 7
Gotcha, thanks for the suggestion! I did take a look and wasn't a huge fan of the aesthetics of the block option. I am checking to see every option available.
PaigeMiller
Diamond | Level 26

@narnia649 wrote:
Gotcha, thanks for the suggestion! I did take a look and wasn't a huge fan of the aesthetics of the block option. I am checking to see every option available.

Speaking as a long-time user of PROC SHEWHART, I am not aware of any better way to handle date or date-time data that is unevenly spaced on the x-axis. That doesn't mean that there is not a different method that you like better. Nevertheless, I would be interested in knowing what you decide on, and I would be interested in knowing if you find anything you like better.

--
Paige Miller
RichardDeVen
Barite | Level 11
Did you look into using the BLOCKVAR= option ?
narnia649
Obsidian | Level 7
Yes, I did take a look. The visual aesthetics aren't quite as nice using the block option. Thanks for the suggestion!
Quentin
Super User

Generally with Shewhart if I want control over the graph format, I find it's either to use Shewhart to calculate the control limits and other statistics and write all the data out to a dataset.  Then I can use all the power of SGPLOT/GTL to generate a plot.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

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
  • 7 replies
  • 1060 views
  • 1 like
  • 5 in conversation