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?
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.
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.
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.
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: