BookmarkSubscribeRSS Feed
nslw4r
Calcite | Level 5

 

 

I am having a problem with sas code. When I run this I am getting only one intercept and parameter estimate for the REM proc in SAS (this is referred to as [3]). What am I doing wrong with my code? Shouldnt I be getting back parameters for all school districts in the form of intercepts? I am just running for individual effects hence the "ranone". I just am not sure where the error is. Some help would be appreciated. Thanks in advance! P.S. I have 22 elementary schools in the data set.

 


Screenshot 2017-11-29 08.07.15.png

 

4 REPLIES 4
ballardw
Super User

Post code as text into code box opened with either of the menu icons {I} or the "running man".

Better is to post the code and messages from the LOG as it will show any syntax error messages or diagnostics.. Post that into a code box

Blue and gray on black background is nearly impossible to read plus the image does not allow copy and paste to show specific lines or minor edit suggestions.

 

I have to assume you mean the Proc REG as there is no REM in you code.

 

Since you have a line that compares your total_sq_ft and current_price variable to the value '(blank)' in a data step that implies your variables are character and not numeric. Proc Reg only uses numeric values on the model statement.

 

If you want results per school district you would have to tell the model to do so. One way is a BY statement with the school district variable. The data would have to be sorted by the school district. Then you will get output for each school district.

 

If you have 22 elementary schools how many are in each school district? If you don't have many schools per district your regressions may not be terribly useful.

nslw4r
Calcite | Level 5
Its an unbalanced panel. Some districts have only a few price listings within the district while others have 150-200. In the code the I put up [3] should be a random effects model. I guess I did a proc panel statement (sorry for the confusion). Is this not the right way to do a REM?
ballardw
Super User

@nslw4r wrote:
Its an unbalanced panel. Some districts have only a few price listings within the district while others have 150-200. In the code the I put up [3] should be a random effects model. I guess I did a proc panel statement (sorry for the confusion). Is this not the right way to do a REM?

Perhaps you are looking for Proc GLM with a RANDOM statement to indicate the variables you expect to provide the random effect.

Or Proc Mixed.

Reeza
Super User

Is it REG, which is a linear regression or do you genuinely mean REM - which you've mentioned multiple times now. If it is REM that's not something I'm familiar with regards to SAS, can you point to a reference or docs for that PROC?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4 replies
  • 2495 views
  • 0 likes
  • 3 in conversation