BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Radwan
Quartz | Level 8

Hello every one 

i have a question which is :

when i run this code (reg statement) 

proc reg noprint data=found outest=equation1;
model CFLO_real= TA1 S1 S2/ r ;
by year indusCode;
run;

i got the results but the program gives me warn message as follows:


121 proc reg noprint data=found outest=equation1;
NOTE: Writing HTML Body file: sashtml.htm
122 model CFLO_real= TA1 S1 S2/ r ;
123 by year indusCode;
124 run;

WARNING: The range of variable CFLO_real is so small relative to its mean that there may
be loss of accuracy in the computations. You may need to rescale the variable to
have a larger value of RANGE/abs(MEAN), for example, by using PROC STANDARD M=0;
NOTE: The above message was for the following BY group:
year=2013 indusCode=A03
NOTE: Interactivity disabled with BY processing))

 definitely the value of  CFLO_real variable came out negative. so please someone helps me 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

First thing: That is not an Error but a Warning. Warnings tell you that perhaps you are using the wrong tool or that the results may not be reliable as used.

 

I can replicate a similar issue with this code:

proc sort data=sashelp.class out=work.class;
 by sex age;
run;

proc reg data=work.class;
   by sex age;
   model weight=height;
run;

Which generates:

WARNING: The range of variable Weight is so small relative to its mean that there may be loss of
         accuracy in the computations. You may need to rescale the variable to have a larger
         value of RANGE/abs(MEAN), for example, by using PROC STANDARD M=0;
NOTE: The above message was for the following BY group:
      Sex=F Age=15

when you examine the data set work.class the two records for Sex=F and Age= 15 you see weights of 112.5 and 112, which means that the value of Range/ abs(mean) is  0.5 / 112.25 . This is diagnostic that tells you if have not examined your data that perhaps you need to look at it more closely.

Also notice that other groups of Sex Age with only 2 records do not generate this message because the values of weight vary a bit more.

View solution in original post

11 REPLIES 11
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You have not provided any example data to explain your issue, therefore to re-iterate the warning you are getting:
For group: year=2013 indusCode=A03

the data does not deviate from the mean (i.e. min/max have tiny differences to the mean) in order for it to do its computations on that block of data.

Maybe a statistician could give you reasons behind the formula.

Reeza
Super User

It likely means you have constants or your data has no variability. If you have measurements that are too close, your variance becomes really low, and if it gets too close to 0 you'll have issues with the formulas and dividing by zero. 

Basically, SAS is telling you there's an issue with your input data. 

In this case, you revisit your data to ensure it was read in correctly and that SAS is using the correct records. If the data is correct but has no variability you need to understand why and how you would need to deal with it from there on. 

 


@Radwan wrote:

Hello every one 

i have a question which is :

when i run this code (reg statement) 

proc reg noprint data=found outest=equation1;
model CFLO_real= TA1 S1 S2/ r ;
by year indusCode;
run;

i got the results but the program gives me warn message as follows:


121 proc reg noprint data=found outest=equation1;
NOTE: Writing HTML Body file: sashtml.htm
122 model CFLO_real= TA1 S1 S2/ r ;
123 by year indusCode;
124 run;

WARNING: The range of variable CFLO_real is so small relative to its mean that there may
be loss of accuracy in the computations. You may need to rescale the variable to
have a larger value of RANGE/abs(MEAN), for example, by using PROC STANDARD M=0;
NOTE: The above message was for the following BY group:
year=2013 indusCode=A03
NOTE: Interactivity disabled with BY processing))

 definitely the value of  CFLO_real variable came out negative. so please someone helps me 

 


 

Reeza
Super User
FYI - I updated your subject line to be more reflective of the question. This assists future users when they're search for similar questions.
ballardw
Super User

First thing: That is not an Error but a Warning. Warnings tell you that perhaps you are using the wrong tool or that the results may not be reliable as used.

 

I can replicate a similar issue with this code:

proc sort data=sashelp.class out=work.class;
 by sex age;
run;

proc reg data=work.class;
   by sex age;
   model weight=height;
run;

Which generates:

WARNING: The range of variable Weight is so small relative to its mean that there may be loss of
         accuracy in the computations. You may need to rescale the variable to have a larger
         value of RANGE/abs(MEAN), for example, by using PROC STANDARD M=0;
NOTE: The above message was for the following BY group:
      Sex=F Age=15

when you examine the data set work.class the two records for Sex=F and Age= 15 you see weights of 112.5 and 112, which means that the value of Range/ abs(mean) is  0.5 / 112.25 . This is diagnostic that tells you if have not examined your data that perhaps you need to look at it more closely.

Also notice that other groups of Sex Age with only 2 records do not generate this message because the values of weight vary a bit more.

Radwan
Quartz | Level 8
thank you so much. i got it, but they mentioned that we can use (PROC STANDARD M=0) . kindly could you please explain this type of sentence
Radwan
Quartz | Level 8

also i have a small inquiry which is 

when i run same code (proc reg)

proc reg noprint data=found outest=equation1;
model CFLO_real= TA1 S1 S2/ r ;
by year indusCode;
run;

. i got the result in the table attached in picture q.png notice that the value of CFLO_real variable came out a negative value , is this result normal ?

especially i use this model to calculate the residuals of earnings management. furthermore, when i asked my friend to use STATA program for doing my analysis the final results show that the effect is positive whilst in mine (sas) the result shows negative effect.

do you have an interpretation for that ?

thank you in advance

 

 

 

 

 

PaigeMiller
Diamond | Level 26

@Radwan wrote:

also i have a small inquiry which is 

when i run same code (proc reg)

proc reg noprint data=found outest=equation1;
model CFLO_real= TA1 S1 S2/ r ;
by year indusCode;
run;

. i got the result in the table attached in picture q.png notice that the value of CFLO_real variable came out a negative value , is this result normal ?

especially i use this model to calculate the residuals of earnings management. furthermore, when i asked my friend to use STATA program for doing my analysis the final results show that the effect is positive whilst in mine (sas) the result shows negative effect.

do you have an interpretation for that ?

thank you in advance

 

 

 

 

 


 

This is what SAS does in the OUTEST= data set.

 

From the documentation:

all the variables listed in any MODEL or VAR statement. Values of these variables are the estimated regression coefficients for the model. A variable that does not appear in the model corresponding to a given observation has a missing value in that observation. The dependent variable in each model is given a value of –1.

--
Paige Miller
PaigeMiller
Diamond | Level 26

@Radwan wrote:
thank you so much. i got it, but they mentioned that we can use (PROC STANDARD M=0) . kindly could you please explain this type of sentence

If you run PROC STANDARD so your mean of the Y variables is now zero, you may be able to get results. This may work in some situations, but not in others. The situations where this might work is if all the Y variables are huge, such as on the order of magnitude of 1e15, then it is possible (but not guaranteed) that setting the mean of the Y variables to be zero might allow the algorithm to work.

--
Paige Miller
Radwan
Quartz | Level 8

thank you 

i got it 

 

yesterday i confronted a problem which is when i merge several variables from several tables of data through using SQL statement the program gave me a message says the capacity of the file is not enough, then i used 

proc sort data=have nodupkey; .......

then the new table created but it contains over one million rows Smiley Frustrated then i used nodupkey code again then it fixed.

my question here is 

why did that happen?

although the all tables contain around 200000 rows ?

this first time happennd with my 

please explain the issue because perhaps there is error in my data 

thanks  

PaigeMiller
Diamond | Level 26

why did that happen?

Please start a new thread when you ask about an unrelated topic ... don't try to continue this thread (which is about PROC REG) and ask about a PROC SORT problem.

--
Paige Miller
Radwan
Quartz | Level 8
Ok sorry for inconvenience

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 3834 views
  • 6 likes
  • 5 in conversation