BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

I have this repeated measure with varying duplicate observation. I wish to make sure for each id, there is just one timepoint. Below is the data and corrected version (bold). I just one observation for each timepoint by sid

 

SID NPiL SizeL timepoint
200001 3.8 . 1
200001 3.8 . 1
200001 3.8 . 1
200001 3.8 . 1
200001 3.8 . 1
200001 3.8 4.99 1
200001 3.8 4.89 2
200001 3.8 4.89 2
200001 3.8 4.89 2
200001 3.8 4.89 2
200001 3.8 4.89 2
200001 3.8 4.89 2
200001 4.3 4.22 3
200001 4.3 4.22 3
200001 4.3 4.22 3
200001 4.3 4.22 3
200001 4.3 4.22 3
200001 4.3 4.22 3
200001 4.2 4.25 4
200001 4.2 4.25 4
200001 4.2 4.25 4
200001 4.2 4.25 4
200001 4.2 4.25 4
200001 4.2 4.25 4
200001 4.1 5.71 5
200001 4.1 5.71 5
200001 4.1 5.71 5
200001 4.1 5.71 5
200001 4.1 5.71 5
200001 4.1 5.71 5
200001 3.9 4.96 6
200001 3.9 4.96 6
200001 3.9 4.96 6
200001 3.9 4.96 6
200001 3.9 4.96 6
200001 3.9 4.96 6
200001 4.1 5.17 7
200001 4.1 5.17 7
200001 4.1 5.17 7
200001 4.1 5.17 7
200001 4.1 5.17 7
200001 4.1 5.17 7
200001 3.5 4.71 8
200001 3.5 4.71 8
200001 3.5 4.71 8
200001 3.5 4.71 8
200001 3.5 4.71 8
200001 3.5 4.71 8
200001 3.1 5.36 9
200001 3.1 5.36 9
200001 3.1 5.36 9
200001 3.1 5.36 9
200001 3.1 5.36 9
200001 3.1 5.36 9
200001 2.4 5.81 10
200001 2.4 5.81 10
200001 2.4 5.81 10
200001 2.4 5.81 10
200001 2.4 5.81 10
200001 2.4 5.81 10
200001 3.1 5.78 11
200001 3.1 5.78 11
200001 3.1 5.78 11
200001 3.1 5.78 11
200001 3.1 5.78 11
200001 3.1 5.78 11
200001 2.9 5.5 12
200001 2.9 5.5 12
200001 2.9 5.5 12
200001 2.9 5.5 12
200001 2.9 5.5 12
200001 2.9 5.5 12
200001 2.4 6.04 13
200001 2.4 6.04 13
200001 2.4 6.04 13
200001 2.4 6.04 13
200001 2.4 6.04 13
200001 2.4 6.04 13
200001 2.6 6.24 14
200001 2.6 6.24 14
200001 2.6 6.24 14
200001 2.6 6.24 14
200001 2.6 6.24 14
200001 2.6 6.24 14
200001 3 5.42 15
200001 3 5.42 15
200001 3 5.42 15
200001 3 5.42 15
200001 3 5.42 15
200001 3 5.42 15
200001 4.2 3.58 16
200001 4.2 3.58 16
200001 4.2 3.58 16
200001 4.2 3.58 16
200001 4.2 3.58 16
200001 4.2 3.58 16
200001 2.8 6.08 17
200001 2.8 6.08 17
200001 2.8 6.08 17
200001 2.8 6.08 17
200001 2.8 6.08 17
       
       
corrected data    
       
       
SID NPiL SizeL timepoint
200001 3.8 . 1
200001 3.8 4.89 2
200001 4.3 4.22 3
200001 4.2 4.25 4
200001 4.1 5.71 5
200001 3.9 4.96 6
200001 4.1 5.17 7
200001 3.5 4.71 8
200001 3.1 5.36 9
200001 2.4 5.81 10
200001 3.1 5.78 11
200001 2.9 5.5 12
200001 2.4 6.04 13
200001 2.6 6.24 14
200001 3 5.42 15
200001 4.2 3.58 16
200001 2.8 6.08 17
1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

Assuming your observations are sorted by SID and timepoint, and that you always want the first observation of the group, this should do it.

 

Tom

 

data want;
	set have;
	by SID timepoint;

	if first.timepoint;
run;

View solution in original post

2 REPLIES 2
TomKari
Onyx | Level 15

Assuming your observations are sorted by SID and timepoint, and that you always want the first observation of the group, this should do it.

 

Tom

 

data want;
	set have;
	by SID timepoint;

	if first.timepoint;
run;
SASUser_22
Calcite | Level 5

proc sort data = dataset1 nodupkey;

by timepoint;

run;

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1013 views
  • 0 likes
  • 3 in conversation