BookmarkSubscribeRSS Feed
ejay0503
Obsidian | Level 7

Dear all, 

 

I have two interaction terms in my model and would like to run a simple slope analysis using PROC PLM. I already got pooled results for the mail effect but am having trouble with the PROC PLM part. Is there a way to get pooled results for PROC PLM on imputed data? 

 

Please see my code below. Please note that I used PROC SURVEYLOGISTIC because the data is weighted and the outcome is ordinal. 

 

(proc mi...........truncated)

 

proc surveylogistic data=perm.19m2;
strata RAESTRAT; cluster RAEHSAMP; weight R11WTRESP;
by _imputation_;
model DV_r (order=data) = R11AGEY_B | stress 
RAEDYRS h11itot self_health R11WGIWK R11JCTEN
computer pres_retire  young_promo less_demand physical_eff
gender race2_b race2_his race2_o
occupation_1 occupation_2 occupation_3 reduce_hrs part_full
/link=clogit clodds expb rsq;

ods output parameterestimates = perm.19m2print;
store perm.test; run; 

 

(proc mianalyze....truncated) 


ods graphics on;
proc plm restore = perm.test;
estimate 'stress slope, R11AGEY_B = mean-sd' stress 1 stress*R11AGEY_B 2.71
RAEDYRS 1 h11itot 1 self_health 1 R11WGIWK 1 R11JCTEN 1
computer 1 pres_retire 1 young_promo 1 less_demand 1 physical_eff 1
gender 1 race2_b 1 race2_his 1 race2_o 1
occupation_1 1 occupation_2 1 occupation_3 1 reduce_hrs 1 part_full 1,


'stress slope, R11AGEY_B = mean' stress 1 stress*R11AGEY_B 2.73
RAEDYRS 1 h11itot 1 self_health 1 R11WGIWK 1 R11JCTEN 1
computer 1 pres_retire 1 young_promo 1 less_demand 1 physical_eff 1
gender 1 race2_b 1 race2_his 1 race2_o 1
occupation_1 1 occupation_2 1 occupation_3 1 reduce_hrs 1 part_full 1,


'stress slope, R11AGEY_B = mean+sd' RAEDYRS 1 stress 1 stress*R11AGEY_B 2.75
RAEDYRS 1 h11itot 1 self_health 1 R11WGIWK 1 R11JCTEN 1
computer 1 pres_retire 1 young_promo 1 less_demand 1 physical_eff 1
gender 1 race2_b 1 race2_his 1 race2_o 1
occupation_1 1 occupation_2 1 occupation_3 1 reduce_hrs 1 part_full 1 /e ;
run;
ods graphics off;

 

(and then how to pool these results?) 

 

I would really appreciate your help!

 

 

 

2 REPLIES 2
SAS_Rob
SAS Employee

You could do something similar to the example below (it assumes the Proc MI step was already run).

 

/* Getting Started Example
Generate Data */

proc format;
value ResponseCode 1 = 'Very_Unsatisfied'
2 = 'Unsatisfied'
3 = 'Neutral'
4 = 'Satisfied'
5 = 'Very_Satisfied';
run;

proc format;
value UserCode 1 = 'New Customer'
0 = 'Renewal Customer';
run;

proc format;
value SchoolCode 1 = 'Middle School'
2 = 'High School';
run;

proc format;
value DeptCode 0 = 'Faculty'
1 = 'Admin/Guidance';
run;

data SIS_Survey;
format Response ResponseCode.;
format NewUser UserCode.;
format SchoolType SchoolCode.;
format Department DeptCode.;
do _imputation_=1 to 2;
drop j;
retain seed1 111;
retain seed2 222;
retain seed3 333;

State = 'GA';

NewUser = 1;
do School=1 to 71;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; end;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; end;
end;

NewUser = 0;
do School=72 to 134;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; end;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; end;
end;

State = 'NC';

NewUser = 1;
do School = 135 to 218;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;

if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; output;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;

if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; output;
end;

NewUser = 0;
do School = 219 to 274;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; end;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;

if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; output;
end;

State = 'SC';

NewUser = 1;
do School = 275 to 328;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; end;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;

if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; output;
end;

NewUser = 0;
do School = 329 to 370;

call rantbl( seed1, .45, .55, SchoolType );

Department = 0;
call rannor( seed3, x );
SamplingWeight = 25 + x * 2;
do j=1 to 2;
if ( SchoolType = 1 ) then
call rantbl( seed2, .16, .21, .30, .24, .09, Response);
else
call rantbl( seed2, .18, .23, .30, .22, .07, Response);
output; end;
output;

Department = 1;
call rannor( seed3, x );
SamplingWeight = 15 + x * 1.5;

if ( SchoolType = 1 ) then
call rantbl( seed2, .10, .15, .33, .28, .14, Response );
else
call rantbl( seed2, .13, .20, .30, .26, .11, Response);
output; output;
end;
end;
run;
title 'School Information System Survey';
/*Run SURVEYLOGISTIC by _IMPUTATION_*/
proc surveylogistic data=SIS_Survey;
by _imputation_;
class department;
model Response=department/covb;
strata State NewUser;
cluster School;
weight SamplingWeight;
store work.test;
run;

proc plm restore=work.test;
estimate 'dept1' department 1/category=separate;
estimate 'dept2' department -1/category=separate;
estimate 'dept1 v dept2' department 2/category=separate;
ods output Estimates=est_ds;
run;
proc sort data=est_ds;
by response label _imputation_;
run;

proc mianalyze data=est_ds;
by response label;
modeleffects estimate;
stderr stderr;
run;

 

ejay0503
Obsidian | Level 7

Your answer was helpful and did get me get the pulled results!!

 

Thank you very very much for your help. I really appreciate it. 

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!

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
  • 2 replies
  • 1509 views
  • 2 likes
  • 2 in conversation