BookmarkSubscribeRSS Feed
PamG
Quartz | Level 8

I have two variables - spline variable of height and a binary variable.  How do I write contrast to get difference in spline effects with respect to a reference at height=50 when sex=M and sex=F?  How can this be wriiten using positional syntax?

 

data Have(rename=(height=BMI));
set sashelp.class;
keep Height sex age;
run;

proc phreg data=have;
class sex(ref="F")/param=ref;
effect bmiS=spline(bmi/ basis=tpf(noint) NATURALCUBIC details knotmethod=percentiles(4));
model age=sex bmiS bmiS*sex;
store result;
run;

%LET ref=50; %LET value=65;

proc plm restore=result;
**for females;
estimate "1. &value. VS &ref. sex level 1" bmis [-1, &ref.] [1, &value.] sex*bmis [-1, 1 &ref.] [1, 1 &value.]/ e exp cl;* cov;
estimate "2. &value. VS &ref. " bmis [-1, &ref.] [1, &value.] / e exp cl;* cov;

**for males;
estimate "3. &value. VS &ref. sex level 2" sex 1 bmis [-1, &ref.] [1, &value.] sex*bmis [-1, 2 &ref.] [1, 2 &value.]/ e exp cl;* cov;
estimate "4. &value. VS &ref. sex level 2 (ref)" sex 1 bmis [-1, &ref.] [1, &value.] sex*bmis [-1, 2 &ref.] [1, 2 &value.]/ e exp cl;* cov;

run;

 

1 REPLY 1
PamG
Quartz | Level 8

I would like to know if the above contrast is correct and how can this be written using positional syntax.  Thanks.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 346 views
  • 0 likes
  • 1 in conversation