Help using Base SAS procedures

PROC SHEWHART HREF=SAS-data-set Option

Reply
Contributor
Posts: 23

PROC SHEWHART HREF=SAS-data-set Option

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.
SAS Super FREQ
Posts: 8,862

Re: PROC SHEWHART HREF=SAS-data-set Option

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]
Contributor
Posts: 23

Re: PROC SHEWHART HREF=SAS-data-set Option

Posted in reply to Cynthia_sas
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
SAS Super FREQ
Posts: 8,862

Re: PROC SHEWHART HREF=SAS-data-set Option

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
Ask a Question
Discussion stats
  • 3 replies
  • 524 views
  • 0 likes
  • 2 in conversation