
SEQUENTIAL DIFFERENCEName:
Y(1) = X(2)  X(1) Y(2) = X(3)  X(2) ... Y(N1) = X(N)  X(N1) If there are less than two points in the series, nothing will be done. One use of sequential differencing is to remove trend from time series data. The 2016/02 version of Dataplot generalized this command in the following two ways.
where <x> is the response variable; <stat> is one of
SUM PRODUCT MEAN MINIMUM MAXIMUM LOWER UPPER; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
<SUBSET/EXCEPT/FOR qualification> where <y> is the response variable; <x> is a the groupid variable; <stat> is one of
SUM PRODUCT MEAN MINIMUM MAXIMUM LOWER UPPER; <x2> is a variable containing the groupid of the differenced series; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET XD = SEQUENTIAL MEAN PRESSURE LET XD = SEQUENTIAL SUM PRESSURE LET XD = SEQUENTIAL DIFFERENCE PRESSURE SUBSET X > 4 LET YDIFF X2 = SEQUENTIAL DIFFERENCE Y X
SEQUENTIAL AVERAGE is a synonym for SEQUENTIAL MEAN SEQUENTIAL MIN is a synonym for SEQUENTIAL MINIMUM SEQUENTIAL MAX is a synonym for SEQUENTIAL MAXIMUM
2016/02: Support for SUM, PRODUCT, MEAN 2016/02: Support for MINIMUM, MAXIMUM, LOWER, and UPPER 2016/02: Support for groupid variable< LET X1 = DATA 12 4 2 3 9 7 LET XD = SEQUENTIAL DIFFERENCE X1The variable XD will contain the following values:
. Step 1: Define the data . let y = sequence 1 1 10 . . Step 2: Compute the sequential statistics . let ydiff = sequential difference y let ysum = sequential sum y let yprod = sequential product y let ymean = sequential mean y let ymin = sequential min y let ymax = sequential max y . . Step 3: Print the results . set write decimals 1 print y ydiff ysum yprod ymean ymin ymaxThe following output is generated.  Y YDIFF YSUM YPROD  1.0 1.0 3.0 2.0 2.0 1.0 5.0 6.0 3.0 1.0 7.0 12.0 4.0 1.0 9.0 20.0 5.0 1.0 11.0 30.0 6.0 1.0 13.0 42.0 7.0 1.0 15.0 56.0 8.0 1.0 17.0 72.0 9.0 1.0 19.0 90.0 10.0 0.0 0.0 0.0  Y YMEAN YMIN YMAX  1.0 1.5 1.0 2.0 2.0 2.5 2.0 3.0 3.0 3.5 3.0 4.0 4.0 4.5 4.0 5.0 5.0 5.5 5.0 6.0 6.0 6.5 6.0 7.0 7.0 7.5 7.0 8.0 8.0 8.5 8.0 9.0 9.0 9.5 9.0 10.0 10.0 0.0 0.0 0.0Program 3: . Step 1: Define the data . dimension 40 columns let y = sequence 1 1 10 let x = sequence 1 5 1 2 . . Step 2: Compute the sequential statistics . let ydiff ygroup = sequential difference y x let ysum ygroup = sequential sum y x let yprod ygroup = sequential product y x let ymean ygroup = sequential mean y x let ymin ygroup = sequential min y x let ymax ygroup = sequential max y x let ylow ygroup = sequential lower y x let yupp ygroup = sequential upper y x . . Step 3: Print the results . set write decimals 1 print ygroup ydiff ysum yprod ymean ymin ymax ylow yuppThe following output is generated.  YGROUP YDIFF YSUM YPROD YMEAN  1.0 1.0 3.0 2.0 1.5 1.0 1.0 5.0 6.0 2.5 1.0 1.0 7.0 12.0 3.5 1.0 1.0 9.0 20.0 4.5 2.0 1.0 13.0 42.0 6.5 2.0 1.0 15.0 56.0 7.5 2.0 1.0 17.0 72.0 8.5 2.0 1.0 19.0 90.0 9.5  YGROUP YMIN YMAX YLOW YUPP  1.0 1.0 2.0 1.0 2.0 1.0 2.0 3.0 2.0 3.0 1.0 3.0 4.0 3.0 4.0 1.0 4.0 5.0 4.0 5.0 2.0 6.0 7.0 6.0 7.0 2.0 7.0 8.0 7.0 8.0 2.0 8.0 9.0 8.0 9.0 2.0 9.0 10.0 9.0 10.0  
Privacy
Policy/Security Notice
NIST is an agency of the U.S. Commerce Department.
Date created: 02/26/2016 