Hi,
Edition= Sas University Edition(9.4)
procedue=proc reg
data used contains categorical varaibles as 0/1
code used=
proc reg data=Mylib.lineaf;
model revenue=Units_Sold Price mid tro dom;
output out=mylib.result predicted=p residual=r;
run;
/*where mid tro and dom contains varaibles as 0/1*/
Result encountering
The REG Procedure
Number of Observations 89
Read Number of Observations 0
Used Number of Observations with Missing Values 89
But no further results are published
Please help. not getting where exactly I am committing an error.
Your issue comes from this message: Used Number of Observations with Missing Values 89
The procedure requires all variables on the model statement to be present. Any record that has one or more values missing for any of the independent variables is dropped from the calculation.
Apparently every record you have has at least one missing value for the independent variables in the model.
One of the variables is missing for every observation. It doesn't have to be the variables you mentioned.
Run a proc means on your data to see which variables have missing values.
proc means data=have n nmiss;
run;
Fix your input data - if it should be 0, make sure it's 0, if it should be missing make sure it's missing.
It's possible that somehow the MISSING option is set to 0, but you would have to have explicitly changed the setting. See the line of code below to reset the values.
options missing=.;
@sree0203 wrote:
Yes I used this line in my previous code but later formatted them using format statement as nuemerics...i felt it worked but it seems it didnt....noe tell me how to breakthrough it
Ok. If your problem is resolved mark the question as solved, if not, indicate what the issue is outstanding. If you've tried something that didn't work please let me know.
@sree0203 wrote:
Yes I used this line in my previous code but later formatted them using format statement as nuemerics...i felt it worked but it seems it didnt....noe tell me how to breakthrough it
Format and option missing display do not change underlying values.
something like:
data need; set have; array a _numeric_; do i=1 to dim(a); if missing(a[i]) then a[i]=0; end; drop i; run;
to actually set the values to 0. Replace _numeric_ with an actual list of numeric variable names if desired.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.