STATISTICA







STATISTICA BASIC Program GGAdjust.stb

{ This program will compute Greenhouse-Geisser's epsilon and adjusted test of significance for within subject effects in ANOVA (Greenhouse & Geisser, 1959). Epsilon is computed from the SSCP: Error matrix for a within subject effect with three or more levels. To use this program, create the SSCP: Error scrollsheet for a specific within subject effect in the ANOVA/MANOVA module. Click on the SSCP: Error matrix so that it is the active scrollsheet. Then execute this STATISTICA BASIC program. The program first outputs a single-cell scrollsheet listing the value of epsilon for the repeated measure effect. The program will then ask the user if adjusted degrees of freedom and an adjusted p level are desired for the efffect. If so, the program will prompt the user to input the F and the unadjusted demoninator degrees of freedom for the effect (which can be found on the Effect scrollsheet). The program will then output a scrollsheet with the F for the effect, the value of epsilon, the adjusted degrees of freedom, and the adjusted p level.

Program written, modified, or edited at StatSoft, Inc.
}

RandomAccess;
NoDataFileVariableNames;

{Make sure the users are ready to compute G-G epsilon.}
     startmsg :=DisplayMessageBox (MB_OKCANCEL, 'Greenhouse-Geisser Adjustment',
               'This program will first compute the Greenhouse-Geisser epsilon from the SSCP: Error
matrix for a repeated measure effect with two or more degrees of freedom. The SSCP: Error matrix
needs to be active on the screen.  If you are ready, click "OK".');
     If startmsg = IDCANCEL then stop;
{Compute Greenhouse-Geisser epsilon}
          errorhdl := GetScrollsheet(0);
{Verify if the active scrollsheet is the SSCP: Error matrix.}
          ScrollsheetGetTitle (errorhdl, 1, title$);
          title$ := Mid(title$, 1, 11);
          If title$ = "SSCP: Error" then
         begin
              k :=ScrollsheetGetNbCols (errorhdl);
                 redim SSE(k,k), result(4,1), input(2);
              ScrollsheetGetMatrix (errorhdl, 1, 1, SSE);
                   MatrixTrace (SSE, trSSE);
                   tr1:=trSSE^2;
              MatrixMultiply(SSE,SSE,SSE);
                      MatrixTrace(SSE,tr2);
                       result(1,1) := tr1/(k*tr2);
{Arrange the first output}
              rsltscr := NewScrollsheet (1, 1, result,'G-G Adjustment Epsilon ', 'Epsilon ',
'Greenhouse-Geisser');
              cntnmag := DisplayMessageBox(MB_YESNO,'Greenhouse-Geisser Adjustment',
               'Do you want to compute adjusted degrees of freedom and an adjusted p-level?  If so, you
will be prompted to input the F-value and the unadjusted denominator degrees of freedom for the
effect.  Click "Yes" to continue or "No" to exit the program.');
              If cntnmag = IDYES then
              begin
                 DisplayNumericInputBox ('Input the F-value and the unadjusted denominator degrees of
freedom', 'F-value|Unadjusted denominator degrees of freedom (df 2)', input);
                 result(2,1) := k*result(1,1);
                 result(3,1) := input(2)*result(1,1);
                 result(4,1) := 1-IFDistr (input(1), result(2,1), result(3,1));
{Arrange the second output.}
                 title2$ := 'G-G Adjustment'+'|'+ 'F = ' + Str(input(1), 9,7);
                 rsltscr2 := NewScrollsheet (4, 1, result, title2$,  'Epsilon|df 1|df
2|p-level','Greenhouse-Geisser');
                 DeleteScrollsheet(rsltscr);
              end
              else stop;
                      end
                    else
                      DisplayMessageBox (MB_OK, 'Greenhouse-Geisser Adjustment Epsilon', 'The matrix
scrollsheet active on the screen is not the SSCP: Error matrix.  Please verify that the active scrollsheet
is the SSCP: Error matrix.');
Back to List of Programs



[StatSoft]
2300 East 14th Street, Tulsa, OK 74104
Phone: (918) 749-1119; Fax: (918) 749-2217

[StatSoft]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.