Programming the statistical procedures from SAS

Data management

Reply
N/A
Posts: 0

Data management

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Data management

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.
Ask a Question
Discussion stats
  • 1 reply
  • 88 views
  • 0 likes
  • 2 in conversation