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

Hi Community,

 

Every time I run Rogers standard errors model, I get .... for the dummy variable yr12, although my sample has data on yr12. Your assistance is highly appreciated.

 

 

DATA Aac; * Full sample;
set Aac;
proc surveyreg data=Aac;
cluster year;

model Aac_int = EB_Aac1 NewReg LagEarnings2 LagAac_int
yr00 yr01 yr02 yr03 yr04 yr05 yr06 yr07 yr08 yr09
yr10 yr11 yr12 yr13 yr14 yr15 yr16 yr17 /ADJRSQ ; run;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

In PROC SURVEYREG, there's no need to create your own dummy variables, the CLASS statement will do that for you behind the scenes.

 

In your case, the regression coefficient of yr12 cannot be estimated because it is not independent of the other variables yr00-yr17. This is not an error, this is the way SAS (and probably most other statistical programs) handle the situation. Consider the simple case where you have dummy variables for male and female. If you know the dummy variable (0 or 1) for male, then you also know the dummy variable 0 or 1 for female, these are completely dependent on one another and so a dummy variable for female adds no new information. The same is true for yr12 ... if you know yr00-yr11 and yr13-yr17, then you know exactly yr12, it adds no new information.


Rather than look at the regression coefficients for your dummy variables, you want to look at the least squares means for your dummy variables using the LSMEANS statement. This will overcome the problems mentioned above.

--
Paige Miller

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Show us the output you are getting. Copy the text and then paste it into the window that appears when you click on the {i} icon.

--
Paige Miller
Almutairi
Fluorite | Level 6
27   proc surveyreg data=Aac;
28               cluster year;
29
30       model Aac_int = EB_Aac1 NewReg LagEarnings2 LagAac_int
31                       yr00 yr01 yr02 yr03 yr04 yr05 yr06 yr07 yr08 yr09
32                       yr10 yr11 yr12 yr13 yr14 yr15 yr16 yr17 /ADJRSQ ; run;

NOTE: PROCEDURE SURVEYREG used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds

The SAS System 


The SURVEYREG Procedure
 
Regression Analysis for Dependent Variable AAC_int

Data Summary 
Number of Observations 840 
Mean of AAC_int 0.0034912 
Sum of AAC_int 2.93261 



Design Summary 
Number of Clusters 19 



Fit Statistics 
R-Square 0.7176 
Adjusted R-Square 0.7104 
Root MSE 0.05224 
Denominator DF 18 



Tests of Model Effects 
Effect Num DF F Value Pr > F 
Model 3 415.40 <.0001 
Intercept 0 . . 
EB_Aac1 1 1100.31 <.0001 
NewReg 0 . . 
LagEarnings2 1 360.67 <.0001 
LagAac_int 1 0.06 0.8089 
yr00 0 . . 
yr01 0 . . 
yr02 0 . . 
yr03 0 . . 
yr04 0 . . 
yr05 0 . . 
yr06 0 . . 
yr07 0 . . 
yr08 0 . . 
yr09 0 . . 
yr10 0 . . 
yr11 0 . . 
yr12 0 . . 
yr13 1 211.22 <.0001 
yr14 1 20.55 0.0003 
yr15 1 10.97 0.0039 
yr16 1 4.24 0.0543 
yr17 1 83.39 <.0001 




Note: The denominator degrees of freedom for the F tests is 18. 




Estimated Regression Coefficients 
Parameter Estimate Standard
Error t Value Pr > |t| 
Intercept 0.0470502 0.00306833 15.33 <.0001 
EB_Aac1 -0.7818615 0.02357066 -33.17 <.0001 
NewReg -0.0235215 0.00068571 -34.30 <.0001 
LagEarnings2 0.5692596 0.02997476 18.99 <.0001 
LagAac_int -0.0048703 0.01984826 -0.25 0.8089 
yr00 -0.0041067 0.00192654 -2.13 0.0471 
yr01 -0.0288705 0.00080455 -35.88 <.0001 
yr02 -0.0223174 0.00034868 -64.01 <.0001 
yr03 -0.0165263 0.00037033 -44.63 <.0001 
yr04 -0.0008246 0.00078551 -1.05 0.3077 
yr05 -0.0063398 0.00140053 -4.53 0.0003 
yr06 -0.0198335 0.00166022 -11.95 <.0001 
yr07 -0.0344668 0.00153419 -22.47 <.0001 
yr08 -0.0317944 0.00107077 -29.69 <.0001 
yr09 -0.0450443 0.00144926 -31.08 <.0001 
yr10 -0.0199334 0.00108137 -18.43 <.0001 
yr11 -0.0079761 0.00061658 -12.94 <.0001 
yr12 0.0000000 0.00000000 . . 
yr13 -0.0069506 0.00047824 -14.53 <.0001 
yr14 -0.0021293 0.00046976 -4.53 0.0003 
yr15 -0.0015849 0.00047855 -3.31 0.0039 
yr16 0.0006426 0.00031218 2.06 0.0543 
yr17 -0.0024150 0.00026446 -9.13 <.0001 




Note: The degrees of freedom for the t tests is 18.
Matrix X'X is singular and a generalized inverse was used to solve the normal equations. Estimates are not unique. 


Almutairi
Fluorite | Level 6

I also attached the file in my previous message if you like to run the model.

 

Thank you.

Almutairi
Fluorite | Level 6

The model works fine as I drop yr12.

PaigeMiller
Diamond | Level 26

In PROC SURVEYREG, there's no need to create your own dummy variables, the CLASS statement will do that for you behind the scenes.

 

In your case, the regression coefficient of yr12 cannot be estimated because it is not independent of the other variables yr00-yr17. This is not an error, this is the way SAS (and probably most other statistical programs) handle the situation. Consider the simple case where you have dummy variables for male and female. If you know the dummy variable (0 or 1) for male, then you also know the dummy variable 0 or 1 for female, these are completely dependent on one another and so a dummy variable for female adds no new information. The same is true for yr12 ... if you know yr00-yr11 and yr13-yr17, then you know exactly yr12, it adds no new information.


Rather than look at the regression coefficients for your dummy variables, you want to look at the least squares means for your dummy variables using the LSMEANS statement. This will overcome the problems mentioned above.

--
Paige Miller
Almutairi
Fluorite | Level 6

Thank you so much.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 6 replies
  • 1024 views
  • 0 likes
  • 2 in conversation