Help using Base SAS procedures

Resid error in Multiple regression syntax. Having trouble identifying error in syntax please help.

Accepted Solution Solved
Reply
Contributor
Posts: 46
Accepted Solution

Resid error in Multiple regression syntax. Having trouble identifying error in syntax please help.

senario: 

The researcher was interested in determining if the energy conservation practices of college students could be predicted from their participation in a training program, consumer attitudes, and gender. The following data were collected from a random sample of 30 students:

 

 

Title Predicting energy conservation practices from training programs, consumer attitudes, and gender;
data Predicting energy conservation;
input energyconservationscale trainingprograms studentattitudesscale gender;
cards;

50 No 30 male
50 Yes 46 Female
30 No 45 male
38 Yes 36 Female
41 No 30 male
15 Yes 15 Female
20 No 38 male
15 Yes 50 Female
45 No 37 male
25 Yes 37 Female
45 No 47 male
50 Yes 29 Female
22 No 36 male
48 Yes 36 Female
40 No 37 male
30 Yes 14 Female
38 No 48 male
12 Yes 38 Female
12 No 18 male
15 Yes 25 Female
10 No 36 male
45 Yes 29 Female
24 No 26 male
34 Yes 27 Female
49 No 25 male
28 Yes 50 Female
25 No 26 male
10 Yes 38 Female
10 No 10 male
50 Yes 30 male
;
proc corr;
var energyconservationscale = trainingprograms studentattitudesscale gender;
proc reg;
model energyconservationscale= trainingprograms studentattitudesscale gender /stb scorr2 p r vif;
plot residual. * predicted.;
output out=res residual=resid predicted=pred;
proc univariate plot;
var resid;
run;

 

Errors shown in log

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


46 Title Predicting energy conservation practices from training programs, consumer attitudes,
46 ! and gender;
47 data Predicting energy conservation;
48 input energyconservation trainingprograms studentattitudes gender;
49 cards;

NOTE: Invalid data for trainingprograms in line 51 5-6.
NOTE: Invalid data for gender in line 51 13-16.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
51 50 No 30 male
energyconservation=50 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=1
NOTE: Invalid data for trainingprograms in line 52 5-7.
NOTE: Invalid data for gender in line 52 13-18.
52 50 Yes 46 Female
energyconservation=50 trainingprograms=. studentattitudes=46 gender=. _ERROR_=1 _N_=2
NOTE: Invalid data for trainingprograms in line 53 5-6.
NOTE: Invalid data for gender in line 53 13-16.
53 30 No 45 male
energyconservation=30 trainingprograms=. studentattitudes=45 gender=. _ERROR_=1 _N_=3
NOTE: Invalid data for trainingprograms in line 54 5-7.
NOTE: Invalid data for gender in line 54 13-18.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
54 38 Yes 36 Female
energyconservation=38 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=4
NOTE: Invalid data for trainingprograms in line 55 5-6.
NOTE: Invalid data for gender in line 55 13-16.
55 41 No 30 male
energyconservation=41 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=5
NOTE: Invalid data for trainingprograms in line 56 5-7.
NOTE: Invalid data for gender in line 56 13-18.
56 15 Yes 15 Female
energyconservation=15 trainingprograms=. studentattitudes=15 gender=. _ERROR_=1 _N_=6
NOTE: Invalid data for trainingprograms in line 57 5-6.
NOTE: Invalid data for gender in line 57 13-16.
57 20 No 38 male
energyconservation=20 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=7
NOTE: Invalid data for trainingprograms in line 58 5-7.
NOTE: Invalid data for gender in line 58 13-18.
58 15 Yes 50 Female
energyconservation=15 trainingprograms=. studentattitudes=50 gender=. _ERROR_=1 _N_=8
NOTE: Invalid data for trainingprograms in line 59 5-6.
NOTE: Invalid data for gender in line 59 13-16.
59 45 No 37 male
energyconservation=45 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=9
NOTE: Invalid data for trainingprograms in line 60 5-7.
NOTE: Invalid data for gender in line 60 13-18.
60 25 Yes 37 Female
energyconservation=25 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=10
NOTE: Invalid data for trainingprograms in line 61 5-6.
NOTE: Invalid data for gender in line 61 13-16.
61 45 No 47 male
energyconservation=45 trainingprograms=. studentattitudes=47 gender=. _ERROR_=1 _N_=11
NOTE: Invalid data for trainingprograms in line 62 5-7.
NOTE: Invalid data for gender in line 62 13-18.
62 50 Yes 29 Female
energyconservation=50 trainingprograms=. studentattitudes=29 gender=. _ERROR_=1 _N_=12
NOTE: Invalid data for trainingprograms in line 63 5-6.
NOTE: Invalid data for gender in line 63 13-16.
63 22 No 36 male
energyconservation=22 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=13
NOTE: Invalid data for trainingprograms in line 64 5-7.
NOTE: Invalid data for gender in line 64 13-18.
64 48 Yes 36 Female
energyconservation=48 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=14
NOTE: Invalid data for trainingprograms in line 65 5-6.
NOTE: Invalid data for gender in line 65 13-16.
65 40 No 37 male
energyconservation=40 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=15
NOTE: Invalid data for trainingprograms in line 66 5-7.
NOTE: Invalid data for gender in line 66 13-18.
66 30 Yes 14 Female
energyconservation=30 trainingprograms=. studentattitudes=14 gender=. _ERROR_=1 _N_=16
NOTE: Invalid data for trainingprograms in line 67 5-6.
NOTE: Invalid data for gender in line 67 13-16.
67 38 No 48 male
energyconservation=38 trainingprograms=. studentattitudes=48 gender=. _ERROR_=1 _N_=17
NOTE: Invalid data for trainingprograms in line 68 5-7.
NOTE: Invalid data for gender in line 68 13-18.
68 12 Yes 38 Female
energyconservation=12 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=18
NOTE: Invalid data for trainingprograms in line 69 5-6.
NOTE: Invalid data for gender in line 69 13-16.
69 12 No 18 male
energyconservation=12 trainingprograms=. studentattitudes=18 gender=. _ERROR_=1 _N_=19
NOTE: Invalid data for trainingprograms in line 70 5-7.
NOTE: Invalid data for gender in line 70 13-18.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
70 15 Yes 25 Female
energyconservation=15 trainingprograms=. studentattitudes=25 gender=. _ERROR_=1 _N_=20
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.PREDICTING has 30 observations and 4 variables.
NOTE: The data set WORK.ENERGY has 30 observations and 4 variables.
NOTE: The data set WORK.CONSERVATION has 30 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.09 seconds
cpu time 0.07 seconds


81 ;
82 proc corr;
83 var energyconserving = trainingprograms studentattitudes gender;
-
22
200
ERROR: Variable ENERGYCONSERVING not found.

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_.

ERROR 200-322: The symbol is not recognized and will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CORR used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

84 proc reg;
85 model energyconserving trainingprograms studentattitudes gender /stb scorr2 p r vif;
-
73
ERROR: Variable ENERGYCONSERVING not found.
NOTE: The previous statement has been deleted.
ERROR 73-322: Expecting an =.
86 plot residual. * predicted.;
87 output out=res residual=resid predicted=pred;

WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: The data set WORK.RES has 0 observations and 0 variables.
WARNING: Data set WORK.RES was not replaced because new file is incomplete.
NOTE: PROCEDURE REG used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds


88 proc univariate plot;
89 var resid;
ERROR: Variable RESID not found.
90 run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


91 Title Predicting energy conservation practices from training programs, consumer attitudes,
91 ! and gender;
92 data Predicting energy conservation;
93 input energyconservation trainingprograms studentattitudes gender;
94 cards;

NOTE: Invalid data for trainingprograms in line 96 5-6.
NOTE: Invalid data for gender in line 96 13-16.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
96 50 No 30 male
energyconservation=50 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=1
NOTE: Invalid data for trainingprograms in line 97 5-7.
NOTE: Invalid data for gender in line 97 13-18.
97 50 Yes 46 Female
energyconservation=50 trainingprograms=. studentattitudes=46 gender=. _ERROR_=1 _N_=2
NOTE: Invalid data for trainingprograms in line 98 5-6.
NOTE: Invalid data for gender in line 98 13-16.
98 30 No 45 male
energyconservation=30 trainingprograms=. studentattitudes=45 gender=. _ERROR_=1 _N_=3
NOTE: Invalid data for trainingprograms in line 99 5-7.
NOTE: Invalid data for gender in line 99 13-18.
99 38 Yes 36 Female
energyconservation=38 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=4
NOTE: Invalid data for trainingprograms in line 100 5-6.
NOTE: Invalid data for gender in line 100 13-16.
100 41 No 30 male
energyconservation=41 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=5
NOTE: Invalid data for trainingprograms in line 101 5-7.
NOTE: Invalid data for gender in line 101 13-18.
101 15 Yes 15 Female
energyconservation=15 trainingprograms=. studentattitudes=15 gender=. _ERROR_=1 _N_=6
NOTE: Invalid data for trainingprograms in line 102 5-6.
NOTE: Invalid data for gender in line 102 13-16.
102 20 No 38 male
energyconservation=20 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=7
NOTE: Invalid data for trainingprograms in line 103 5-7.
NOTE: Invalid data for gender in line 103 13-18.
103 15 Yes 50 Female
energyconservation=15 trainingprograms=. studentattitudes=50 gender=. _ERROR_=1 _N_=8
NOTE: Invalid data for trainingprograms in line 104 5-6.
NOTE: Invalid data for gender in line 104 13-16.
104 45 No 37 male
energyconservation=45 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=9
NOTE: Invalid data for trainingprograms in line 105 5-7.
NOTE: Invalid data for gender in line 105 13-18.
105 25 Yes 37 Female
energyconservation=25 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=10
NOTE: Invalid data for trainingprograms in line 106 5-6.
NOTE: Invalid data for gender in line 106 13-16.
106 45 No 47 male
energyconservation=45 trainingprograms=. studentattitudes=47 gender=. _ERROR_=1 _N_=11
NOTE: Invalid data for trainingprograms in line 107 5-7.
NOTE: Invalid data for gender in line 107 13-18.
107 50 Yes 29 Female
energyconservation=50 trainingprograms=. studentattitudes=29 gender=. _ERROR_=1 _N_=12
NOTE: Invalid data for trainingprograms in line 108 5-6.
NOTE: Invalid data for gender in line 108 13-16.
108 22 No 36 male
energyconservation=22 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=13
NOTE: Invalid data for trainingprograms in line 109 5-7.
NOTE: Invalid data for gender in line 109 13-18.
109 48 Yes 36 Female
energyconservation=48 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=14
NOTE: Invalid data for trainingprograms in line 110 5-6.
NOTE: Invalid data for gender in line 110 13-16.
110 40 No 37 male
energyconservation=40 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=15
NOTE: Invalid data for trainingprograms in line 111 5-7.
NOTE: Invalid data for gender in line 111 13-18.
111 30 Yes 14 Female
energyconservation=30 trainingprograms=. studentattitudes=14 gender=. _ERROR_=1 _N_=16
NOTE: Invalid data for trainingprograms in line 112 5-6.
NOTE: Invalid data for gender in line 112 13-16.
112 38 No 48 male
energyconservation=38 trainingprograms=. studentattitudes=48 gender=. _ERROR_=1 _N_=17
NOTE: Invalid data for trainingprograms in line 113 5-7.
NOTE: Invalid data for gender in line 113 13-18.
113 12 Yes 38 Female
energyconservation=12 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=18
NOTE: Invalid data for trainingprograms in line 114 5-6.
NOTE: Invalid data for gender in line 114 13-16.
114 12 No 18 male
energyconservation=12 trainingprograms=. studentattitudes=18 gender=. _ERROR_=1 _N_=19
NOTE: Invalid data for trainingprograms in line 115 5-7.
NOTE: Invalid data for gender in line 115 13-18.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
115 15 Yes 25 Female
energyconservation=15 trainingprograms=. studentattitudes=25 gender=. _ERROR_=1 _N_=20
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.PREDICTING has 30 observations and 4 variables.
NOTE: The data set WORK.ENERGY has 30 observations and 4 variables.
NOTE: The data set WORK.CONSERVATION has 30 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.08 seconds
cpu time 0.07 seconds


126 ;
127 proc corr;
128 var energyconservation = trainingprograms studentattitudes gender;
-
22
200

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_.

ERROR 200-322: The symbol is not recognized and will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CORR used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

 

129 proc reg;
130 model energyconservation trainingprograms studentattitudes gender /stb scorr2 p r vif;
-
73
NOTE: The previous statement has been deleted.
ERROR 73-322: Expecting an =.
131 plot residual. * predicted.;
132 output out=res residual=resid predicted=pred;

WARNING: No variables specified for an SSCP matrix. Execution terminating.
NOTE: The data set WORK.RES has 0 observations and 0 variables.
WARNING: Data set WORK.RES was not replaced because new file is incomplete.
NOTE: PROCEDURE REG used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds


133 proc univariate plot;
134 var resid;
ERROR: Variable RESID not found.
135 run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


136 Title Predicting energy conservation practices from training programs, consumer attitudes,
136! and gender;
137 data Predicting energy conservation;
138 input energyconservation trainingprograms studentattitudes gender;
139 cards;

NOTE: Invalid data for trainingprograms in line 141 5-6.
NOTE: Invalid data for gender in line 141 13-16.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
141 50 No 30 male
energyconservation=50 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=1
NOTE: Invalid data for trainingprograms in line 142 5-7.
NOTE: Invalid data for gender in line 142 13-18.
142 50 Yes 46 Female
energyconservation=50 trainingprograms=. studentattitudes=46 gender=. _ERROR_=1 _N_=2
NOTE: Invalid data for trainingprograms in line 143 5-6.
NOTE: Invalid data for gender in line 143 13-16.
143 30 No 45 male
energyconservation=30 trainingprograms=. studentattitudes=45 gender=. _ERROR_=1 _N_=3
NOTE: Invalid data for trainingprograms in line 144 5-7.
NOTE: Invalid data for gender in line 144 13-18.
144 38 Yes 36 Female
energyconservation=38 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=4
NOTE: Invalid data for trainingprograms in line 145 5-6.
NOTE: Invalid data for gender in line 145 13-16.
145 41 No 30 male
energyconservation=41 trainingprograms=. studentattitudes=30 gender=. _ERROR_=1 _N_=5
NOTE: Invalid data for trainingprograms in line 146 5-7.
NOTE: Invalid data for gender in line 146 13-18.
146 15 Yes 15 Female
energyconservation=15 trainingprograms=. studentattitudes=15 gender=. _ERROR_=1 _N_=6
NOTE: Invalid data for trainingprograms in line 147 5-6.
NOTE: Invalid data for gender in line 147 13-16.
147 20 No 38 male
energyconservation=20 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=7
NOTE: Invalid data for trainingprograms in line 148 5-7.
NOTE: Invalid data for gender in line 148 13-18.
148 15 Yes 50 Female
energyconservation=15 trainingprograms=. studentattitudes=50 gender=. _ERROR_=1 _N_=8
NOTE: Invalid data for trainingprograms in line 149 5-6.
NOTE: Invalid data for gender in line 149 13-16.
149 45 No 37 male
energyconservation=45 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=9
NOTE: Invalid data for trainingprograms in line 150 5-7.
NOTE: Invalid data for gender in line 150 13-18.
150 25 Yes 37 Female
energyconservation=25 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=10
NOTE: Invalid data for trainingprograms in line 151 5-6.
NOTE: Invalid data for gender in line 151 13-16.
151 45 No 47 male
energyconservation=45 trainingprograms=. studentattitudes=47 gender=. _ERROR_=1 _N_=11
NOTE: Invalid data for trainingprograms in line 152 5-7.
NOTE: Invalid data for gender in line 152 13-18.
152 50 Yes 29 Female
energyconservation=50 trainingprograms=. studentattitudes=29 gender=. _ERROR_=1 _N_=12
NOTE: Invalid data for trainingprograms in line 153 5-6.
NOTE: Invalid data for gender in line 153 13-16.
153 22 No 36 male
energyconservation=22 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=13
NOTE: Invalid data for trainingprograms in line 154 5-7.
NOTE: Invalid data for gender in line 154 13-18.
154 48 Yes 36 Female
energyconservation=48 trainingprograms=. studentattitudes=36 gender=. _ERROR_=1 _N_=14
NOTE: Invalid data for trainingprograms in line 155 5-6.
NOTE: Invalid data for gender in line 155 13-16.
155 40 No 37 male
energyconservation=40 trainingprograms=. studentattitudes=37 gender=. _ERROR_=1 _N_=15
NOTE: Invalid data for trainingprograms in line 156 5-7.
NOTE: Invalid data for gender in line 156 13-18.
156 30 Yes 14 Female
energyconservation=30 trainingprograms=. studentattitudes=14 gender=. _ERROR_=1 _N_=16
NOTE: Invalid data for trainingprograms in line 157 5-6.
NOTE: Invalid data for gender in line 157 13-16.
157 38 No 48 male
energyconservation=38 trainingprograms=. studentattitudes=48 gender=. _ERROR_=1 _N_=17
NOTE: Invalid data for trainingprograms in line 158 5-7.
NOTE: Invalid data for gender in line 158 13-18.
158 12 Yes 38 Female
energyconservation=12 trainingprograms=. studentattitudes=38 gender=. _ERROR_=1 _N_=18
NOTE: Invalid data for trainingprograms in line 159 5-6.
NOTE: Invalid data for gender in line 159 13-16.
159 12 No 18 male
energyconservation=12 trainingprograms=. studentattitudes=18 gender=. _ERROR_=1 _N_=19
NOTE: Invalid data for trainingprograms in line 160 5-7.
NOTE: Invalid data for gender in line 160 13-18.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
160 15 Yes 25 Female
energyconservation=15 trainingprograms=. studentattitudes=25 gender=. _ERROR_=1 _N_=20
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.PREDICTING has 30 observations and 4 variables.
NOTE: The data set WORK.ENERGY has 30 observations and 4 variables.
NOTE: The data set WORK.CONSERVATION has 30 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.06 seconds


171 ;
172 proc corr;
173 var energyconservation = trainingprograms studentattitudes gender;
-
22
200

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_.

ERROR 200-322: The symbol is not recognized and will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CORR used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

 

174 proc reg;
175 model energyconservation= trainingprograms studentattitudes gender /stb scorr2 p r vif;
176 plot residual. * predicted.;
177 output out=res residual=resid predicted=pred;

ERROR: No valid observations are found.
NOTE: No plot is printed because there is no observation with positive weight.
NOTE: The data set WORK.RES has 30 observations and 6 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 0.59 seconds
cpu time 0.04 seconds


178 proc univariate plot;
179 var resid;
180 run;

NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds


181 Title Predicting energy conservation practices from training programs, consumer attitudes,
181! and gender;
182 data Predicting energy conservation;
183 input energyconservationscale trainingprograms studentattitudesscale gender;
184 cards;

NOTE: Invalid data for trainingprograms in line 186 5-6.
NOTE: Invalid data for gender in line 186 13-16.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
186 50 No 30 male
energyconservationscale=50 trainingprograms=. studentattitudesscale=30 gender=. _ERROR_=1 _N_=1
NOTE: Invalid data for trainingprograms in line 187 5-7.
NOTE: Invalid data for gender in line 187 13-18.
187 50 Yes 46 Female
energyconservationscale=50 trainingprograms=. studentattitudesscale=46 gender=. _ERROR_=1 _N_=2
NOTE: Invalid data for trainingprograms in line 188 5-6.
NOTE: Invalid data for gender in line 188 13-16.
188 30 No 45 male
energyconservationscale=30 trainingprograms=. studentattitudesscale=45 gender=. _ERROR_=1 _N_=3
NOTE: Invalid data for trainingprograms in line 189 5-7.
NOTE: Invalid data for gender in line 189 13-18.
189 38 Yes 36 Female
energyconservationscale=38 trainingprograms=. studentattitudesscale=36 gender=. _ERROR_=1 _N_=4
NOTE: Invalid data for trainingprograms in line 190 5-6.
NOTE: Invalid data for gender in line 190 13-16.
190 41 No 30 male
energyconservationscale=41 trainingprograms=. studentattitudesscale=30 gender=. _ERROR_=1 _N_=5
NOTE: Invalid data for trainingprograms in line 191 5-7.
NOTE: Invalid data for gender in line 191 13-18.
191 15 Yes 15 Female
energyconservationscale=15 trainingprograms=. studentattitudesscale=15 gender=. _ERROR_=1 _N_=6
NOTE: Invalid data for trainingprograms in line 192 5-6.
NOTE: Invalid data for gender in line 192 13-16.
192 20 No 38 male
energyconservationscale=20 trainingprograms=. studentattitudesscale=38 gender=. _ERROR_=1 _N_=7
NOTE: Invalid data for trainingprograms in line 193 5-7.
NOTE: Invalid data for gender in line 193 13-18.
193 15 Yes 50 Female
energyconservationscale=15 trainingprograms=. studentattitudesscale=50 gender=. _ERROR_=1 _N_=8
NOTE: Invalid data for trainingprograms in line 194 5-6.
NOTE: Invalid data for gender in line 194 13-16.
194 45 No 37 male
energyconservationscale=45 trainingprograms=. studentattitudesscale=37 gender=. _ERROR_=1 _N_=9
NOTE: Invalid data for trainingprograms in line 195 5-7.
NOTE: Invalid data for gender in line 195 13-18.
195 25 Yes 37 Female
energyconservationscale=25 trainingprograms=. studentattitudesscale=37 gender=. _ERROR_=1 _N_=10
NOTE: Invalid data for trainingprograms in line 196 5-6.
NOTE: Invalid data for gender in line 196 13-16.
196 45 No 47 male
energyconservationscale=45 trainingprograms=. studentattitudesscale=47 gender=. _ERROR_=1 _N_=11
NOTE: Invalid data for trainingprograms in line 197 5-7.
NOTE: Invalid data for gender in line 197 13-18.
197 50 Yes 29 Female
energyconservationscale=50 trainingprograms=. studentattitudesscale=29 gender=. _ERROR_=1 _N_=12
NOTE: Invalid data for trainingprograms in line 198 5-6.
NOTE: Invalid data for gender in line 198 13-16.
198 22 No 36 male
energyconservationscale=22 trainingprograms=. studentattitudesscale=36 gender=. _ERROR_=1 _N_=13
NOTE: Invalid data for trainingprograms in line 199 5-7.
NOTE: Invalid data for gender in line 199 13-18.
199 48 Yes 36 Female
energyconservationscale=48 trainingprograms=. studentattitudesscale=36 gender=. _ERROR_=1 _N_=14
NOTE: Invalid data for trainingprograms in line 200 5-6.
NOTE: Invalid data for gender in line 200 13-16.
200 40 No 37 male
energyconservationscale=40 trainingprograms=. studentattitudesscale=37 gender=. _ERROR_=1 _N_=15
NOTE: Invalid data for trainingprograms in line 201 5-7.
NOTE: Invalid data for gender in line 201 13-18.
201 30 Yes 14 Female
energyconservationscale=30 trainingprograms=. studentattitudesscale=14 gender=. _ERROR_=1 _N_=16
NOTE: Invalid data for trainingprograms in line 202 5-6.
NOTE: Invalid data for gender in line 202 13-16.
202 38 No 48 male
energyconservationscale=38 trainingprograms=. studentattitudesscale=48 gender=. _ERROR_=1 _N_=17
NOTE: Invalid data for trainingprograms in line 203 5-7.
NOTE: Invalid data for gender in line 203 13-18.
203 12 Yes 38 Female
energyconservationscale=12 trainingprograms=. studentattitudesscale=38 gender=. _ERROR_=1 _N_=18
NOTE: Invalid data for trainingprograms in line 204 5-6.
NOTE: Invalid data for gender in line 204 13-16.
204 12 No 18 male
energyconservationscale=12 trainingprograms=. studentattitudesscale=18 gender=. _ERROR_=1 _N_=19
NOTE: Invalid data for trainingprograms in line 205 5-7.
NOTE: Invalid data for gender in line 205 13-18.
WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.
205 15 Yes 25 Female
energyconservationscale=15 trainingprograms=. studentattitudesscale=25 gender=. _ERROR_=1 _N_=20
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.PREDICTING has 30 observations and 4 variables.
NOTE: The data set WORK.ENERGY has 30 observations and 4 variables.
NOTE: The data set WORK.CONSERVATION has 30 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.05 seconds
cpu time 0.04 seconds


216 ;
217 proc corr;
218 var energyconservationscale = trainingprograms studentattitudesscale gender;
-
22
200

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_.

ERROR 200-322: The symbol is not recognized and will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CORR used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

219 proc reg;
220 model energyconservationscale= trainingprograms studentattitudesscale gender /stb scorr2 p r
220! vif;
221 plot residual. * predicted.;
222 output out=res residual=resid predicted=pred;

ERROR: No valid observations are found.
NOTE: No plot is printed because there is no observation with positive weight.
NOTE: The data set WORK.RES has 30 observations and 6 variables.
NOTE: PROCEDURE REG used (Total process time):
real time 5.28 seconds
cpu time 0.06 seconds


223 proc univariate plot;
224 var resid;
225 run;

NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds

 


Accepted Solutions
Solution
‎04-17-2016 09:26 PM
Respected Advisor
Posts: 4,920

Re: Resid error in Multiple regression syntax. Having trouble identifying error in syntax please hel

Proper syntax and options would be:

 

data PEC;
input energyconservationscale trainingprograms :$3. studentattitudesscale gender :$6.;
datalines;
50 No 30 male
50 Yes 46 Female
30 No 45 male
38 Yes 36 Female
41 No 30 male
15 Yes 15 Female
20 No 38 male
15 Yes 50 Female
45 No 37 male
25 Yes 37 Female
45 No 47 male
50 Yes 29 Female
22 No 36 male
48 Yes 36 Female
40 No 37 male
30 Yes 14 Female
38 No 48 male
12 Yes 38 Female
12 No 18 male
15 Yes 25 Female
10 No 36 male
45 Yes 29 Female
24 No 26 male
34 Yes 27 Female
49 No 25 male
28 Yes 50 Female
25 No 26 male
10 Yes 38 Female
10 No 10 male
50 Yes 30 male
;

proc glm data=PEC;
class trainingPrograms gender;
model energyconservationscale= trainingprograms studentattitudesscale gender;
output out=PECres residual=resid predicted=pred;
run;

proc univariate data=PECres normal;
var resid;
run;
PG

View solution in original post


All Replies
Super User
Posts: 19,791

Re: Resid error in Multiple regression syntax. Having trouble identifying error in syntax please hel

Same idea as before. Do it one step at a time. 

 

Fix your data import step first. 

Solution
‎04-17-2016 09:26 PM
Respected Advisor
Posts: 4,920

Re: Resid error in Multiple regression syntax. Having trouble identifying error in syntax please hel

Proper syntax and options would be:

 

data PEC;
input energyconservationscale trainingprograms :$3. studentattitudesscale gender :$6.;
datalines;
50 No 30 male
50 Yes 46 Female
30 No 45 male
38 Yes 36 Female
41 No 30 male
15 Yes 15 Female
20 No 38 male
15 Yes 50 Female
45 No 37 male
25 Yes 37 Female
45 No 47 male
50 Yes 29 Female
22 No 36 male
48 Yes 36 Female
40 No 37 male
30 Yes 14 Female
38 No 48 male
12 Yes 38 Female
12 No 18 male
15 Yes 25 Female
10 No 36 male
45 Yes 29 Female
24 No 26 male
34 Yes 27 Female
49 No 25 male
28 Yes 50 Female
25 No 26 male
10 Yes 38 Female
10 No 10 male
50 Yes 30 male
;

proc glm data=PEC;
class trainingPrograms gender;
model energyconservationscale= trainingprograms studentattitudesscale gender;
output out=PECres residual=resid predicted=pred;
run;

proc univariate data=PECres normal;
var resid;
run;
PG
Contributor
Posts: 46

Re: Resid error in Multiple regression syntax. Having trouble identifying error in syntax please hel

Thank you very much for your help PG Stats. It worked!!

 

Josie

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 393 views
  • 0 likes
  • 3 in conversation