1. Z

    How to extract dates (years) from a datetime variable

    Hello all, I am trying to extract the years from a datetime variable and do not seem to find a way. I am attaching images of what I see on STATA. Can someone explain to me in a simple way what I should do? Thank you in advance!
  2. J

    Syntax for Recoding Dates

    I have a range of dates from ~1950 to the present that are in the 5 digit Excel/Microsoft date code. I'd like to create date ranges. I'm looking for something like recode date into year (42005 thru 42369) = 2015 (the above syntax might be off by a bit, but you get the picture!)...
  3. E

    What is the correct test? dates included

    Hello, I have a table with dates (every day, ascending order), where each row is the flowing day, and a column with number of expressions. Something like this: Day 1 | 20 expressions Day 2 | 23 expressions … I need to see if there is significance between two periods: up to day...
  4. K

    Syntax Distribute Days across years

    Hi, I need to create variables that splits out a length of stay across years and enters the number of days in each of those years into separate year variables. For example, I have a length of stay for a case of 8.02 years. CaseID StartDate EndDate 222 12/23/1988 01/01/1997...
  5. L

    Functions for calculating time between 2 variables

    Hello, I have a large data set, and, in the data set, there are a number of dates entered as string variables (e.g., 05SEP2012). I need to determine the length of time in years between some of these variables (e.g., from 20MAR1969 to 05SEP2012), but can't seem to figure it out. I have...
  6. J

    SPSS Defining finanical years from a series of dates.

    Hi All, Nice to meet you, my first post. In SPSS, I would like to recode a date (variable StartDate) to its relevant finanical year (variable FinancialYear - a categorical variable). I can't figure out how to write the code to specify the date ranges, without spending 2 days on...
  7. X

    Stata Project Help (10-12 hour Job)

    Dear All, I need your help regarding one of my projects of Stata software. You must be familiar with dates formatting, system variables and lagging and merging and transposing of data. I understand you would be busy in your job and studies, and that is why I am happy to pay you reasonable...
  8. S

    Calculating DateDiff excluding weekends

    Hello, Does anyone have syntax that can calculate Date Differences but exclude the weekends? I have used the syntax below, but it would add 1 day values if it did not go over 1 week. So if the difference was 2 days the compute function would equal 3. However, it is accurate if it spans over a...