Tutorial Inverse probability weights to correct for ascertainment bias using R package 'wcox'3 years ago
Step 1: Load R package 'wcox' and toy data. | Step 2: Acquire population incidence rate in the correct format. | Step 3: Prepare the sample data using Prepare_data(). | Step 4: Calculate weights using Calculate_weights(). | Step 5: Fit a weighted Cox model using R package 'survival'. | References