BookmarkSubscribeRSS Feed
Shine
Calcite | Level 5

Greetings,

Anyone knows how to write the syntax to combine the results  from "Proc qlim' for the imputed data sets. Just as the ones that we did for "proc reg" or " proc logistic".

Thank you!!

5 REPLIES 5
SAS_Rob
SAS Employee

QLIM does not necessarily provide an output data set that MIANALYZE can use readily so the approach would depend on type of model you have.  What kind of model is it?

Shine
Calcite | Level 5
Thank you!
I used Proc Qlim for Heckman's selection model. But my data is the one with
multiple imputation, so I tried to figure out how to use proc mianalyze to
combine the results.

*proc qlim data = womenwk ;
model sel = married children education age /discrete;
model wage = education age /select(sel=1);
run;*

SAS_Rob
SAS Employee

Here is an example that you can use for a Heckman model.

 

data a;

keep y1 y2 x1 x2;

do i = 1 to 500;

if ranuni(214)> .9 then x1=.;else x1 = rannor( 19283 );

x2 = rannor( 19283 );

u1 = rannor( 19283 );

u2 = rannor( 19283 );

y1l = 1 + 2 * x1 + 3 * x2 + u1;

y2l = 3 + 4 * x1 - 2 * x2 + u1*.2 + u2;

if ( y1l > 0 ) then y1 = 1;

else y1 = 0;

if ( y2l > 0 ) then y2 = 1;

else y2 = 0;

output;

end;

run;ods trace on;

proc mi data=a out=aa seed=1;

var y1 y2 x1 x2;

run;

 

/*-- Bivariate Probit --*/

proc qlim data=aa;

by _imputation_;


model y1 = x1 x2/discrete;

model y2 = x1 x2/select(y1=1);


ods output parameterestimates=parms;

run;
/*Because QLIM labels the parameters with a . in their name and MIANALYZE will not accept this*/
/*It is necessary to change these . to _*/
data parms;
set parms;
parameter=translate(parameter,'_','.');
run;
proc mianalyze parms=parms;
modeleffects y1_Intercept y1_x1 y1_x2 y2_Intercept y2_x1 y2_x2 _Rho _Sigma_y2;
run;

Shine
Calcite | Level 5
Hi, there,
I tried it ,but it is said "Within-imputation StdErr missing".
I thought it might be that my second model in Heckman's selection model is
a OLS (I am not quite sure),
but do you know how to fix it?


model y1 = x1 x2/discrete; (Probit)

model y2 = x1 x2/select(y1=1); (OLS, y2 is a continuous variable)
Thanks a lot!

Shine
SAS_Rob
SAS Employee

Which variable is the ERROR message pointing to?  I would check the actual QLIM model output to see if there are issues with convergence.  

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1424 views
  • 0 likes
  • 2 in conversation