BookmarkSubscribeRSS Feed
joannahh
Calcite | Level 5

Hello,

 

Using an ecological assessment design (where people report their negative affect and social interaction every three hours each day across 5 days of the week), I am trying to calculate's participants' hourly experience of Negative Affect (NA) when interacting with family members compared to No interaction (FamilyInteraction: categorical var).

 

I am trying to see how trait levels of neuroticism and extraversion may further explain this relationship so I am using a  three-way interaction with a dichotomous variable (FamilyInteraction) and two continuous variables (neuroticism and extraversion).

 

So far, the only way I have figured out a way to calculate the simple slopes and slope contrast is by using proc plm and using the lsmestimate command. But in order to use this syntax, I have to make one of the personality vars into a categorical variable. If I want to keep both of my personality variables as continuous variables, what syntax code can I use?

 

*Below purpose syntax is the main model of the analysis

proc mixed noclprint covtest ;
class ID FamilyInteraction;
model NA= FamilyInteraction|Neuro|Extraversion/ solution ddfm = bw;
RANDOM intercept / SUBJECT=Day;
RANDOM intercept / SUBJECT=ID(Hour);
store Save;run;


proc plm noclprint restore=Alonea;
effectplot interaction (x=FamilyInteractionsliceby=Neuro) / at(Extra=1.0741531 1.9140935) clm connect;
run;

 

*Below syntax in blue the way I would calculate the slopes & slope differences if one of the personality traits (Neuro) is made into a categorical variable and used in the proc plm lsmestimate command.


proc plm noclprint restore=Alonea;
lsmestimate C1r*LonelyCat 'No Fam-Yes Fam, Low Neuro, Extra=Low' [1, 1 1] [-1, 2 1],
                                             'No Fam-Yes Fam, High Neuro, Extra=Low' [1, 1 2] [-1, 2 2] / e adj=bon at  Extra=1.0741531;

lsmestimate C1r*LonelyCat 'No Fam-Yes Fam, Low Neuro, Extra=High' [1, 1 1] [-1, 2 1],
                                             'No Fam-Yes Fam, High Neuro, Extra=High' [1, 1 2] [-1, 2 2] / e adj=bon at Extra=1.9140935; run;


proc plm noclprint restore=Alonea;
lsmestimate FamilyInteraction*Neuro' diff No Fam-Yes Fam, LowNeuro- HighNeuro, Extra=Low' [1, 1 1] [-1, 2 1] [-1, 1 2] [1, 2 2] / e at Extra=1.0741531 joint;
lsmestimate FamilyInteraction*Neuro' diff No Fam-Yes Fam, LowNeuro- HighNeuro, Extra=High' [1, 1 1] [-1, 2 1] [-1, 1 2] [1, 2 2] / e at Extra=1.9140935 joint;
run;

 

I really appreciate any help I can get and please let me know if I can further clarify anything!

1 REPLY 1
PaigeMiller
Diamond | Level 26

The SOLUTION option in MODEL statement of PROC MIXED will provide the slopes.

--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 836 views
  • 0 likes
  • 2 in conversation