BookmarkSubscribeRSS Feed
Sean_OConnor
Fluorite | Level 6

Hi All,

I'm trying to replicate some work a colleague has done but using some different techniques.

 

proc reg data=RegA&i. outest=StatsA&i. RSQUARE noprint;
	model log_price = &Variables. qrt02-qrt04;
	output out=RegB&i. (keep=log_price
		&Variables. qrt02-qrt04 mtch lev cd fv res r) 
		residual=res rstudent=r h=lev cookd=cd predicted=fv;
run;

Above is an example of some code for a hedonic regression for house prices.

 

I would like to build on this, but one of my issues with proc reg  is it forces me to code any non numeric variables into categories.

 

I would like to use either proc robust reg or proc glm for my model instead as I can specify a class statement. One of my issues is that I need to calculate cooks distance in order to take out high leverage points and rerun the regression. I can't seem to find this option in either package.

 

Would anyone be able to provide some insight how I could output the same kind of results for the code above with either proc robust reg or proc glm.

 

Many thanks,

 

Sean  

 

 

2 REPLIES 2
Reeza
Super User

What if you use PROC GLMMOD to create the dummy variables for you automatically and then use PROC REG?

 

Here's how you can use PROC GLMMOD to create those dummy variables for you and then you can use the data in PROC REG:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-dummy-variables-Categorical-Var...

 


@Sean_OConnor wrote:

Hi All,

I'm trying to replicate some work a colleague has done but using some different techniques.

 

proc reg data=RegA&i. outest=StatsA&i. RSQUARE noprint;
	model log_price = &Variables. qrt02-qrt04;
	output out=RegB&i. (keep=log_price
		&Variables. qrt02-qrt04 mtch lev cd fv res r) 
		residual=res rstudent=r h=lev cookd=cd predicted=fv;
run;

Above is an example of some code for a hedonic regression for house prices.

 

I would like to build on this, but one of my issues with proc reg  is it forces me to code any non numeric variables into categories.

 

I would like to use either proc robust reg or proc glm for my model instead as I can specify a class statement. One of my issues is that I need to calculate cooks distance in order to take out high leverage points and rerun the regression. I can't seem to find this option in either package.

 

Would anyone be able to provide some insight how I could output the same kind of results for the code above with either proc robust reg or proc glm.

 

Many thanks,

 

Sean  

 

 


 

PaigeMiller
Diamond | Level 26

Another option is PROC PLS, which does have a CLASS statement, and produces an output statistic called TSQUARE, which is similar in its idea to Cook's D, in that TSQUARE will identify points that are extreme in the x-directions. A difference between TSQUARE and Cook's D is that if an x-variable is not a good predictor, it is weighted very lightly in TSQUARE, and the variables that are a good predictor are weighted heavily; whereas I think Cook's D weights all the x-variables equally.

--
Paige Miller

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 628 views
  • 3 likes
  • 3 in conversation