Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • xtcloglog Discrete Time Survival Analysis

    Hello Everyone,

    I am currently undertaking a study that requires conducting a survival analysis on panel data to examine lenders' bidding behavior over time. My objective is to understand the duration of bidding modes (automatic vs. manual) among lenders. However, I'm encountering challenges in adapting methodologies typically used for cross-sectional data to my panel dataset.

    To illustrate, my dataset includes the following variables:
    • LenderId: Unique identifier for each lender.
    • bid_no: Cumulative count of bids attempted by a lender, serving as my time indicator.
    • AutoBidding: Dummy variable (1 if bid is attempted by a machine, 0 if by a human).
    • Switching: Indicator for a switch in bidding mode (1 if there's a switch from manual to auto bidding or vice versa, 0 otherwise).
    • ts: Time spell for a lender, resetting the bid count after each switch in bidding mode.
    Code:
    input long LenderId float bid_no byte AutoBidding float(Switching ts)
    14186  1 0 0  1
    14186  2 0 0  2
    14186  3 0 0  3
    14186  4 1 1  4
    14186  5 0 1  1
    14186  6 0 0  1
    14186  7 0 0  2
    14186  8 1 1  3
    14186  9 1 0  1
    14186 10 1 0  2
    14186 11 0 1  3
    14186 12 0 0  1
    14186 13 0 0  2
    14186 14 1 1  3
    14186 15 0 1  1
    14186 16 0 0  1
    26346  1 0 0  1
    26346  2 0 0  2
    26346  3 0 0  3
    26346  4 0 0  4
    26346  5 0 0  5
    26346  6 0 0  6
    26346  7 1 1  7
    26346  8 1 0  1
    26346  9 0 1  2
    26346 10 0 0  1
    26346 11 0 0  2
    26346 12 0 0  3
    26346 13 0 0  4
    26346 14 0 0  5
    26346 15 0 0  6
    26346 16 0 0  7
    26346 17 0 0  8
    26346 18 0 0  9
    26346 19 0 0 10
    26346 20 0 0 11
    26346 21 0 0 12
    26346 22 0 0 13
    26346 23 0 0 14
    26346 24 0 0 15
    26346 25 0 0 16
    26346 26 0 0 17
    26346 27 0 0 18
    26346 28 0 0 19
    26346 29 0 0 20
    26346 30 0 0 21
    26346 31 0 0 22
    26346 32 0 0 23
    26346 33 0 0 24
    26346 34 0 0 25
    26346 35 0 0 26
    26346 36 0 0 27
    26346 37 0 0 28
    26346 38 0 0 29
    26346 39 0 0 30
    26346 40 0 0 31
    26346 41 0 0 32
    26346 42 0 0 33
    26346 43 0 0 34
    26346 44 0 0 35
    26346 45 0 0 36
    26346 46 0 0 37
    26346 47 0 0 38
    26346 48 0 0 39
    26346 49 0 0 40
    26346 50 0 0 41
    26346 51 0 0 42
    26346 52 0 0 43
    26346 53 0 0 44
    26346 54 0 0 45
    26346 55 0 0 46
    26346 56 0 0 47
    26346 57 0 0 48
    26346 58 0 0 49
    26346 59 0 0 50
    26346 60 0 0 51
    26346 61 0 0 52
    26346 62 0 0 53
    26346 63 0 0 54
    26346 64 0 0 55
    26346 65 0 0 56
    26346 66 0 0 57
    26346 67 0 0 58
    26346 68 0 0 59
    26346 69 0 0 60
    26346 70 0 0 61
    26346 71 0 0 62
    26346 72 0 0 63
    26346 73 0 0 64
    26346 74 0 0 65
    26346 75 0 0 66
    26346 76 0 0 67
    26346 77 0 0 68
    26346 78 0 0 69
    26346 79 0 0 70
    26346 80 0 0 71
    26346 81 0 0 72
    26346 82 0 0 73
    26346 83 0 0 74
    26346 84 0 0 75
    end
    label values AutoBidding autobid
    label def autobid 0 "Manual Bidding", modify
    label def autobid 1 "Automatic Bidding", modify

    From what I understand, survival analysis in this context requires splitting the data into time spells where each spell ends with a "switch" event. My questions are as follows:
    1. Is the correct approach to segment the data into time spells, treating each switch as an event endpoint?
    2. How should I handle the first-time spell, and is it necessary to exclude it from the analysis?
    3. For time-varying survival analysis, should I generate a new ID for tsset that combines LenderId with the time spell (e.g., lender-spell) and create a new time indicator alongside a "died" (switched) indicator?
    4. Considering my focus is on the duration within a bidding mode, how should I structure my model where the event of interest (failure event) is the "Switching"?
    I am seeking guidance on setting up my model correctly and any advice or references to similar studies or methodologies would be greatly appreciated.

    Will it be something like the following:
    Code:
    xtcloglog Switching default_kth_a2 default_kth_m2 PercentAutoBid interaction_1 interaction_2 i.Month i.hour, nolog i(LenderId) vce(robust)
    
        pgmhaz8 logt default_kth_a2 default_kth_m2 PercentAutoBid interaction_1 interaction_2, nolog i(LenderId) seq(td) dead(Switching)
    Thank you in advance for your assistance.


    This is the first time I have used survival analysis so apologize if I misunderstood anything.

    I hope someone can help.

    Best

    Said

  • #2
    Professor Stephen Jenkins I hope you can help with this.

    Comment

    Working...
    X