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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1017 views
  • 1 like
  • 5 in conversation