BookmarkSubscribeRSS Feed
khill
Calcite | Level 5
Hello,
I'm looking for anyone who has been successful with this HREF option. The documentation is a little light on examples. As a result I'm guesssing at the supported structure of the dataset table.

My Statement is;
PROC SHEWHART DATA = WORK.WeeklyData;
IRCHART (Value) * WeekEnding /
HREF=HREF_Data

;
BY Function;

My two data sets are set up as follows;
WeeklyData
Function| WeekEnding | Value
< multiple rows or data typically 20+ weeks of data per function >

HREF_Data
Function | _REF_
< one row of data per Function>

While this procedure executes I do not get a horizontal line representing the _REF_ value. I have tried to use the varibale name of _VAR_ unsuccessfully in the HREF_Data table with an error claiming the _VAR_ length exceeded 32 characters. Which of course it does not.

As I mentioned the supporting documentation is a little light as you can see from the extract included attached.

I don't see a lot of activity (one post) specific to SHEWHART usage, but perhaps that's because eveyoone else has it figured out!

Thanks in advance,
John

http://support.sas.com/documentation/cdl/en/qcug/63922/HTML/default/viewer.htm#/documentation/cdl/en...
HREF=SAS-data-set
draws reference lines perpendicular to the horizontal (subgroup) axis on the primary chart. You can use this option in the following ways:

You can specify the values for the lines with an HREF= list. If the subgroup variable is numeric, the values must be numeric. If the subgroup variable is character, the values must be quoted strings of up to 32 characters. If the subgroup variable is formatted, the values must be given as internal values.

Examples of HREF=values follow:

href=5
href=5 10 15 20 25 30
href='Shift 1' 'Shift 2' 'Shift 3'
You can specify the values for the lines as the values of a variable named _REF_ in an HREF= data set. The type and length of _REF_ must match those of the subgroup variable specified in the chart statement. Optionally, you can provide labels for the lines as values of a variable named _REFLAB_, which must be a character variable of length 16 or less. If you want distinct reference lines to be displayed in charts for different processes specified in the chart statement, you must include a character variable of length 32 or less named _VAR_, whose values are the processes. If you do not include the variable _VAR_, all of the lines are displayed in all of the charts.

Each observation in the HREF= data set corresponds to a reference line. If BY variables are used in the input data set (DATA=, HISTORY=, or TABLE=), the same BY variable structure must be used in the HREF= data set unless you specify the NOBYREF option.

Related options are CHREF=, HREFCHAR=, HREFLABELS=, HREFLABPOS=, LHREF=, and NOBYREF.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Using the ENGINES data from the Shewhart doc, I was able to make HREF=<sas dataset> work. Remember that the line for HREF specifies position of reference lines perpendicular to horizontal axis -- so the numbers that I specify correspond to the ID values where I want the lines to be drawn. Just as the VREF option specifies the position of reference lines perpendicular to vertical axis. The example below uses both HREF= and VREF= with the ENGINES data.

cynthia
[pre]
data Engines;
input ID Weight @@;
label Weight='Engine Weight (lbs)'
ID ='Engine ID Number';
datalines;
1711 1270 1712 1258 1713 1248 1714 1260
1715 1263 1716 1260 1717 1259 1718 1240
1719 1260 1720 1246 1721 1238 1722 1253
1723 1249 1724 1245 1725 1251 1726 1252
1727 1249 1728 1274 1729 1258 1730 1268
1731 1248 1732 1295 1733 1243 1734 1253
1735 1258
;
run;

data myhref(keep=_REF_);
_REF_ = 1715;
output;
_REF_ = 1720;
output;
_REF_ = 1730;
output;
_REF_ = 1735;
output;
run;

data myvref(keep=_REF_);
_REF_=1240;
output;
_REF_=1280;
output;
run;

symbol v = dot;
title 'Individual Measurements Chart and Histogram';
proc shewhart data=Engines;
irchart Weight*ID /
href=work.myhref
vref= work.myvref
nochart2;
run;[/pre]
khill
Calcite | Level 5
Cynthia,

Thanks for the quick response. I'll have to change my logon to knucklehead! I completely misread perpendicular as parallel. So it's no wonder my numeric variable were ignored!

The VREF works as documented.

Thanks again,
John
Cynthia_sas
SAS Super FREQ
I understand completely! I have always thought they should have been named: larallel (because all the l's are parallel) and tertenticutar (because the cross on all the T's are perpendicular). But nobody ever asks me about making up words for things. Starting them with the same letter -- not the best idea!

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 1479 views
  • 0 likes
  • 2 in conversation