BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a variable that looks like this:

Cohort
----------
3
.
.
4
.
.


I have three waves of data for each participant. I want to turn the 'cohort' variable into a 'time-invariant' variable. Is there syntax to make my variable 'cohort' look like this (I basically want to copy the first value for 'cohort' for each successive wave for each participant):

Cohort
---------
3
3
3
4
4
4
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Consider using the LAG function (or a RETAIN with a temporary SAS variable) in a DATA step; also, not really a Statistical Procedures related post, by the way.

Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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