hi Dave, two options don't work in proc glm.
You can take a look at my code as below:
*******************************
date and time: Tuesday, November 05, 2019 17:09:46
stat user's guide
http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax10.htm&docsetVersion=15.1&locale=zh-CN
*dependent variable: height
*fixed factors(class/group var): sex
*covariate:weight
ANCOVA Analysis
ABC material trt1 trt2
LS Means (SE) xx.x (xx.xx) xx.x (xx.xx)
95% CI (xx.xx, xx.xx) (xx.xx, xx.xx)
Diff LS Means (SE) C xx.x (xx.xx)
95% C.I. (xx.xx, xx.xx)
*******************************;
ods output OverallANOVA=Overall ModelANOVA=stat LSMeans=LSMeans
LSMeanCL=LSMeanCL LSMeanDiffCL=LSMeanDiffCL FitStatistics=FitStatistics diff=adiff Estimates=estdiffs
;
;
proc glm data=sashelp.class;
class sex;
model height=weight sex;
lsmeans sex/pdiff cl stderr;
estimate 'male vs female' sex 1 -1 ;
run;
quit;
/*LS Means (SE) 95% CI*/
data lsm;
length mean_se cl $200;
merge LSMeans LSMeanCL ;
by sex;
mean_se= strip(put(LSMean,18.2-L))||" ("||strip(put(stderr,18.2-L))||")";
cl="("||strip(put(lowercl,18.2-L))||","||strip(put(uppercl,18.2-L))||")";
run;
proc transpose data=lsm out=lsm1(rename=(f=col1 m=col2));
id sex;
var mean_se cl;
run;
/*Diff LS Means (SE)2*/
data dlsm;
length dmean_se dcl $200;
merge LSMeanDiffCL estdiffs ;
by dependent;
dmean_se= strip(put(difference,18.2-L))||" ("||strip(put(stderr,18.2-L))||")";
dcl="("||strip(put(lowercl,18.2-L))||","||strip(put(uppercl,18.2-L))||")";
run;
proc transpose data=dlsm out=dlsm1(rename=(col1=col2));
var dmean_se dcl;
run;
data trans;
set lsm1 dlsm1;
run;
... View more