1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 /* lynch.sas */
74
75 title 'Hovland and Sears Lynching data';
76
77 data lynch; /* Skipping the header */
78 infile '/home/u1407221/441s24/data/Lynch.data.txt' firstobs=6;
79 input year ayres cotton1 cotton2 Blynch Totlynch;
80 label ayres = 'Ayres'' composite economic index'
81 cotton1 = 'Per-acre value of cotton'
82 cotton2 = 'Farm value of cotton'
83 blynch = 'Black lynchings'
84 totlynch = 'Total lynchings';
85 olynch = totlynch-blynch;
86 label olynch = 'Non-Black lynchings';
87 /* Created differenced variables */
88 dc1 = cotton1 - lag(cotton1);
89 dc2 = cotton2 - lag(cotton2);
90 dbl = blynch - lag(blynch);
91
NOTE: The infile '/home/u1407221/441s24/data/Lynch.data.txt' is:
Filename=/home/u1407221/441s24/data/Lynch.data.txt,
Owner Name=u1407221,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=04Mar2024:14:43:24,
File Size (bytes)=3083
NOTE: 49 records were read from the infile '/home/u1407221/441s24/data/Lynch.data.txt'.
The minimum record length was 54.
The maximum record length was 55.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 88:20 1 at 89:20 1 at 90:19
NOTE: The data set WORK.LYNCH has 49 observations and 10 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 775.93k
OS Memory 33452.00k
Timestamp 03/05/2024 06:45:13 PM
Step Count 118 Switch Count 2
Page Faults 0
Page Reclaims 160
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
92 proc corr data=lynch;
93 var year cotton1 -- olynch;
94
NOTE: PROCEDURE CORR used (Total process time):
real time 0.07 seconds
user cpu time 0.08 seconds
system cpu time 0.00 seconds
memory 3520.59k
OS Memory 34220.00k
Timestamp 03/05/2024 06:45:14 PM
Step Count 119 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 24
95 proc reg data=lynch plots=none;
96 title2 'Naive regression';
97 model blynch = cotton1;
98
NOTE: PROCEDURE REG used (Total process time):
real time 0.03 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2696.40k
OS Memory 35780.00k
Timestamp 03/05/2024 06:45:14 PM
Step Count 120 Switch Count 2
Page Faults 0
Page Reclaims 274
Page Swaps 0
Voluntary Context Switches 18
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 56
99 proc reg data=lynch plots=none;
100 title2 'Naive regression, but request Durbin-Watson statistic';
101 model blynch = cotton1 cotton2 / dwprob;
102 output out=lynch2 residual=e;
103
NOTE: The data set WORK.LYNCH2 has 49 observations and 11 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 0.05 seconds
user cpu time 0.05 seconds
system cpu time 0.00 seconds
memory 2712.71k
OS Memory 36296.00k
Timestamp 03/05/2024 06:45:14 PM
Step Count 121 Switch Count 4
Page Faults 0
Page Reclaims 335
Page Swaps 0
Voluntary Context Switches 35
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 344
104 proc sgplot data=lynch2;
105 title2 'Residuals Against Time';
106 series X = year Y = e;
107
108 proc autoreg data=lynch;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.19 seconds
user cpu time 0.09 seconds
system cpu time 0.01 seconds
memory 20177.50k
OS Memory 51628.00k
Timestamp 03/05/2024 06:45:14 PM
Step Count 122 Switch Count 2
Page Faults 0
Page Reclaims 5100
Page Swaps 0
Voluntary Context Switches 278
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 872
NOTE: There were 49 observations read from the data set WORK.LYNCH2.
109 title2 'Naive model with TS plots using proc autoreg';
110 model blynch = cotton1 cotton2 / dwprob;
111
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a gradient contour.
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a surface plot.
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a bivariate histogram.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a gradient contour.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a surface plot.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a bivariate histogram.
NOTE: PROCEDURE AUTOREG used (Total process time):
real time 0.46 seconds
user cpu time 0.27 seconds
system cpu time 0.04 seconds
memory 14781.56k
OS Memory 65300.00k
Timestamp 03/05/2024 06:45:14 PM
Step Count 123 Switch Count 17
Page Faults 0
Page Reclaims 13123
Page Swaps 0
Voluntary Context Switches 714
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 1800
112 proc autoreg data=lynch;
113 title2 'First-order autoregressive model with proc autoreg';
114 model blynch = cotton1 cotton2 / nlag=1 method=ml dwprob;
115 both: test cotton1=cotton2=0;
116 /* The signs of the estimated autoregressive parameters are reversed!
117 Page 357 of the proc autoreg manual says "Note that in this
118 parameterization, the signs of the autoregressive parameters are
119 reversed from the parameterization documented in most of the literature."
120
121 White noise probabilities are something like p-values.
122 */
123
124 /* I don't think we need a higher order model, but let's try it and test. */
125
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a gradient contour.
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a surface plot.
NOTE: The graph in the RTF(WEB) destination will be rendered as an image due to the use of a bivariate histogram.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a gradient contour.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a surface plot.
NOTE: The graph in the PDF(WEB) destination will be rendered as an image due to the use of a bivariate histogram.
NOTE: PROCEDURE AUTOREG used (Total process time):
real time 0.65 seconds
user cpu time 0.38 seconds
system cpu time 0.04 seconds
memory 13586.43k
OS Memory 65812.00k
Timestamp 03/05/2024 06:45:15 PM
Step Count 124 Switch Count 17
Page Faults 0
Page Reclaims 12704
Page Swaps 0
Voluntary Context Switches 972
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 2512
126 proc autoreg data=lynch plots=none;
127 title2 'Sixth-order autoregressive model with cotton1 and cotton2';
128 model blynch = cotton1 cotton2 / nlag=6 method=ml;
129 both: test cotton1=cotton2=0;
130
NOTE: PROCEDURE AUTOREG used (Total process time):
real time 0.31 seconds
user cpu time 0.17 seconds
system cpu time 0.02 seconds
memory 4481.68k
OS Memory 57016.00k
Timestamp 03/05/2024 06:45:15 PM
Step Count 125 Switch Count 1
Page Faults 0
Page Reclaims 577
Page Swaps 0
Voluntary Context Switches 328
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 1544
131 proc autoreg data=lynch plots=none;
132 title2 'First-order autoregressive model with just cotton1';
133 model blynch = cotton1 / nlag=1 method=ml;
134
135 run;
NOTE: PROCEDURE AUTOREG used (Total process time):
real time 0.21 seconds
user cpu time 0.12 seconds
system cpu time 0.01 seconds
memory 4165.46k
OS Memory 57016.00k
Timestamp 03/05/2024 06:45:15 PM
Step Count 126 Switch Count 1
Page Faults 0
Page Reclaims 486
Page Swaps 0
Voluntary Context Switches 297
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 856
136 quit;
137
138
139 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
151