Calcite | Level 5

## Predicting time intervals based off enrollment date

I am trying to predict upcoming time periods based off enrollment dates. The electronic data capture system I use only gives me a list up to "Due in 90 days" but I want to make it easier and get upcoming time periods until the end of 2023. This would be for multiple subjects throughout the year. I already have a code to match the subject ID and MRN and want to expand it to predict upcoming visit windows and due dates.

I am thinking of using the Visit Window Date Calculations but want to automate it with SAS, calculation is in the file below.

I know there are a couple ways to do this, like INTNX function, but am not sure how to translate it here. Is there a better way?

Thanks,

Gloria

3 REPLIES 3
Super User

## Re: Predicting time intervals based off enrollment date

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

Data  are ideally in the form of a data step but clearly described simple text posted into a text box opened with the </> icon above the message window may work. A worked example is helpful as well.

Text or a link to a description of the calculation are helpful.

Note: processes described in spreadsheets are generally not  implemented the same way in SAS.

Calcite | Level 5

## Re: Predicting time intervals based off enrollment date

Sorry! Didn't know that about excel files, here is an example of the date calculations:

Consent date: 3/21/18

Visit 2: Year 1 Follow up

Visit Open Date Calculation: 180 after consent date or 9/17/2018

Visit Window Close Date Calculation: 365 Days (1 Yr) + 180 Days = 545 Days after Consent Date of 9/17/2019

Form Due Date: 12/16/2019

Super User

## Re: Predicting time intervals based off enrollment date

So if you have this dataset:

``````data have;
consent_date='21MAR2018'd;
format consert_date date9.;
do year=1 to 5;
output;
end;
run;``````

You can create a new dataset with your two new variables like this:

``````data want;
set have;
open_date = intnx('year',consent_date,year-1,'same')+180;
close_date = intnx('year',consent_date,year,'same')+180;
format open_date close_date date9.;
run;``````

Result

Discussion stats
• 3 replies
• 603 views
• 0 likes
• 3 in conversation