Skip to content
← all posts

· 11 min read · Jonathan Chrisnaldy

The Internet's Favorite Lung-Cancer Dataset Says Smoking Is Harmless. It Isn't.

The most-downloaded lung-cancer dataset on the internet, run through the obvious analysis, says smoking barely matters for cancer. It is wrong, and the reason it is wrong is a trap every data scientist should be able to see. Smoking causes the large majority of lung cancer, and there is no safe amount.

share: · LinkedIn · X

Somewhere right now, someone is learning that smoking does not cause lung cancer. Not from a tobacco company, from a spreadsheet. They downloaded the most popular lung-cancer dataset on Kaggle, a tidy file called “survey lung cancer,” and did the sensible thing: they asked which of its columns best predicts who has the disease. The answer put smoking dead last, behind allergy, behind alcohol, behind a cough. Trust the file, and you would conclude that the single most preventable cause of cancer on earth is a rounding error.

They did nothing wrong with the code. That is exactly what makes this dangerous. This is a story about how a clean, popular dataset can quietly teach the opposite of one of the most settled facts in medicine, and how to catch it before it teaches you.

The seduction

The file is real, in the sense that it is not fabricated: 309 people and sixteen columns each, a row of yes-or-no symptoms ending in a lung-cancer diagnosis. It has been downloaded nearly 70,000 times and sits behind 174 public notebooks. Run the obvious analysis, correlate each column with the diagnosis, and this is the ranking that comes back.

Horizontal bar chart ranking 15 features by their correlation with a lung-cancer diagnosis in the file; allergy and alcohol are on top, smoking is last with a correlation of 0.06
Kaggle “survey lung cancer” file (309 rows), each column’s correlation with a lung-cancer diagnosis. Allergy and alcohol look like the strongest signals; smoking looks like the weakest. This is an artifact of a broken sample, not a fact about smoking.

Allergy looks like the leading indicator of lung cancer. Alcohol comes second. Smoking, the very thing the dataset’s own title asks about, comes fifteenth of fifteen, with a correlation of 0.06, statistically indistinguishable from noise. A model built on this file learns to shrug at cigarettes.

Why the file lies

The problem is not in the columns. It is in who is in the file at all. The data comes from an online “lung cancer prediction system,” a website people visit because they are already worried. Of the 309 people in it, 270 already have lung cancer. The cancer rate is 87 percent.

That one fact breaks everything. To learn what causes a disease, you need people who have it and people who do not, and enough of both to compare. This file is almost all patients. There is no healthy world left to hold up against the sick one.

Two bars showing that 89 percent of smokers and 85 percent of non-smokers in the file have cancer, a non-significant difference, with 87 percent of everyone in the file already diagnosed
Kaggle “survey lung cancer” file. 87 percent of everyone in it already has cancer, so there is no healthy comparison group. Smokers (89 percent) and non-smokers (85 percent) barely differ, and the gap is not significant (odds ratio 1.42, p = 0.39).

Watch what that does to smoking. Among smokers in the file, 89 percent have cancer. Among non-smokers, 85 percent. That four-point gap is not a real difference; a formal test puts the odds ratio at 1.4 with a p-value of 0.39, which in plain language means “we found nothing.” When almost everyone you sampled is already sick, nothing you measure can stand out as a cause, because there is barely any not-sick left to explain. Statisticians call this selection bias, and it is one of the most common ways good data tells a confident lie. Here is a tell: in this file, smoking shows no positive link to yellow fingers or to coughing, its two most obvious real-world signatures, and the cough, if anything, points the wrong way. The sample is simply too narrow to carry the truth.

The truth the file cannot hold

So step outside the file, to the evidence built on whole populations instead of the worried few.

The link between smoking and lung cancer is not a hypothesis. It is one of the most thoroughly established causal relationships in the history of medicine. In 1950, Richard Doll and Austin Bradford Hill compared lung-cancer patients with matched controls and found that almost none of the patients were lifelong non-smokers. They concluded that smoking is “a factor, and an important factor, in the production of carcinoma of the lung” (Doll & Hill, 1950). Then they followed tens of thousands of British doctors for fifty years. Cigarette smokers died about ten years younger than non-smokers, and about two-thirds of the persistent smokers in one cohort were eventually killed by the habit (Doll et al., 2004).

Today the numbers are only sharper. Smoking causes about nine of every ten lung cancers in men and about eight of ten in women (National Cancer Institute, 2025); the CDC attributes 80 to 90 percent of lung-cancer deaths to it (Centers for Disease Control and Prevention, 2024). Lung cancer is the leading cause of cancer death in the United States, an estimated 124,990 deaths this year alone (National Cancer Institute, 2026).

And there is no safe amount. This is the part the file most dangerously hides. A study of nearly 300,000 adults found that people who averaged fewer than one cigarette a day across their lives still had about nine times the risk of dying from lung cancer as people who never smoked. One to ten a day carried nearly twelve times the risk (Inoue-Choi et al., 2017). A regular smoker runs about twenty-five times the risk (Thun et al., 2013).

Bar chart of lung-cancer death risk versus never-smokers: under one cigarette a day is 9 times, one to ten a day is 12 times, a regular smoker about 25 times, all towering over the 1.4 the Kaggle file detected
Risk of dying of lung cancer versus never-smokers. Under 1 and 1 to 10 cigarettes a day: Inoue-Choi et al. (2017), a cohort of 290,215 adults. Regular smokers about 25 times: Thun et al. (2013). There is no safe level.

Put the file’s 1.4 next to that wall of real risk and you can see exactly how much it missed. The National Cancer Institute’s summary of the evidence is one sentence long: “there is no safe level of exposure to tobacco smoke” (National Cancer Institute, 2016). Not a light habit, not the occasional one at a party. Any amount.

Why this is not an abstraction

This is not only an American story, and I am writing from a country where the comforting version is unusually easy to believe.

Bar chart showing 65.5 percent of Indonesian men use tobacco versus 3.3 percent of women and 34.5 percent of all adults, from the 2021 Global Adult Tobacco Survey
Global Adult Tobacco Survey, Indonesia 2021 (Ministry of Health, WHO, CDC). Roughly two-thirds of men use tobacco, about 70 million users, among the world’s highest rates. The average smoker started at about sixteen.

In Indonesia, roughly two-thirds of adult men use tobacco, among the highest rates in the world. The 2021 Global Adult Tobacco Survey counted about 70 million tobacco users, and the average smoker had started at about sixteen (Ministry of Health Republic of Indonesia et al., 2022). In a place where the habit is that ordinary, a dataset that whispers “smoking barely matters” is not a harmless curiosity. It is the exact wrong lesson, delivered with the authority of a number.

The data wasn’t lying. It couldn’t see.

Here is the uncomfortable part. The file did not lie. Every value in it is a real answer from a real person, and the analysis, run correctly, faithfully reported what it found. The file simply could not see what it was never built to see. The mistake was not in the code. It was in trusting a convenient sample to answer a question it could not answer.

That is the habit worth building, more than any model. Before you believe what a dataset tells you, ask who is in it and who is missing. This one forgot the healthy. Ask what a clean, comfortable answer is quietly leaving out, because the next dataset that hands you a tidy conclusion will look exactly as trustworthy as this one did, and you will have written the code yourself.

Smoking causes lung cancer. No spreadsheet, however popular, changes that, and there is no amount small enough to be safe. If a file ever tells you otherwise, it is not the science that is wrong. It is the file, and it is you, if you believe it. This is a description of how data misleads, not medical advice. If you do smoke, the most useful fact in this piece is the one the same British doctors study found at the other end: quitting lowers the risk at any age, and the earlier the better.

Method notes

The “survey lung cancer” file (Kaggle, mysarahmadbhat, 309 rows) is used here only to illustrate the selection-bias trap, never as evidence about real causation. The file is 87 percent cancer patients and contains 33 exact duplicate rows; smoking’s correlation with a diagnosis is 0.06, last of fifteen features, and the smoker versus non-smoker difference is not significant (Fisher exact odds ratio 1.42, p = 0.39). Even a smarter analysis does not rescue the file: adjusting for age, sex, and the symptom columns nudges smoking to a positive but marginal signal (odds ratio about 2.5, p = 0.03) that disappears once the 33 duplicate rows are removed (p = 0.07), and that adjustment leans on symptoms which are themselves consequences of cancer, which manufactures associations in a picked sample rather than recovering real ones. Neither route gives a trustworthy answer, which is the point. The real-world figures come from primary sources. Smoking’s share of lung cancer (about nine in ten cases in men, eight in ten in women) is from the National Cancer Institute; the 80 to 90 percent of lung-cancer deaths figure and lung cancer as the leading US cancer death (an estimated 124,990 deaths in 2026) are from the CDC and NCI SEER. The relative-risk figures for under one and one to ten cigarettes a day are from Inoue-Choi et al. (2017), a cohort of about 290,000 adults, giving lung-cancer mortality about nine and twelve times that of never-smokers; the roughly 25 times for current smokers is from Thun et al. (2013). The historical anchor is Doll and Hill (1950) and the 50-year British Doctors follow-up (Doll et al., 2004), the source of the “about ten years younger,” “about two-thirds killed,” and quitting figures. “No safe level of exposure to tobacco smoke” is the National Cancer Institute’s phrasing (2016). The Indonesia figures are the Global Adult Tobacco Survey Indonesia 2021 (Ministry of Health, WHO, and CDC). The person in the opening is an illustrative composite, not a real individual. Code and data are on GitHub: github.com/joechrisnaldy/data-stories.

References

Centers for Disease Control and Prevention. (2024). Lung cancer risk factors. https://www.cdc.gov/lung-cancer/risk-factors/index.html

Doll, R., & Hill, A. B. (1950). Smoking and carcinoma of the lung: Preliminary report. British Medical Journal, 2(4682), 739-748. https://doi.org/10.1136/bmj.2.4682.739

Doll, R., Peto, R., Boreham, J., & Sutherland, I. (2004). Mortality in relation to smoking: 50 years’ observations on male British doctors. BMJ, 328(7455), 1519. https://doi.org/10.1136/bmj.38142.554479.AE

Inoue-Choi, M., Liao, L. M., Reyes-Guzman, C., Hartge, P., Caporaso, N., & Freedman, N. D. (2017). Association of long-term, low-intensity smoking with all-cause and cause-specific mortality in the National Institutes of Health-AARP Diet and Health Study. JAMA Internal Medicine, 177(1), 87-95. https://doi.org/10.1001/jamainternmed.2016.7511

Ministry of Health Republic of Indonesia, World Health Organization, & Centers for Disease Control and Prevention. (2022). Global Adult Tobacco Survey (GATS) fact sheet: Indonesia 2021. World Health Organization. https://cdn.who.int/media/docs/default-source/ncds/ncd-surveillance/data-reporting/indonesia/indonesia-national-2021-factsheet.pdf

National Cancer Institute. (2016, December 5). No safe level of smoking: Even low-intensity smokers are at increased risk of earlier death. National Institutes of Health. https://www.cancer.gov/news-events/press-releases/2016/low-intensity-smoking-risk

National Cancer Institute. (2025). Lung cancer prevention (PDQ): Patient version. National Institutes of Health. https://www.cancer.gov/types/lung/patient/lung-prevention-pdq

National Cancer Institute. (2026). Cancer stat facts: Lung and bronchus cancer. Surveillance, Epidemiology, and End Results (SEER) Program. https://seer.cancer.gov/statfacts/html/lungb.html

Thun, M. J., Carter, B. D., Feskanich, D., Freedman, N. D., Prentice, R., Lopez, A. D., Hartge, P., & Gapstur, S. M. (2013). 50-year trends in smoking-related mortality in the United States. New England Journal of Medicine, 368(4), 351-364. https://doi.org/10.1056/NEJMsa1211127

// About the author

Jonathan Chrisnaldy is a product manager and analyst in New York City, with an M.S. in Technology Management from Columbia University. He writes data stories about the numbers behind everyday claims. More on the experience page or LinkedIn.