09-04-2018
Brander
Calcite | Level 5
Member since
01-23-2017
- 3 Posts
- 2 Likes Given
- 0 Solutions
- 2 Likes Received
-
Latest posts by Brander
Subject Views Posted 865 10-26-2017 08:20 AM 3016 01-23-2017 10:09 AM 3042 01-23-2017 09:42 AM -
Activity Feed for Brander
- Got a Like for matching subjects to unique controls. 10-26-2017 09:28 AM
- Posted matching subjects to unique controls on SAS Procedures. 10-26-2017 08:20 AM
- Liked Re: retaining values from both row above and row below for RW9. 01-30-2017 03:43 AM
- Liked Re: retaining values from both row above and row below for Astounding. 01-30-2017 03:43 AM
- Posted Re: retaining values from both row above and row below on SAS Programming. 01-23-2017 10:09 AM
- Got a Like for retaining values from both row above and row below. 01-23-2017 09:48 AM
- Posted retaining values from both row above and row below on SAS Programming. 01-23-2017 09:42 AM
-
Posts I Liked
-
My Liked Posts
Subject Likes Posted 1 10-26-2017 08:20 AM 1 01-23-2017 09:42 AM
10-26-2017
08:20 AM
1 Like
Hi everyone, I have two datasets of individuals, one of 1155 cases and one of 22000 potential controls. I would like to match the cases to the controls on the variable "age" (within a 1-2 year span), but I want each control to only occur once. Having matched all possible combinations, some have as few as 13 matches and some have as many as 2000. If possible, I would for each case to be matched to the same number of unique controls. The selection of controls, where there are many options, should be randomized. proc sql; create table match as select
a.case_id,a.case_age, b.match_id, b.match_age, ranuni(383467663) as rand
from cases as a,
controls as b
where
(b.match_age-1)<a.case_age<(b.match_age+1)
order by a.case_id;
quit; I've used randomly generated numbers to sort by and delete duplicates among the controls. But I then end up with as few as one control for some cases (and still almost 2000 for others), and seem to lose some cases as well, which I definitely don't want to do. Any ideas? Thanks in advance!
... View more
01-23-2017
10:09 AM
Hi RW9, Thank you very much for your reply! It really seemed to solve my problem! I'm sorry for not posting any test data, it's the first time I'm using this forum. Best, Gustaf
... View more
01-23-2017
09:42 AM
1 Like
Hi, I want to define time periods on and off medication to use as a time varying variable. I have start and stop dates for being ON medication, but need to add rows with start and stop of being OFF medication. So what I have is something along the lines of the following: id start stop Med 1 20050101 20050801 1 1 20051001 20051201 1 And what I need is this: id start stop Med 1 20050101 20050801 1 1 20050801 20051001 0 1 20051001 20051201 1 I've been trying to use the retain function, but am at a loss on how to get the value of the start date on the row BELOW to use as the stop date on a new row. Any ideas? Thanks in advance!
... View more