|
GTName:
LET Y = Y1 SUBSET Y1 >= Y2 LET Y = Y1 SUBSET Y1 < Y2 LET Y = Y1 SUBSET Y1 <= Y2 LET Y = Y1 SUBSET Y1 = Y2 LET Y = Y1 SUBSET Y1 <> Y2 where Y1 and Y2 are both variables. This command is most typically used to create a tag variable that can be used on subsequent SUBSET clauses. For example, suppose that Y1 and Y2 are two previously created variables and we want to sum the values of Y1 that are greater than the corresponding rows of Y2.
LET Y1SUM = SUM Y1 SUBSET TAG = 1
where <y1> is a variable or a parameter; <y2> is a variable or a parameter; <tag> is a variable or a parameter (depending on what <y1> and <y2> are) where the computed values are stored; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET A = GT(3,2)
SKIP 25 READ NATR332.DAT Y1 Y2 LET TAG = GT(Y1,Y2) LET NGT = SUM TAG SUBSET TAG = 1 LET TAG = LT(Y1,Y2) LET NLT = SUM TAG SUBSET TAG = 1 LET TAG = EQ(Y1,Y2) LET NEQ = SUM TAG SUBSET TAG = 1 PRINT "Number of rows where Y1 > Y2: ^NGT" PRINT "Number of rows where Y1 < Y2: ^NLT" PRINT "Number of rows where Y1 = Y2: ^NEQ"The following output is generated. Number of rows where Y1 > Y2: 3 Number of rows where Y1 < Y2: 4 Number of rows where Y1 = Y2: 3
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 06/28/2021 |