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

Good afternoon! 


I am performing multiple linear regression within SAS Enterprise Guide (latest version) and I have encountered some strange results. I have ten indicators that all have ten observations each and these have been normalised.

I am trying to use one dependent variable and nine predictors. However, whenever I attempt this using either code or the inbuilt wizard, I do not receive any values for Standard Error, t value or Pr >|t|, as shown below.

 

elliotjameees_0-1611756693516.png

 

I am using the following code:

 

PROC REG DATA= 'D:\Datasets\PODS\Assignment\Raw Data\GS&REG\SAS LIB\argentina';
	MODEL ExportsGS =  ExportCost ImportCost ImportGS Trade Arrivals Revenue Contibution ServiceExp TechExp;
RUN;

 

Interestingly, if I remove a single predictor variable (it doesn't seem to be relevant which one I drop) then I am given the results. These are the results when I drop trade:

 

elliotjameees_3-1611756921879.png

 

These results are interesting because although the adjusted R² seems to suggest that the model can account for 99% of the variance in the dependent variable, NONE of the individual variables appear to be statistically significant.

I have created a scatter plot to visualise the relationships of the data, and this was as follows:

 

elliotjameees_2-1611756786067.png

 

Using this scatterplot I decided to drop Trade and ImportCost and run the regression again and again got confusing results (high R² with Pr > |t| values such as '0.97', etc.,).

 

Interestingly, if I drop one of the strongly correlated predictors, like ImportGS, but decide to include the weakly correlated predictors, like Trade or ImportCost, my R² = 1.0, which seems statistically unlikely.

I am clearly doing something wrong in my analysis; can anyone help me get to the bottom of this issue?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

It is mathematically impossible to get a standard error from data where you have 10 observations, and your regression has 9 predictor variables and an intercept. (Or, stated another way, the standard error will be zero in this case, you have fit the data perfectly) You cannot have the number of predictor variables plus intercept less than or equal to the number of observations in your data and get a standard error.

 

So, you need to reconsider why you are doing regression and how you are going about it.

--
Paige Miller

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

It is mathematically impossible to get a standard error from data where you have 10 observations, and your regression has 9 predictor variables and an intercept. (Or, stated another way, the standard error will be zero in this case, you have fit the data perfectly) You cannot have the number of predictor variables plus intercept less than or equal to the number of observations in your data and get a standard error.

 

So, you need to reconsider why you are doing regression and how you are going about it.

--
Paige Miller
elliotjameees
Calcite | Level 5
Thanks for this response. I have increased the number of observations to 20 in my pre-processing step and ran the code (with the predictor variables I wanted, dropping Trade, ImportCost and ExportCost) and I've generated much better results. Thank you!
novinosrin
Tourmaline | Level 20

Sir @PaigeMiller  Requesting little help to expand on "mathematically impossible". Please bear with me if I'm asking something too simple and may sound silly. Wouldn't SE be smaller as the number of observations get larger and vice versa? Can you help me understand

PaigeMiller
Diamond | Level 26

@novinosrin 

 

The model fits perfectly, there is no standard error (or another way to say it is that the standard error is zero).

--
Paige Miller
novinosrin
Tourmaline | Level 20

Okay got it. Sorry!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 925 views
  • 1 like
  • 3 in conversation