a
@kngu022 wrote:
Hi everyone;
I tried to make a prediction on data file. and the errors turns up like below. Can you please tell me what wrong is?
DATA add;
INPUT LogSalary YrMajor @@;YrMajor2=YrMajor*YrMajor;
CARDS;
. 10
. 20
;
RUN;
PROC PRINT DATA = add;
RUN;
DATA BOTH;
SET A2(WHERE=(name^="ROSE,PETE")) add;
RUN;
PROC REG DATA=BOTH;
MODEL LogSalary = YrMajor YrMajor2/CLB;
OUTPUT OUT=resid R=resid P=pred LCL=lcl UCL=ucl;
RUN;
QUIT;
PROC PRINT DATA=resid;
Var Salary YrMajor YrMajor2 pred lcl ucl;
WHERE Salary = .;
RUN;
86 PROC REG DATA=BOTH;
87 MODEL LogSalary = YrMajor YrMajor2/CLB;
88 OUTPUT OUT=resid R=resid P=pred LCL=lcl UCL=ucl;
89 RUN;
ERROR: No valid observations are found.
90 QUIT;
The DATA BOTH step tells SAS to read in all the qualifying observations from A2, followed by the two observations from ADD, resulting in N(A2) + N(ADD) observations. We can see in your program that ADD only has missing values for LOGSALARY. Apparently the observations originating in A2 have the same problem, since the PROC REG reports "No valid observations.", i.e. LOGSALARY is missing for every observation.