The SAS function, INTCK, serves as a way of determining a selected duration of time which has elapsed between two SAS variables.
The form of the function is as follows:
INTCK(‘<measured duration>’ , <DATEA>, <DATEB>);
For example, if you wanted to measure the days that occurred between variable DATEA and DATEB, the code would resemble:
INTCK(‘day’ , DATEA, DATEB);
You will need to store the output, so we will create a new variable, DATEC, to do so. The code would then resemble:
DATEC = INTCK(‘day’ , DATEA, DATEB);
This function can evaluate many different measurements of time, however, I will only mention those that are most commonly utilized.
DATEC = INTCK(‘day’ , DATEA, DATEB); /* Days */
DATEC = INTCK(‘week’ , DATEA, DATEB); /* Weeks */
DATEC = INTCK(‘month’ , DATEA, DATEB); /* Months */
DATEC = INTCK(‘year’ , DATEA, DATEB); /* Years */
DATEC = INTCK(‘qtr’ , DATEA, DATEB); /* Quarters */
/*****************************************************************************/
!IMPORTANT NOTE! - INTCK() only returns INTEGERS! Meaning, that if a week and a half elapsed, and <INTCK(‘week’, x , y)> was being utilized, then the result would be 1, as only 1 WHOLE week has lapsed in duration.
In the next article, I will return to discussing the R coding language, specifically, hypothesis tests and error types.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.