BookmarkSubscribeRSS Feed
melike_f
Calcite | Level 5

Hi all, I am a newcomer to SAS and need your help.

I am running a 2 stage Heckman procedure on a panel data. I will get results of the first stage, panel probit and calculate the Inverse Mills Then I will run the second model, regression, in STATA. Actually since I could not run fixed effects probit in STATA I had to use SAS.  We have a heteroscedasticity problem so I would like to enforce the se s to be robust. Below is the code.

PROC GENMOD DATA=

LIBRARY.DAF_FIRM_YEAR_DATA DESCENDING;

CLASS FIRM_ID ALLIANCE_START_YEAR;

Model DEDICATED_ALLIANCE_FUNCTION = SIC7372 SIC7373 SIC7374  FIRM_AGE FIRM_R_D_INTENSITY_T_1 FIRM_SOLVENCY_T_1 ALLIANCE_EXPERIENCE  / dist = B link=probit MAXITER = 10000 TYPE3 WALD;

        REPEATED  subject= FIRM_ID / WITHIN= ALLIANCE_START_YEAR /* TYPE=AR(1) */;

       

- How can I take care of hetero problem and enforce the se s to be robust. Is there an option like in STATA vce(robust) ?

- I would like to be able to report the standardized coefficients, is there a way for that?

- I would like to calculate the Pseudo R2 or at least the loglikelihood, but someone told me that the calculation is not based on MLE? Any suggestions?

Thanks a lot!

2 REPLIES 2
SteveDenham
Jade | Level 19

I assume the heterogeneity is between ALLIANCE_START_YEAR values.  If so, you might consider using PROC GLIMMIX, which has a variety of shrinkage estimators and can model heterogeneous variances. It would mean defining one of the right hand side variables as the repeated measure of interest, which doesn't seem to appear in the current model You might try:

PROC GLIMMIX DATA=

LIBRARY.DAF_FIRM_YEAR_DATA DESCENDING;

CLASS FIRM_ID ALLIANCE_START_YEAR repeatedvarname; /*where repeatedvarname identifies the repeated variable*/

Model DEDICATED_ALLIANCE_FUNCTION =repeatedvarname SIC7372 SIC7373 SIC7374  FIRM_AGE FIRM_R_D_INTENSITY_T_1 FIRM_SOLVENCY_T_1 ALLIANCE_EXPERIENCE  / dist = B link=probit ddfm=kr2 solution; /*Kenward-rogers adjustment to df and standard errors*/

RANDOM repeatedvarname/subject=firm_id group=alliance_start_year type=ar(1); /*This is a G-side approach.  If you wish an R-side approach, add residual after the slash*/

run;

This will give the log likelihood, and the standardized coefficients can be calculated from the solution, which should report the estimates and the Prasad-Rao-Kecker-Harville-Jeske adjusted standard errors .

Steve Denham

melike_f
Calcite | Level 5

Thank a lot Steve.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 640 views
  • 0 likes
  • 2 in conversation