BookmarkSubscribeRSS Feed
goldblumj1994
Calcite | Level 5
Hi all! Please help! I am using proc glm and mianalyze to generate simple intercepts and slopes. I get results like the picture below. 
Image preview
The problem is, rather than generating this output, which says that the intercepts and slopes are significantly different from zero, I want to generate specific points for the average diagnostic age for each possible category (for example, male Hispanic, male non-Hispanic, female Hispanic, and female non-Hispanic) and see if they significantly differ from each other. see plot below: 
Image preview
Does anyone know how to generate these points and see if they significantly differ? Essentially comparing simple slopes and intercepts. I'm stumped!! 
 
Here's my code if it helps: 

title "probing 3 way intx in model 4, subsetting by non- multi children, with multi var out of model";

odsselectnone;

proc glm data=NotMult;

model AgeDxASD = SC_AGE_YEARS CurrID NewLang Educ_1 Educ_2 Educ_3 Unemployed NoInsur povcat_1 povcat_2 povcat_3

Female black Asian Hispanic

BlaFemIntx AsiaFemIntx BlaHispIntx FemHispIntx

/ solution;

estimate 'intnotHisp' intercept 1

    sc_age_years 5 currid .2 newlang .2 educ_1 .15 educ_2 .15 educ_3 .15

        unemployed .2 noinsur .3  povcat_1 .15 povcat_2 .15 povcat_3 .15 Asian 0 black 0

BlaFemIntx 0 AsiaFemIntx 0 BlaHispIntx 0 FemHispIntx 0 ;

estimate 'SlopeNotHisp' Female 1 FemHispIntx 0;

estimate 'IntHisp' intercept 1 Hispanic 1

    sc_age_years 5 currid .2 newlang .2 educ_1 .15 educ_2 .15 educ_3 .15

        unemployed .2 noinsur .3 povcat_1 .15 povcat_2 .15 povcat_3 .15 Asian 0 black 0

BlaFemIntx 0 AsiaFemIntx 0  BlaHispIntx 0 FemHispIntx 0 ;

estimate 'SlopeHisp' Female 1  FemHispIntx 1;

weight FWC ;

by _imputation_ ;

ods output estimates = femhisp;

run; quit;

odsselectall;

proc print data = femhisp (obs=6); run;

proc sort data = femhisp out = femhisp; by _imputation_ parameter; run;

proc transpose data = femhisp out=femhisp2 ; by _imputation_  parameter ; var Estimate stderr ; run;

proc print data = femhisp2 (obs=20); run;

proc transpose data = femhisp2 out=femhisp3 ; by _imputation_ ; id parameter _name_ ; var COL1 ; run;

proc print data = femhisp3 (obs=20); run;

proc mianalyze data=femhisp3 ;

modeleffects IntHispEstimate SlopeHispEstimate SlopenotHispEstimate intnotHispEstimate ;

stderr IntHispStdErr SlopeHispStdErr SlopenotHispStdErr intnotHispStdErr ;

ods output parameterestimates=_parms_;

run;

proc transpose data=_parms_  out=_parms_;

  id parm;

  var estimate;

run;

data probe1;

set _parms_;

do female=0 to 1;

hispanic=inthispestimate+slopehispestimate*female;

nonhispanic=intnothispestimate+slopenothispestimate*female;

output;

end;

run;

proc print data=probe1;

run;

1 REPLY 1
SAS_Rob
SAS Employee

It seems to me that the LSMEANS statement in GLM would be better suited to giving you the values you are looking for.  In order to do this, you would need to go back to the original Race/Sex/Education variables and put them on the CLASS statement (e.g. do not create dummy variables).  Once you have done that, you should be able to easily combine the LsMeans results using the example linked below as a guide.

30698 - How do I combine the LSMEANS and differences in LSMEANS from Proc GLM using Proc MIANALYZE? ...

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 587 views
  • 1 like
  • 2 in conversation