1. This is dataplot macro     extract_center_points.dp     9/25/18 => 10/16/18
2. Purpose: Determine if center points exist in the user's (original) dataset.
3. Method:  Compute the median of the distinct values for each factor,
4.          and then tag those data rows which have that median distinct value.
5.          (This will automatically include any datasets with an odd number of distinct
6.          values, and exclude any datasets with an even number of distinct values.)
7.          If any of the data rows are tagged, then extract
8.          the response values for this center point.
9. Date: 9/25/18 => 10/16/18
10. Input: k, y, x1 to xk
11. Output: ycent, ncent
12.
13. -----start point-----
14. echo on
15. feedback off
16let bugswecp = 0
17. let pausesw = 1
18.
19if bugswecp = 1; print " "; print "--At beginning of    extract_center_points.dp"
20   . echo on
21   . feedback on
22   print "k = ^k"
23   print y x1 to x^k
24   if pausesw = 1; pause; end if
25end if
26.
27. -----Step 1: Tag those data rows that have center points (if any)-----
28.
29if bugswecp = 1; print "At (extract_center_points.dp, step 1): tag cp rows"
30   if pausesw = 1; pause; end if
31end if
32.
33delete stall; let stall = string combine x1 to x^k
34delete tagcent; let tagcent = dex check center points ^stall
35let ncent = size tagcent subset tagcent 0
36.
37if bugswecp = 1
38   print "At the end of step 1 of    extract_center_points.dp"
39   print tagcent
40   print "ncent = ^ncent"
41   if pausesw = 1; pause; end if
42end if
43.
44. -----Step 2: If any, extract the center point responses-----
45.
46if bugswecp = 1; print "At (extract_center_points.dp, step 2): extr cp y's
47   if pausesw = 1; pause; end if
48end if
49.
50let ycent = y
51.
52if ncent > 0
53   retain ycent subset tagcent = 0
54else
55   delete ycent
56end if
57.
58. -----Step 99: Finish up-----
59.
60if bugswecp = 1; print " "; print "---At end of dexcp.dp . . ."
61   print ncent ycent
62   if pausesw = 1; pause; end if
63end if
64.
65