
MERGEName:
For each of the two data sets, we define "match" variables and "carry" variables. We assume that both sets of data have the same number of match and the same number of carry variables. The number of match variables is specified by entering the command (before the MERGE command)
The number of carry variables is specified by entering the command (before the MERGE command)
If these commands are not entered, the default is one match variable and one carry variable. Currently, a maximum of three match variables and eight carry variables are allowed. The merge is performed as follows:
Note that values of the "match" variables which exist for only one of the data sets are omitted in the merged data set.
<my1> ... <myk> <cy1> ... <cyl> <SUBSET/EXCEPT/FOR qualification> where <mx1> ... <mxk> are the k match variables for data set one; <cx1> ... <cxl> are the l carry variables for data set one; <my1> ... <myk> are the k match variables for data set two; <cy1> ... <cyl> are the l carry variables for data set two; <mz1> ... <mzk> are the k match variables for the merged data; <cz1> ... <cz2l> are the 2*l carry variables for the merged data; and where the <SUBSET/EXCEPT/FOR qualification> is optional. If there are NMATCH match variables and NCARRY carry variables, then there will be NMATCH + 2*NCARRY variables to the left of the "=" and 2*(NMATCH + NCARRY) to the right of the "=". on two variables.
SET MERGE CARRY VARIABLES 1 LET INST SRC ZP1 ZP2 = MERGE INST1 SRC1 P1 INST2 SRC2 P2 LET INST SRC ZP1 ZP2 = MERGE INST1 SRC1 P1 INST2 SRC2 P2 ... SUBSET INST1 > 2
DIMENSION 100 COLUMNS . READ DATA SET 1  2 GROUP VARIABLES, A BINOMIAL PROPORTION AND . A CORREPSONDING SAMPLE SIZE READ INST1 SRC1 P1 N1 1 1 0.81 40 1 2 0.92 40 1 3 0.62 50 2 1 0.45 25 2 2 0.98 25 2 3 0.74 25 END OF DATA . READ DATA SET 2  2 GROUP VARIABLES, A BINOMIAL PROPORTION AND . A CORREPSONDING SAMPLE SIZE READ INST2 SRC2 P2 N2 1 2 0.40 20 2 2 0.32 20 1 1 0.29 30 2 1 0.18 30 1 3 0.81 40 2 3 0.66 40 END OF DATA . NOW CREATE A MERGED DATA SET AND PERFORM A DIFFERENCE OF PROPORTIONS . HYPOTHSES TEST SET MERGE MATCH VARIABLES 2 SET MERGE CARRY VARIABLES 2 LET INST SRC X1 ZN1 X2 ZN2 = MERGE INST1 SRC1 P1 N1 INST2 SRC2 P2 N2 LET ALPHA = 0.05 FEEDBACK OFF SET WRITE FORMAT 2F5.0,2(F7.2,F5.0) PRINT INST SRC X1 ZN1 X2 ZN2 LET PVAL = DIFFERENCE OF PROPORTION HYPOTHESIS TEST X1 ZN1 X2 ZN2 ALPHA SET WRITE FORMAT SET WRITE DECIMALS 3 PRINT PVALThe following output is generated. 1. 1. 0.81 40. 0.29 30. 1. 2. 0.92 40. 0.40 20. 1. 3. 0.62 50. 0.81 40. 2. 1. 0.45 25. 0.18 30. 2. 2. 0.98 25. 0.32 20. 2. 3. 0.74 25. 0.66 40. VARIABLESPVAL 0.000 0.000 0.051 0.028 0.000 0.497
Date created: 1/21/2009 