T
Trippy
Please excuse me if there's a really obvious answer to this question. I work in local government, and somehow the job of finding a statistics package has fallen on my desk.
That being said, alhough I like how easy it is to use, i've been using the trial version of Minitab for about 3 days.
I'm in the process of writing a macro to compare box and whisker plots for water quality data for the last N samples against the total population of all samples collected to date, and referencing these box and whisker plots, which include custom quantiles, and 2SE Confidence intervals.
What i'm aiming for is a macro that my co-workers who have no little experience of statistics can use, so they can simply type in:
And Minitab will do the rest of the work for them (as long as the first row of their spreadsheet is column names).
Here's what i've managed to figure out so far.
I've figured this much out by manually adding (for example) the points, and seeing what changes it made to the command code (Not to mention much perusing of help files).
What I need the help with is the most straight forward thing (I think) I can do is to say to people "Include the information relating to the permit limits under columns with these names", so that I can replace DATA1, DATA 2, DATA3, and DATA4 with those colum names, but so far everything i've tried has failed with a variety of error messages.
My question is this - How do I get a Macro to look up a column name, rather than a column number, without specifiying it in the commandline when I initiate the macro?
In other words, if I was executing it as an exec, or on the command line I would just type in:
But if I include that line in the macro it gives me the error message:
That being said, alhough I like how easy it is to use, i've been using the trial version of Minitab for about 3 days.
I'm in the process of writing a macro to compare box and whisker plots for water quality data for the last N samples against the total population of all samples collected to date, and referencing these box and whisker plots, which include custom quantiles, and 2SE Confidence intervals.
What i'm aiming for is a macro that my co-workers who have no little experience of statistics can use, so they can simply type in:
Code:
%COMPARE 'ANALYTE' N
Here's what i've managed to figure out so far.
Code:
Macro
COMPARE ANALYTE1 J DATA1 DATA2 DATA3 DATA4
MCOLUMN ANALYTE1 ANALYTE2 DATA1 DATA2 DATA3 DATA4
Mconstant K1 K2 K3 K4 K5 K6 K7 K8 K9 K10 K11 K12 TEMP1 I J H
LET H=COUNT(ANALYTE1)
LET I=H-(J-1)
do I=I:H
LET ANALYTE2[I]=ANALYTE1[I]
ENDDO
LET K1=PERCENTILE(ANALYTE1,DATA1[1])
LET K2=PERCENTILE(ANALYTE2,DATA1[1])
LET K3=MEAN(ANALYTE1)-STDEV(ANALYTE1)/SQRT(N(ANALYTE1))
LET K4=MEAN(ANALYTE1)+STDEV(ANALYTE1)/SQRT(N(ANALYTE1))
LET K5=MEAN(ANALYTE2)-STDEV(ANALYTE2)/SQRT(N(ANALYTE2))
LET K6=MEAN(ANALYTE2)+STDEV(ANALYTE2)/SQRT(N(ANALYTE2))
LET K7=CONCATENATE("Consent Limit - ",DATA2[1]," (",DATA3[1]," ",DATA4[1],")")
LET K8=CONCATENATE("Consent Limit - ",DATA2[2]," (",DATA3[2]," ",DATA4[2],")")
LET K9=DATA3[1]
LET K10=DATA3[2]
LET K11=EXP(AVERAGE(LOGTEN(ANALYTE1)))
LET K12=EXP(AVERAGE(LOGTEN(ANALYTE2)))
Boxplot ANALYTE1 ANALYTE2;
Overlay;
Proportional;
SOffset;
IQRBox;
Outlier;
Mean;
Type 18;
Size 1.5;
Reference 2 K9;
MODEL 1;
Label K7;
Reference 2 K10;
MODEL 1;
Label K8;
Title;
Footnote;
FPanel;
Marker 2 K6;
Unit 1;
Type 28;
Color 2;
Size 2;
Marker 2 K5;
Unit 1;
Type 19;
Color 2;
Size 2;
Marker 1 K4;
Unit 1;
Type 28;
Color 2;
Size 2;
Marker 1 K3;
Unit 1;
Type 19;
Color 2;
Size 2;
Marker 2 K2;
Unit 1;
Type 11;
Color 2;
Size 2;
Marker 1 K1;
Unit 1;
Type 11;
Color 2;
Size 2;
Marker 1 K11;
Unit 1;
Type 8;
Color 16;
Size 2;
Marker 2 K12;
NoDTitle.
endmacro
What I need the help with is the most straight forward thing (I think) I can do is to say to people "Include the information relating to the permit limits under columns with these names", so that I can replace DATA1, DATA 2, DATA3, and DATA4 with those colum names, but so far everything i've tried has failed with a variety of error messages.
My question is this - How do I get a Macro to look up a column name, rather than a column number, without specifiying it in the commandline when I initiate the macro?
In other words, if I was executing it as an exec, or on the command line I would just type in:
Code:
LET K1=PERCENTILE(ANALYTE1,'PERCENTILE'[1])
Code:
LET K1=PERCENTILE(ANALYTE1,'PERCENTILE'[1])
X
* ERROR * Cannot use quoted string to refer to macro variables
* ERROR * Completion of computation impossible.
Last edited by a moderator: