{ This program gives the template graph for the factors. The factors here are entered by hand and not calculated. This program should be used in conjunction with SurveyFactors.stb, and the downloadable sample data file, surveyfactors.sta. You will first run GraphTemp.stb, then open surveyfactors.sta and run SurveyFactors.stb.
Program written, modified, or edited at StatSoft Pacific}
randomaccess;
redim upper(17,1); {ARRAY CONTAINING MOST EFFECTIVE RANGE}
redim lower(17,1); {ARRAY CONTAINING LEAST EFFECTIVE RANGE}
redim nofact(17,1); {ARRAY CONTAINING NUMBER OF FACTORS}
{KNOWN NORMALISED VALUES FOR FACTORS PLACED IN THEIR RESPECTIVE
POSITIONS FOR BOTH MOST AND LEAST EFFECTIVE OBSERVATIONS}
upper(1,1):=9;
upper(2,1):=9;
upper(3,1):=8;
upper(4,1):=8;
upper(5,1):=8;
upper(6,1):=8;
upper(7,1):=8;
upper(8,1):=8;
upper(9,1):=8;
upper(10,1):=8;
upper(11,1):=8;
upper(12,1):=8;
upper(13,1):=7;
upper(14,1):=9;
upper(15,1):=9;
upper(16,1):=9;
upper(17,1):=9;
lower(1,1):=5;
lower(2,1):=5;
lower(3,1):=5;
lower(4,1):=5;
lower(5,1):=6;
lower(6,1):=6;
lower(7,1):=5;
lower(8,1):=5;
lower(9,1):=5;
lower(10,1):=5;
lower(11,1):=5;
lower(12,1):=5;
lower(13,1):=5;
lower(14,1):=5;
lower(15,1):=4;
lower(16,1):=4;
lower(17,1):=5;
for i:=1 to 17 do
begin
nofact(i,1):=i;
end;
{###################################################
Produce Template Graph
####################################################}
DisplayInputBox('Title of Graph','New Title',out$);
GetDelimitedString(out$,1,title$);
{Place most effective values for factors on the template graph}
ihandl:=NewGraph (LINEPLOT, title$, '','', 17, nofact, upper);
line01$:='@b(Mean Scores Normalised to 10)@b';
GraphSetTitle(ihandl, 2, line01$);
{Add least effective values for factors on the template graph}
GraphAddPlot (ihandl, LINEPLOT, '', 17, nofact, lower);
{turn on the points for plot 1, default size and color}
GraphSetPlotPointStyle (ihandl, 1, ON, 4, 4, Green);
GraphSetPlotLineStyle (ihandl, 1, on,L_dotted, 1, Green);
{turn on the points for plot 2}
GraphSetPlotPointStyle (ihandl, 2, ON, 3,4, red);
GraphSetPlotLineStyle (ihandl, 2, on, L_dotted, 1, red);
{Set legend}
line02$:='@l[1]'+'MostEffective'+'@l[2]'+ 'Least Effective';
GraphSetTitle (ihandl, 3, line02$);
{Insert factor names so that they can be placed on the x-axis of the template graph}
Name1$:='FACTOR NAME1';
Name2$:='FACTOR NAME2';
Name3$:='FACTOR NAME3';
Name4$:='FACTOR NAME4';
Name5$:='FACTOR NAME5';
Name6$:='FACTOR NAME6';
Name7$:='FACTOR NAME7';
Name8$:='FACTOR NAME8';
Name9$:='FACTOR NAME9';
Name10$:='FACTOR NAME10';
Name11$:='FACTOR NAME11';
Name12$:='FACTOR NAME12';
Name13$:='FACTOR NAME13';
Name14$:='FACTOR NAME14';
Name15$:='FACTOR NAME15';
Name16$:='FACTOR NAME16';
Name17$:='FACTOR NAME17';
{Insert group names so that they can be placed on the x-axis of the template graph}
Namey1$:='@bGROUP1@b';
Namey2$:='@bGROUP2@b';
Namey3$:='@bGROUP3@b';
Namey4$:='@bGROUP4@b';
{Set position for factors on the x-axis}
GraphSetScaleTextLabel (ihandl, AX_X, 1, NAME1$);
GraphSetScaleTextLabel (ihandl, AX_X, 2, NAME2$);
GraphSetScaleTextLabel (ihandl, AX_X, 3, NAME3$);
GraphSetScaleTextLabel (ihandl, AX_X, 4, NAME4$);
GraphSetScaleTextLabel (ihandl, AX_X, 5, NAME5$);
GraphSetScaleTextLabel (ihandl, AX_X, 6, NAME6$);
GraphSetScaleTextLabel (ihandl, AX_X, 7, NAME7$);
GraphSetScaleTextLabel (ihandl, AX_X, 8, NAME8$);
GraphSetScaleTextLabel (ihandl, AX_X, 9, NAME9$);
GraphSetScaleTextLabel (ihandl, AX_X, 10, NAME10$);
GraphSetScaleTextLabel (ihandl, AX_X, 11, NAME11$);
GraphSetScaleTextLabel (ihandl, AX_X, 12, NAME12$);
GraphSetScaleTextLabel (ihandl, AX_X, 13, NAME13$);
GraphSetScaleTextLabel (ihandl, AX_X, 14, NAME14$);
GraphSetScaleTextLabel (ihandl, AX_X, 15, NAME15$);
GraphSetScaleTextLabel (ihandl, AX_X, 16, NAME16$);
GraphSetScaleTextLabel (ihandl, AX_X, 17, NAME17$);
{Set position for group names on the top x-axis}
GraphSetScaleTextLabel (ihandl, AX_TOP, 2.5, NAMEy1$);
GraphSetScaleTextLabel (ihandl, AX_TOP, 6.5, NAMEy2$);
GraphSetScaleTextLabel (ihandl, AX_TOP, 11, NAMEy3$);
GraphSetScaleTextLabel (ihandl, AX_TOP, 15.5, NAMEy4$);
GraphSetScaling(ihandl,ax_x,scaling_manual_0,.5,17.5,1);
GraphSetScaling(ihandl,ax_top,scaling_manual_0,.5,17.5,1);
GraphSetScaleTickmarks(ihandl,ax_x,tickmarks_inside,5,tickmarks_off,0,0);
GraphSetScaleTickmarks(ihandl,ax_top,tickmarks_inside,5,tickmarks_off,0,0);
GraphSetScaleTickmarks(ihandl,ax_y,tickmarks_inside,5,tickmarks_off,0,0);
GraphSetScaleTickmarks(ihandl,ax_ry,tickmarks_inside,5,tickmarks_off,0,0);
Temp$:='c:\template.stg'; {This graph location needs to be changed}
If DisplayInputBox('Title of Graph File','File Name:',temp$) then
SaveGraph (ihandl, temp$);
DisplayGraph(ihandl);
If DisplayMessageBox(MB_YESNO, 'Print', 'Print Graph?') = IDYES then
PrintGraph(ihandl);
| Back to List of Programs |
![[StatSoft]](../../../images/sssmall.gif)
2300 East 14th Street, Tulsa, OK 74104
Phone: (918) 749-1119; Fax: (918) 749-2217
e-mail: info@statsoft.com
©Copyright StatSoft, Inc., 1984-2004.
StatSoft, StatSoft logo, STATISTICA, SEWSS, SEDAS, Data Miner, SEPATH and GTrees are trademarks of StatSoft, Inc.