BookmarkSubscribeRSS Feed
abdulla
Pyrite | Level 9

Hi,

I need to test the coefficient difference.

Model 1: y = x(dummy) + controls if constraint =1

Model 2: y = x(dummy) + controls if constraint =4

 

I want to test the difference in coefficient of x in the above two models. I have grouped constrained variable into 4 and find the difference between top and low groups coefficients of x. 

Can anyone please help me with the codes?

7 REPLIES 7
Rick_SAS
SAS Super FREQ

Please post the SAS code that you would use to evaluate each model separately. That will help us figure out what you are trying to do.

abdulla
Pyrite | Level 9

Hi Rick,
I want to test the impact of the presence of lead director (Lead_Dir) on investment efficiency (InvEff) when firm's size (Size) is small and large.

independent variable = Lead_Dir (dummy variable)
dependent variable = InvEff (continuous variable)
control variables = ROA, Leverage, Cash

I have sorted the firm year observations (panel Data) into quartile based on size. So, I want to find the impact of Lead_Dir on InvEff when firm size is small (Size=1) and large (size=4) and then test the whether the difference in impact is statistically significant. So, I think the code will be as follows

proc glm data=have noprint;
class Ind fyear;
model InvEff = Lead_Dir  ROA Leverage Cash ind year / solution;
output out=want;
run;
quit;

Here, I use "Ind" and " Year" fixed effect and cluster the error at firm level (gvkey). But I am not sure how to use clustering in the model.
My plan is to run the code twice for small and large group of firms. Then I will get two different coefficients for Lead_Dir and then I want to test whether the difference in the two coefficients are statistically significant.
I hope you understand now what I am trying to do.

PaigeMiller
Diamond | Level 26

I don't understand the question. I don't even understand what models you are trying to fit, or exactly what coefficient you want to test.

--
Paige Miller
abdulla
Pyrite | Level 9
Hi Paige Miller,
I have explained what I am trying to do. Could you please check that?
PaigeMiller
Diamond | Level 26

Hello, @abdulla , thank you for the much clearer explanation.

 

I am still not sure I understand your point about clustering of errors. However, for the rest of your questions, this should work:

 

proc glm data=have noprint;
class ind fyear size;
model invEff = size size*lead_dir  size*ROA size*Leverage size*Cash size*ind size*year / solution;
run;
quit;

This effectively fits two models using one PROC GLM, and then the interaction of size*lead_dir tests whether or not the coefficients are the same in both models or not.

--
Paige Miller
abdulla
Pyrite | Level 9
Paige,
I don't get any output. I used output out=want but still I don't get any output. Without noprint I get output. How will I get output in work file with noprint option.
I get two coefficients for size*lead_dir. I want to test whether the coefficients are statistically different from each other. I don't still get that.
PaigeMiller
Diamond | Level 26

Show us the LOG of the code you used. Please show us the log by copying log as text and pasting it into the window that appears when you click on the </> icon. Do not provide the log any other way. The log must contain the entire section of log for this PROC GLM, starting at the PROC GLM statement and then continuing down to the last NOTE: after the PROC, in the order it appears, with nothing chopped out.

 

For your future help, do not say "It doesn't work" without providing the log or the incorrect output. 

 

The F-test for this interaction is the test you want.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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