## Proc qlim for multiple imputation dataset

Occasional Contributor
Posts: 10

# Proc qlim for multiple imputation dataset

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!!

SAS Employee
Posts: 53

## Re: Proc qlim for multiple imputation dataset

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?

Occasional Contributor
Posts: 10

## Re: Proc qlim for multiple imputation dataset

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 Employee
Posts: 53

## Re: Proc qlim for multiple imputation dataset

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;

Occasional Contributor
Posts: 10

## Re: Proc qlim for multiple imputation dataset

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 Employee
Posts: 53

## Re: Proc qlim for multiple imputation dataset

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

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