BookmarkSubscribeRSS Feed
bnd
Fluorite | Level 6 bnd
Fluorite | Level 6

I am trying to compute a change score for a variable that has two different time points (Month 0 and Month 4). I am having issues with how this should be done in SAS. I tried using an LS Means statement, but only class variables can be used. The data looks like this in my dataset. I am trying to figure out what would be the best way to see a change in these scores (Month 4 - Month 0). But, I am not sure the best way that this could be done. Any thoughts? Suggestions?

 

Psi timepoints

Psi

Baseline_arm_1

125

Month_4_arm_1

88

4 REPLIES 4
PaigeMiller
Diamond | Level 26

You mention LSMEANS, could you please show us your code? Could you also show us a larger portion of your data, it's really hard to determine what to do if you only have two records.

--
Paige Miller
bnd
Fluorite | Level 6 bnd
Fluorite | Level 6

Sorry about that. My code and more of the data is provided below. 

 

proc mixed data=be.time04 method=reml covtest;
class acrostic;
model weight = spmrkt_grcy psi time county spmrkt_grcy*time spmrkt_grcy*time*psi /solution ddfm=sat;
random intercept / subject = acrostic type=un;
lsmeans spsis / e diff cl adjust=bon;
run;

 

 

Psi timepoints

Psi

Baseline_arm_1

125

Month_4_arm_1

88

Baseline_arm_1

110

Month_4_arm_1

110

Baseline_arm_1

59

Month_4_arm_1

76

Baseline_arm_1

103

Month_4_arm_1

113

Baseline_arm_1

84

Month_4_arm_1

92

Baseline_arm_1

117

Month_4_arm_1

92

Baseline_arm_1

84

Month_4_arm_1

92

Baseline_arm_1

123

Month_4_arm_1

118

Baseline_arm_1

123

Month_4_arm_1

131

Baseline_arm_1

90

Month_4_arm_1

87

Month_4_arm_1

125

Baseline_arm_1

123

Month_4_arm_1

131

Baseline_arm_1

90

Month_4_arm_1

87

Baseline_arm_1

125

PaigeMiller
Diamond | Level 26

Got it, thanks.

 

Make PSItimepoint to be a CLASS variable, then an LSMEANS statement with PSItimepoint ought to work.

--
Paige Miller
bnd
Fluorite | Level 6 bnd
Fluorite | Level 6

I changed the variable from numeric to a character variable and I keep receiving the ERROR: Only CLASS variables allowed in this effect. I am not sure why this is happening. 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 4 replies
  • 916 views
  • 0 likes
  • 2 in conversation