BookmarkSubscribeRSS Feed
edmb
Obsidian | Level 7

Hi,

 

The context of my question is that I am trying to estimate average, median or mean, time tourists spend abroad and average number of times they spend by analyzing their credit card history abroad.

 

My data is in the following format where one row represents one vacation period for one cardholder.

 

  • Card_ID
  • Last_Foreign_Trans_Dt
  • Last_Foreign_Trans_Dt
  • Left_Truncated ={0 if there exists a domestic transaction in the observation period prior to the vacation, 1 if a domestic transaction in the observation period does not exist prior to the vacation}
  • Right_Censored ={0 if there exists a domestic transaction in the observation period after the vacation, 1 if a domestic transaction in the observation period does not exist after the vacation (i.e. cardholder is assumed to be still on vacation)}
  • Time ={Last_Foreign_Trans_Dt - Last_Foreign_Trans_Dt, in days}
  • Transactions ={Number of transactions made in vacation period}

 

As a consequence of how the data is formatted, Card_ID can be repeated (the same Card_ID on a different row represents a different vacation period for that cardholder).

 

My question is how do I estimate time spent abroad given that some vacations are left-truncated (i.e. unsure when they started) and some are right-censored (they are still on vacation). If the data was only right-censored and did not feature any left-truncation then PROC LIFETEST would be suitable. I've read, however, that PROC LIFETEST cannot deal with left-truncation but that PROC PHREG can.

 

Does anyone know please how I should approach this, should I be using PROC PHREG?

1 REPLY 1
HB
Barite | Level 11 HB
Barite | Level 11

Can you assume first foreign transaction is start date and go from there? 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1472 views
  • 0 likes
  • 2 in conversation