* Encoding: UTF-8. * For the trial analyses, the program was set to read a raw data file and then process the active SPSS data file -- see the "GET data" command near the start of the program. However, any SPSS system file can be specified on the GET statement; Alternatively, the READ statement (a MATRIX--END MATRIX command) can also be used to read a raw data file. A data matrix can also be entered directly, within the MATRIX--END MATRIX program (see the example further below). * DETECT Data Set A, from www.LevelsOfAnalysis.com variables: DYAD NEGOT SATIS PERF. data list free / DYAD NEGOT SATIS PERF. begin data. 1 14 14 32 1 22 28 33 3 13 16 39 3 26 26 39 4 26 22 36 4 16 20 35 6 16 16 26 6 24 22 27 7 23 24 27 7 15 22 26 2 20 23 22 2 13 19 22 5 18 15 20 5 22 23 20 8 21 25 4 8 14 17 3 9 27 24 2 9 14 19 4 10 25 25 18 10 15 17 20 31 14 14 32 31 22 28 33 33 13 16 39 33 26 26 39 34 26 22 36 34 16 20 35 36 16 16 26 36 24 22 27 37 23 24 27 37 15 22 26 32 20 23 22 32 13 19 22 35 18 15 20 35 22 23 20 38 21 25 4 38 14 17 3 39 27 24 2 39 14 19 4 40 25 25 18 40 15 17 20 end data. descriptives var = all. sort cases by dyad. set length=none printback = off width = 120 mxloops = 9000. matrix. * WABA: Within And Between Groups Analysis. * Sources: Dansereau, Alutto, & Yammarino (1984). Theory Testing in Organizational Behavior. Prentice-Hall; Yammarino & Markham (1992). J. of Applied Psychology, 77, 168-176; www.LevelsOfAnalysis.com. * Prepare a raw data matrix for analysis, where rows = cases, & columns = variables; Each row contains the data from a single individual; The values/variables in each row are separated from each other by one or more spaces; Cases with missing values are not permitted in the data file. * The first value in each row (i.e., the first column of values in the data file) must be the individuals' group numbers/codes, which must be integers. The program sorts individuals into groups on the basis of these numbers/codes; Variable scores appear in subsequent columns. * Multiple Variable Analyses are conducted when the number of variables = 3, which is a limit that is determined by Hotelling's t-test for dependent correlations. For MVAs involving more than three variables, simply run this program again using new/different combinations of three variables. * Use the following name for the raw data matrix: "data". * The following command causes the program to process the currently active SPSS data file. get data / file = *. * Data can also be entered into the program directly, as in the following example using the "compute data = {" command. * DETECT Data Set A, from www.LevelsOfAnalysis.com variables: DYAD NEGOT SATIS PERF. compute data = { 1, 14, 14, 32; 1, 22, 28, 33; 3, 13, 16, 39; 3, 26, 26, 39; 4, 26, 22, 36; 4, 16, 20, 35; 6, 16, 16, 26; 6, 24, 22, 27; 7, 23, 24, 27; 7, 15, 22, 26; 2, 20, 23, 22; 2, 13, 19, 22; 5, 18, 15, 20; 5, 22, 23, 20; 8, 21, 25, 4; 8, 14, 17, 3; 9, 27, 24, 2; 9, 14, 19, 4; 10, 25, 25, 18; 10, 15, 17, 20; 31, 14, 14, 32; 31, 22, 28, 33; 33, 13, 16, 39; 33, 26, 26, 39; 34, 26, 22, 36; 34, 16, 20, 35; 36, 16, 16, 26; 36, 24, 22, 27; 37, 23, 24, 27; 37, 15, 22, 26; 32, 20, 23, 22; 32, 13, 19, 22; 35, 18, 15, 20; 35, 22, 23, 20; 38, 21, 25, 4; 38, 14, 17, 3; 39, 27, 24, 2; 39, 14, 19, 4; 40, 25, 25, 18; 40, 15, 17, 20 }. * Remove the above "data" matrix before attempting to process your own data. * Done: The program will can now analyze the data. compute nss = nrow(data). compute totmn = csum(data(:,2:ncol(data))) / nss. compute totdev = make( nss, ncol(data)-1, -9999). compute withdev = make( nss, ncol(data)-1, -9999). compute betwdev = make( nss, ncol(data)-1, -9999). compute grpns = make( 1, 1, -9999). compute first = 1. compute ngrps = 0. loop #luper1 = 2 to nss. do if data((#luper1),1) ne data((#luper1-1),1) or #luper1 = nss. do if #luper1 ne nss. compute last = #luper1 - 1. end if. do if #luper1 = nss. compute last = #luper1. end if. compute ngrps = ngrps + 1. compute tempdat = data(first:last,2:ncol(data)). compute cmean = csum(tempdat) / nrow(tempdat). compute grpns = { grpns ; (last - first) + 1 }. loop #luper2 = first to last. compute totdev(#luper2,:) = data(#luper2,2:ncol(data)) - totmn. compute withdev(#luper2,:) = data(#luper2,2:ncol(data)) - cmean. compute betwdev(#luper2,:) = cmean - totmn. end loop. compute first = #luper1. end if. end loop. * correlation matrix -- via z scores. compute tempdat = { totdev, betwdev, withdev }. compute sd = make(1, ncol(tempdat), -9999). compute zscores = make(nrow(tempdat), ncol(tempdat), -9999). compute n = nrow(tempdat). compute nm1 = n - 1. compute mean = csum(tempdat) / n. loop #aa = 1 to ncol(tempdat). compute sd(1,#aa) = sqrt(cssq((tempdat(:,#aa)- mean(1,#aa)))/nm1). compute zscores(:,#aa) = (tempdat(:,#aa) - mean(1,#aa)) / sd(1,#aa). end loop. compute cormat = (1 / nm1 ) * ( t(zscores) * zscores ) . compute nvars = nrow(cormat) / 3. * mean, sd, & correlation matrix -- via z scores. compute tempdat = data(:,2:ncol(data)). compute sd = make(1, ncol(tempdat), -9999). compute mean = csum(tempdat) / n. loop #aa = 1 to ncol(tempdat). compute sd(1,#aa) = sqrt(cssq((tempdat(:,#aa)- mean(1,#aa)))/nm1). end loop. print /title="WABA". print nss /title="Number of Individual Cases in the Data File:". print ngrps/title="Number of Groups in the Data File:". print nvars/title="Number of Variables for the Analyses:". print /title="All Significance Tests Are Two-Tailed". print { t(1:nvars), t(mean), t(sd) }/ /title="Variable Means and Standard Deviations" /clabels="Variable" "Mean" "Std Dev" /format "f8.4" / spaces = 3. * Within- and Between-Groups Analysis of Variance. compute etabetw = diag( cormat( (nvars+1):(nvars*2) , 1:nvars)). compute etawith = diag( cormat( (nvars*2+1):(nvars*3),1:nvars)). compute etasq = { etabetw, etawith }&**2. * E tests. compute etests = etabetw &/ etawith. * F tests. compute ftrad = (etests&**2) * ( (nss - ngrps) / (ngrps - 1) ). compute fcrctd = 1 &/ ftrad. * dfs for the F values (Dansereau et al 1984, p. 125, 128, 172). compute dfnumt = make(nvars,1,(ngrps - 1)). compute dfdemt = make(nvars,1,(nss - ngrps)). compute dfnumc = make(nvars,1,(nss - ngrps)). compute dfdemc = make(nvars,1,(ngrps - 1)). * sig levels for F. compute pftrad = 1 - fcdf(abs(ftrad),dfnumt(1,1),dfdemt(1,1)). compute pfcrctd = 1 - fcdf(abs(fcrctd),dfnumc(1,1),dfdemc(1,1)). * for displaying only the appropriate F results. compute fetas = { t(1:nvars), ftrad, dfnumt, dfdemt, pftrad}. loop #lupev = 1 to nvars. do if etawith(#lupev,1) > etabetw(#lupev,1). compute fetas(#lupev,2) = fcrctd(#lupev,1). compute fetas(#lupev,3) = dfnumc(#lupev,1). compute fetas(#lupev,4) = dfdemc(#lupev,1). compute fetas(#lupev,5) = pfcrctd(#lupev,1). end if. end loop. print { t(1:nvars), etabetw, etawith, etasq } /title= "Within-Groups and Between-Groups Etas and Eta-squared values:" /clabels="Variable" "Eta-Betw" "Eta-With" "Eta-Bsq" "Eta-Wsq" /format "f8.4" / spaces = 2. print /title= "The above Eta-Betw and Eta-With values for each variable are" / spaces = 2. print /title="tested relative to one another with E tests of". print { fetas(:,1), etests, fetas(:, 2:5) } /title= "practical significance and F tests of statistical significance:" /clabels="Variable" "E-Test" "F" "df num." "df dem." "p" /format "f8.4". print /title=' E-test practical significance criteria & inductions:'. print /title=' E >= 1.30323 = Wholes - 15; E >= 1.73205 = Wholes - 30;'. print /title=' E <= 0.76733 = Parts - 15; E <= 0.57735 = Parts - 30;'. * Other indices of within-group agreement: Intraclass Correlations. compute grpns = grpns( 2:(nrow(grpns)), :). compute ssb = csum(betwdev&**2). compute dfb = ngrps - 1. compute msb = ssb / dfb. compute ssw = csum(withdev&**2). compute dfw = csum(grpns - 1). compute msw = ssw / dfw. compute icc1 = (msb - msw) &/ (msb+((csum(grpns)/nrow(grpns))-1)*msw). compute icc2 = (msb - msw) &/ msb. print { t(1:nvars), t(icc1), t(icc2) } /title= "Other Indices of Within-Group Agreement: Intraclass Correlations" /clabels="Variable" "ICC(1)" "ICC(2)" /format "f8.4" / spaces = 2. print /title=" Sources:". print /title=" Bliese (2000), in Klein et al, Multilevel theory, research,". print /title=" and methods in organizations.". print /title=" Shrout & Fleiss, 1979, Psychological Bulletin, 86, 420-428.". print /title=" McGraw & Wong, 1996, Psychological Methods, 1, 30-46.". * Within- and Between-Groups Analysis of Covariance Analyses. compute rbetw = cormat( (nvars+1):(nvars*2),(nvars+1):(nvars*2)). compute rwith = cormat( (nvars*2+1):(nvars*3),(nvars*2+1):(nvars*3)). compute rbw = make(1, 4, -9999). loop #luper = 1 to nvars-1. loop #lupec = #luper+1 to nvars. compute rbw = {rbw; #luper,#lupec,rbetw(#luper,#lupec),rwith(#luper,#lupec)}. end loop. end loop. compute rbw = rbw(2:nrow(rbw),:). * A test. compute atests = arsin(sqrt(1-(rbw(:,4)&**2)))-arsin(sqrt(1-(rbw(:,3)&**2))). * Z test. compute zbw = make(nrow(rbw), 1, -9999). do if ngrps > 3. loop #luper = 1 to nrow(rbw). do if abs(rbw(#luper,3)) < 1 and abs(rbw(#luper,4)) < 1. compute zbxy =abs(0.5*((ln(1+abs(rbw(#luper,3))))-(ln(1-abs(rbw(#luper,3)))))). compute zwxy =abs(0.5*((ln(1+abs(rbw(#luper,4))))-(ln(1-abs(rbw(#luper,4)))))). compute zbw(#luper,1) = (zbxy - zwxy) / sqrt( (1/(nss-ngrps-2))+(1/(ngrps-3))). end if. end loop. end if. compute pzbw = 1 - cdfnorm(abs(zbw)) . * R test of practical sigificance. compute rbig = make(nrow(rbw), 2, -9999). loop #luper = 1 to nrow(rbw). loop #lupec = 3 to 4. do if abs(rbw(#luper,#lupec)) < 1. * rbig formula from Dansereau 1984 p 131. compute rbig(#luper,#lupec-2) = abs( rbw(#luper,#lupec) &/ sqrt ( 1 - rbw(#luper,#lupec)&**2 ) ). * compute rbig formula from Yamarino & Markham, 1992 p 170 = slightly diff. * compute rbig(#luper,#lupec-2) = rbw(#luper,#lupec) &/ ( ( (1 - (rbw(#luper,#lupec)&**2) )&**.6667) ). end if. end loop. end loop. * t-tests of statistical significance (Yamarino & Markham, 1992 p 170). compute tb = rbig(:,1) * sqrt(ngrps-2). compute dftb = ngrps - 2. compute tw = rbig(:,2) * sqrt(nss-ngrps-1). compute dftw = nss - ngrps - 1. compute ptb = make( nrow(tb), 1, -9999 ). compute ptw = make( nrow(tw), 1, -9999 ). loop #luper = 1 to nrow(tb). compute ptb(#luper,1) = (1 - tcdf(abs(tb(#luper,1)),dftb)) * 2. compute ptw(#luper,1) = (1 - tcdf(abs(tw(#luper,1)),dftw)) * 2. end loop. print {rbw, atests, zbw, pzbw} /title="Within-Groups and Between-Groups Correlations:" /format "f8.4" /clabels="Var.#" "Var.#" "r-Betw" "r-With" "A-test" "Z-test" "p" / spaces = 2. print /title= " A-tests represent practical, and Z-tests represent statistical,". print /title= " assessments of the differences between the within-groups and". print /title=" between-groups correlations.". print /title=" A-test practical significance criteria & inductions:". print /title=" A >= 0.2618 = Wholes - 15; A >= 0.5236 = Wholes - 30;". print /title=" A <= -0.2618 = Parts - 15; A <= -0.5236 = Parts - 30;". print /title=" -9999 indicates the Z test could not be computed.". print /title="Between-Groups Correlation Tests of"/ spaces = 2. print { rbw(:,1:2), rbig(:,1), tb, ptb } /title="Practical (R) and Statistical (t) Significance" /clabels="Var.#" "Var.#" "R" "t-test" "p" /format "f8.4" . print /title=" R-test practical significance criteria & inductions:". print /title=" R >= 0.26795 = S - 15; R >= 0.57735 = S - 30;". print {1, dftb} /title=" Degrees of Freedom for t-tests:". print /title=" A value of -9999 indicates the t-test could not be computed.". print /title="Within-Groups Correlation Tests of"/ spaces = 2. print { rbw(:,1:2), rbig(:,2), tw, ptw } /title="Practical (R) and Statistical (t) Significance" /clabels="Var.#" "Var.#" "R" "t-test" "p" /format "f8.4". print /title=" R-test practical significance criteria & inductions:". print /title=" R >= 0.26795 = S - 15; R >= 0.57735 = S - 30;". print { 1, dftw} /title=" Degrees of Freedom for t-tests:". print /title=" A value of -9999 indicates the t-test could not be computed.". * Within- and Between-Groups Components and Raw (Total) Correlations. compute compons = rbw. loop #luper = 1 to nrow(rbw). compute compons(#luper,3) = etabetw(rbw(#luper,1),1) * etabetw(rbw(#luper,2),1) * rbw(#luper,3). compute compons(#luper,4) = etawith(rbw(#luper,1),1) * etawith(rbw(#luper,2),1) * rbw(#luper,4). end loop. compute compons = { compons , (compons(:,3) + compons(:,4)) }. * R test of practical sigificance of the total correlations. compute rbig2 = make(nrow(compons), 1, -9999). loop #luper = 1 to nrow(compons). do if abs(compons(#luper,5)) < 1. * rbig formula from Dansereau 1984 p 131. compute rbig2(#luper,1) = abs( compons(#luper,5) &/ sqrt ( 1 - compons(#luper,5)&**2 ) ). * rbig formula from Yamarino & Markham, 1992 p 170 = slightly diff * compute rbig2(#luper,#lupec-2) = rbw(#luper,#lupec) &/ ( ( (1 - (rbw(#luper,#lupec)&**2) )&**.6667) ). end if. end loop. * t-tests for the total correlations Dansereau et al 1984 p 119. compute ttot = rbig2 * sqrt(nss-2). compute dftot = nss - 2. compute ptot = make( nrow(ttot), 1, -9999 ). loop #luper = 1 to nrow(ttot). compute ptot(#luper,1) = (1 - tcdf(abs(ttot(#luper,1)),dftot)) * 2. end loop. * A test of the between vs within components difference . compute aradians = arsin(sqrt(1-(compons(:,4)&**2))) - arsin(sqrt(1-(compons(:,3)&**2))). * Z test of the between vs within components difference . compute zbwc = make(nrow(compons), 1, -9999). do if ngrps > 3. loop #luper = 1 to nrow(compons). do if abs(compons(#luper,3)) < 1 and abs(compons(#luper,4)) < 1. compute zbxyc =abs( 0.5* ((ln(1+abs(compons(#luper,3)))) - (ln(1-abs(compons(#luper,3))))) ). compute zwxyc =abs( 0.5* ((ln(1+abs(compons(#luper,4)))) - (ln(1-abs(compons(#luper,4))))) ). compute zbwc(#luper,1) = (zbxyc - zwxyc) / sqrt( (1/(nss-ngrps-2))+(1/(ngrps-3)) ). end if. end loop. end if. compute pzbwc = (1 - cdfnorm(abs(zbwc))) * 2. print /title="Within-Groups and Between-Groups WABA Components"/ spaces = 2. print compons /title="and Raw/Total Correlation(s):" /clabels="Var.#" "Var.#" "Betw" "With" "Raw/Tot." /format "f8.4". print /title="Practical (R) and Statistical (t) Significance of". print { compons(:,1:2), rbig2, ttot, ptot } /title="the Raw/Total correlations:" /clabels="Var.#" "Var.#" "R" "t-test" "p" /format "f8.4". print /title=" R-test practical significance criteria & inductions:". print /title=" R >= 0.26795 = S - 15; R >= 0.57735 = S - 30;". print {1,dftot} /title=" Degrees of Freedom for t-tests:". print /title=" A value of -9999 indicates the t-test could not be computed.". print /title= "The Within-Groups and Between-Groups WABA Components are tested relative to"/ spaces = 2. print {compons(:,1:2), aradians, zbwc, pzbwc} /title= "one another with A tests of practical Z tests of statistical significance." /clabels="Var.#" "Var.#" "A-test" "Z-test" "p" /format "f8.4". print /title=" A-test practical significance criteria & inductions:". print /title=" A >= 0.2618 = Wholes - 15; A >= 0.5236 = Wholes - 30;". print /title=" A <= -0.2618 = Parts - 15; A <= -0.5236 = Parts - 30;". print /title=" -9999 indicates the Z test could not be computed.". * Multiple Variable Analysis. do if nvars ne 3. print /title="Multiple Variable Analysis was not conducted because". print /title="the number of variables was not = 3". end if. do if nvars = 3. print /title="Multiple Variable Analysis Using Within-Groups Correlations" / spaces = 3. print /title="Sources:". print /title="Dansereau, Alutto, & Yammarino (1984). Theory Testing in". print /title="Organizational Behavior. Prentice-Hall.". print /title= "Yammarino (1998). Multivariate aspects of the varient/WABA approach.". print /title="Leadership Quarterly, 9, 203-227.". print /title="www.LevelsOfAnalysis.com". print /title="Correlations are compared using both A tests of practical". print /title= "significance & Hotelling t-tests of statistical significance.". print /title= "A-test values > 15 degrees are considered practically significant.". compute dum = rbw. loop #luper = 1 to 3. compute rxy = dum(1,4). compute rxz = dum(2,4). compute ryz = dum(3,4). print { (dum(1,1)),(dum(1,2)),(rxy) ; (dum(2,1)),(dum(2,2)),(rxz) } /title="Within correlations:" /clabels="Var.#" "Var.#" "r" /space = 2 /format "f8.4". * "A" test of the difference between the correlations; Dansereau et al, 1984, p 140. compute atest = arsin(abs(sqrt(1-(rxy*rxy)))) - arsin(abs(sqrt(1-(rxz*rxz)))). compute adegs = atest * 57.29578. * Hotelling's t-test of the difference between the correlations; Dansereau et al, 1984, p 141. compute hotest = ( abs(rxy) - abs(rxz) ) * sqrt( ( (ngrps-2)*(1+abs(ryz)) ) / ( 2 * ( 1 - ryz&**2 - rxy&**2 - rxz&**2 + 2 * abs(ryz) * abs(rxy) * abs(rxz) ) ) ). compute dfhotest = ngrps-2. compute photest = (1 - tcdf(abs(hotest),dfhotest) ) * 2. print { abs(atest), abs(adegs), hotest, dfhotest, photest } /title="A test (in radians & degrees) & Hotelling's t-test:" /clabels= "A-rads" "A-degs" "t" "df" "p" /format "f8.4". * rotating the rows of the correlation data matrix. compute dum = { dum(3,:) ; dum }. compute dum = dum(1:3,:). end loop. print /title="Multiple Variable Analysis Using Between-Groups Correlations" /spaces = 3. print /title="Sources:". print /title="Dansereau, Alutto, & Yammarino (1984). Theory Testing in". print /title="Organizational Behavior. Prentice-Hall.". print /title="Yammarino (1998). Multivariate aspects of the varient/WABA". print /title="approach. Leadership Quarterly, 9, 203-227.". print /title="www.LevelsOfAnalysis.com". print /title="Correlations are compared using bothA tests of practical". print /title= "significance & Hotelling t-tests of statistical significance.". print /title= "A-test values > 15 degrees are considered practically significant.". compute dum = rbw. loop #luper = 1 to 3. compute rxy = dum(1,3). compute rxz = dum(2,3). compute ryz = dum(3,3). print { (dum(1,1)),(dum(1,2)),(rxy) ; (dum(2,1)),(dum(2,2)),(rxz) } /title="Between correlations:" /clabels="Var.#" "Var.#" "r" /space = 2 /format "f8.4". * "A" test of the difference between the correlations; Dansereau et al, 1984, p 140. compute atest = arsin(abs(sqrt(1-(rxy*rxy)))) - arsin(abs(sqrt(1-(rxz*rxz)))). compute adegs = atest * 57.29578. * Hotelling's t-test of the difference between the correlations; Dansereau et al, 1984, p 141. compute hotest = ( abs(rxy) - abs(rxz) ) * sqrt( ( (ngrps-3)*(1+abs(ryz)) ) / ( 2 * ( 1 - ryz&**2 - rxy&**2 - rxz&**2 + 2 * abs(ryz) * abs(rxy) * abs(rxz) ) ) ). compute dfhotest = ngrps-3. compute photest = (1 - tcdf(abs(hotest),dfhotest) ) * 2. print { abs(atest), abs(adegs), hotest, dfhotest, photest } /title="A test (in radians & degrees) & Hotelling's t-test:" /clabels= "A-rads" "A-degs" "t" "df" "p" /format "f8.4". * rotating the rows of the correlation data matrix. compute dum = { dum(3,:) ; dum }. compute dum = dum(1:3,:). end loop. end if. end matrix.