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 |
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.
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 |
Got it, thanks.
Make PSItimepoint to be a CLASS variable, then an LSMEANS statement with PSItimepoint ought to work.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.