Programming the statistical procedures from SAS

compare regression slopes

Reply
Occasional Contributor
Posts: 16

compare regression slopes

Hi,

 

I don't have the data set of a regression model (Model A) but only the model statistics (such as slope value, Rsquare and standard error, etc.). I need to compare the slope of Model A with the Model B that I have developed using the same dependent and independent variables that belong to different populations in both models. What would be the most appropriate test to do? Please (With sas codes if possible). Thank you.

 

Fridge

 

 

 

Super User
Posts: 9,775

Re: compare regression slopes

Are you using PROC REG ?

Check TEST statement .

test b=the slope of model A ;

Occasional Contributor
Posts: 16

Re: compare regression slopes

thank you Ksharp
Super User
Posts: 18,569

Re: compare regression slopes

I don't believe there's a default test mostly because SAS is used to process raw data nor work with summarized data. 

 

If you have the Ns you can do the test but it would be a manual calculation. 

Occasional Contributor
Posts: 16

Re: compare regression slopes

Dear Reeza,

 

Please, find attached an attachment that contains the raw data to which I had no access before. Can you please, review the SAS codes that I assembled so far to run the comparison (I don't have in-depth understanding on this topic yet). My purpose again is to compare the slopes or regression models developed by each group. Thank you again.

 

Can you recommend any article that covers comparison of regression models with some example or SAS codes (please, please)?

 

Please, feel free to ask questions. 

 

Fridge

Super User
Posts: 18,569

Re: compare regression slopes

Have you checked out the SAS statistical e-course? It's free - support.sas.com/training/tutorial

Occasional Contributor
Posts: 16

Re: compare regression slopes

Not the ecourse yet but have finished the book "sas essentials for mastering for research". I will definitely look into the course that you have suggested...

Should I expect some input on the attachment that I just sent you? Thanks again

Fridge
Super User
Posts: 18,569

Re: compare regression slopes

Verify your calculation of the interaction term. I suspect it's incorrect. You can see this by looking at the N from your first regression results compared to the second regression results. SAS excludes variables with missing values. 

 

FYI - usually I think  full code reviews are beyond the scope of a public forum and won't review it, this is my personal rule. Your code is small and you can include it in posts directly, not as an attachment. Most users won't download attachments so you'll get better responses. I've also moved this to the Statistical Procedures Forum where it's more approriate. 

 

 

Super User
Posts: 9,775

Re: compare regression slopes

For your last proc reg

 

proc reg data=Compare2;
model TEM = Yr_16 TEMR group_Intr;
run;quit;

 

It should be covariance analysis, try PROC GLM.

proc glm data=Compare2;

class Yr_16;
model TEM = Yr_16 TEMR Yr_16*TEMR/solution;
run;quit;

Ask a Question
Discussion stats
  • 8 replies
  • 221 views
  • 2 likes
  • 3 in conversation