{"id":29737320,"url":"https://github.com/gitfrid/czechfoi-drate_exam","last_synced_at":"2026-02-07T03:02:40.866Z","repository":{"id":304266195,"uuid":"1018284954","full_name":"gitfrid/CzechFOI-DRATE_EXAM","owner":"gitfrid","description":"CzechFOI-DRATE_EXAM","archived":false,"fork":false,"pushed_at":"2025-07-14T08:54:18.000Z","size":9584,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T21:24:22.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitfrid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-12T00:23:47.000Z","updated_at":"2025-07-14T08:54:21.000Z","dependencies_parsed_at":"2025-07-12T03:17:56.559Z","dependency_job_id":null,"html_url":"https://github.com/gitfrid/CzechFOI-DRATE_EXAM","commit_stats":null,"previous_names":["gitfrid/czechfoi-drate_exam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gitfrid/CzechFOI-DRATE_EXAM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitfrid%2FCzechFOI-DRATE_EXAM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitfrid%2FCzechFOI-DRATE_EXAM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitfrid%2FCzechFOI-DRATE_EXAM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitfrid%2FCzechFOI-DRATE_EXAM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitfrid","download_url":"https://codeload.github.com/gitfrid/CzechFOI-DRATE_EXAM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitfrid%2FCzechFOI-DRATE_EXAM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29185113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"online","status_checked_at":"2026-02-07T02:00:07.217Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-25T16:11:24.947Z","updated_at":"2026-02-07T03:02:40.854Z","avatar_url":"https://github.com/gitfrid.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CzechFOI-DRATE_EXAM\n\n## Investigation of the Non-Random Boundary Condition Bias\n\nThe **non-random boundary condition bias** arises when a homogeneous group is **divided into subgroups based on a non-random time point**—as often happens in real observational studies—and these subgroups are then compared.\n\nThis lead to **illusory differences between the groups**, even when **no real causal effect** exists.\n\nUnlike more widely recognized biases such as: Immortal time bias, Survivorship Bias, Healthy user effect, Selection bias, Treatment delay bias  \n...this bias is often **overlooked**, yet it has inevitable a **major impact** on the outcomme of observational data.\n\nOnly few scientists seem to be aware of this statistical artefact,\nand widely used scientific methods such as Cox regression or Kaplan-Meier analysis seems not correct for it - which often leads to misleading results.\n\n**Charles Sanders Peirce recognized over a century ago that improper randomization and selection conditions distort conclusions,\na warning still relevant in today**\n\n[**CzechFOI-DRATE project for mor information**](https://github.com/gitfrid/CzechFOI-DRATE)\n_________________________________________\n\n### AA) simulate deaths doses.py\n\nThe simulation script demonstrates how applying the \"alive at dose time\" condition introduces a systematic bias — even when deaths are assigned completely at random, and doses are subsequently assigned only to individuals who meet the boundary condition (i.e., no causal effect of the vaccine is simulated — the null hypothesis).\n\n\n\u003cbr\u003e\u003cbr\u003e**Case 3 illustrates this clearly: the unvaccinated group appears to die at a much higher rate, despite no difference in the underlying, constant death risk between vaccinated and unvaccinated individuals. This is an example of bias, where the requirement to be alive at the time of dosing creates an illusion of vaccine effectiveness.**\n\n\u003cbr\u003ePhyton script [AA) simulate deaths doses.py](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Py%20Scripts/AA%29%20simulate%20deaths%20doses.py) \n\n_________________________________________\n\n| Case | Deaths       | Doses        | ** Condition (only assign if alive at dose day)   | Expected Bias   |\n|-------|--------------|--------------|------------------------------------------------|-----------------|\n| 1     | Real Data\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Real Data\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Inherent applied (real doses can only happen if alive)   | ✅ Bias Present  |\n| 2     | Simulated\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Real Data\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Not applied (assigned real doses regardless if alive)           | ❌ No Bias      |\n| 3     | Simulated\u0026nbsp;\u0026nbsp; | Probabilistic from real curve\u0026nbsp;\u0026nbsp;\u0026nbsp;   | ✅ Applied                                       | ✅ Bias Present  |\n| 4     | Simulated\u0026nbsp;\u0026nbsp; | Probabilistic from real curve\u0026nbsp;\u0026nbsp;\u0026nbsp;   | ❌ Not applied                                   | ❌ No Bias      |\n| 5     | Simulated\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Simulate rectangular curve\u0026nbsp;\u0026nbsp; | ✅ Applied                                       | ✅ Bias Present  |\n| 6     | Simulated\u0026nbsp;\u0026nbsp;\u0026nbsp;   | Simulate rectangular curve\u0026nbsp;\u0026nbsp; | ❌ Not applied                                   | ❌ No Bias      |\n\n****Boundary condition case3: death day \u003e last dose day**\n\u003cbr\u003e****Boundary condition case5: death day \u003e first  dose day**\n\n\n# Simulation Cases Visualization\n\n**Below are the result plots from six different simulation cases, for age group 70:**\n\n- Kaplan-Meier Survival Curves comparing Total, Vaccinated, and Unvaccinated  \n- Normalized Deaths, Population, and Doses for Total, Vaccinated, and Unvaccinated\n\n---\n\n**Case 3:**  \nDeaths After Last Dose (Real-Life Constraint)\n\nIn this simulated case, deaths are only allowed to occur after the individual's last recorded vaccine dose, based on the 7 real dose columns.\n\nThis mimics real-life data behavior:  \nIf someone has a recorded 3rd dose, they must have been alive at least until that dose date.\n\n---\n\n**The Problem:**\n\nThis introduces immortal time bias, giving an unfair advantage to the vaccinated group.\n\n---\n\n**Effect:**\n\n- Kaplan-Meier and Normalized Time-Series curves show fewer deaths in vaccinated  \n- Cox regression shows a significant strong protective effect, but this effect is biased and misleading\n\n\n\n| Case\u0026nbsp;\u0026nbsp;\u0026nbsp; | Raw Time Series (CA-AA) | Normalized Time Series (ZI-AA) |\n|-------|-------------------------|-------------------------------|\n| 1\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 1 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case1_real_deaths_real_doses.png) | ![Case 1 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case1_real_deaths_real_doses.png) |\n| 2\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 2 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case2_sim_deaths_real_doses_no_constraint.png) | ![Case 2 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case2_sim_deaths_real_doses_no_constraint.png) |\n| 3\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 3 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case3_sim_deaths_sim_real_doses_with_constraint.png) | ![Case 3 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case3_sim_deaths_sim_real_doses_with_constraint.png) |\n| 4\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 4 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case4_sim_deaths_sim_real_doses_no_constraint.png) | ![Case 4 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case4_sim_deaths_sim_real_doses_no_constraint.png) |\n| 5\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 5 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case5_sim_deaths_sim_flat_random_doses_with_constraint.png) | ![Case 5 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case5_sim_deaths_sim_flat_random_doses_with_constraint.png) |\n| 6\u0026nbsp;\u0026nbsp;\u0026nbsp; | ![Case 6 Raw](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/CA%29%20KM%20vx%20uvx/CA-AA%29%20case6_sim_deaths_sim_flat_random_doses_no_constraint.png) | ![Case 6 Normalized](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Plot%20Results/ZI%29%20vx%20uvx%20norm/ZI-AA%29%20case6_sim_deaths_sim_flat_random_doses_no_constraint.png) |\n\n\n\u003cbr\u003e[Download interactive htmls](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/tree/main/Plot%20Results)\n\u003cbr\u003ePhyton script [CA) KM vx uvx.py](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Py%20Scripts/CA%29%20KM%20vx%20uvx.py) \n\u003cbr\u003ePhyton script [ZI) vx uvx norm.py](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/edit/main/Py%20Scripts/ZI%29%20vx%20uvx%20norm.py) \n\n_________________________________________\n\n**Cox risk hazard vaxed/unvaxed results**\n\n| Case | Description                                      | β (coef) | HR = exp(β) | Expected HR | Risk Reduction (%) | 95% CI (HR) | z      | p-value | −log₂(p) |\n| ---- | ------------------------------------------------ | -------- | ----------- | ----------- | ------------------ | ----------- | ------ | ------- | -------- |\n| 1    | Real deaths, real doses (age 70)                 | -0.29    | 0.75        |             | 25.0%              | 0.73 – 0.76 | -22.30 | \u003c0.005  | 363.62   |\n| 2    | Real deaths, real doses (no constraint)          | 0.00     | 1.00        | 1.00        | 0.0%               | 0.98 – 1.03 | 0.18   | 0.86    | 0.22     |\n| 3    | Simulated deaths, real doses (with constraint)   | -0.47    | 0.62        | 1.00        | 38.0%              | 0.61 – 0.64 | -37.53 | \u003c0.005  | 1021.66  |\n| 4    | Simulated deaths, sim/real doses (no constraint) | -0.00    | 1.00        | 1.00        | 0.0%               | 0.97 – 1.03 | -0.10  | 0.92    | 0.12     |\n| 5    | Sim deaths, flat random doses (with constraint)  | -0.01    | 0.99        | 1.00        | 1.0%               | 0.97 – 1.02 | -0.39  | 0.70    | 0.52     |\n| 6    | Sim deaths, flat random doses (no constraint)    | -0.00    | 1.00        | 1.00        | 0.0%               | 0.97 – 1.02 | -0.25  | 0.80    | 0.32     |\n\n\n\u003cbr\u003ePhyton script [AE) Cox compare vx uvx.py](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Py%20Scripts/AE%29%20Cox%20compare%20vx%20uvx.py)  \n_________________________________________\n### Further simulation of ten differnet cases\n\n\u003cbr\u003ePhyton script [AF) simulate deaths doses curves.py](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/blob/main/Py%20Scripts/AF%29%20simulate%20deaths%20doses%20curves.py)  Cox Results: [Cox Results TXT](https://github.com/gitfrid/CzechFOI-DRATE_EXAM/tree/main/Plot%20Results/AE%29%20Cox%20compare%20vx%20uvx/AE-AF%29)\n_________________________________________\n\n## Solution to correct the Non-Random Boundary Condition Bias\n\n[**CzechFOI-DRATE-NOBIAS project for mor information**](https://github.com/gitfrid/CzechFOI-DRATE-NOBIAS)\n_________________________________________\n\n### Software Requirements:\n\nThese scripts don't require SQLite queries to aggregate the 11 million individual data rows.\nInstead, the aggregation is handled directly by Python scripts, which can generate aggregated CSV files very quickly.\nFor coding questions or help, visit https://chatgpt.com.\n\n- [Python 3.12.5](https://www.python.org/downloads/) to run the scripts.\n- [Visual Studio Code 1.92.2](https://code.visualstudio.com/download) to edit and run scripts.\n\n\n### Disclaimer:\n**The results have not been checked for errors. Neither methodological nor technical checks or data cleansing have been performed.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitfrid%2Fczechfoi-drate_exam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitfrid%2Fczechfoi-drate_exam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitfrid%2Fczechfoi-drate_exam/lists"}