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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1126 views
  • 0 likes
  • 2 in conversation