Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: PROC REG - error - range of variable is small

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-29-2019 12:44 AM
(4302 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

11 REPLIES 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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`

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@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 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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Ok sorry for inconvenience

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!

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.