02-05-2025

Intro

Topic: Simple Linear Regression

Objective: Explore the relationship between lung cancer prevalence and cigarette consumption across 25 countries.

Dataset: Lung Cancer Risk and Trends Across 25 Countries

Variables: Lung_Cancer_Prevalence_Rate: Dependent variable (Y)

Cigarettes_per_Day: Independent variable (X)

Simple Linear Regression

Definition: It is a method used in statistics indicating the relationship between the dependent variable which is Y and the independent variable which would be X. A straight line is used to see the relationship between the two variables.

Equation: \[ Y = \beta_0 + \beta_1 X + \epsilon \] - \(\beta_0\): Intercept - \(\beta_1\): Slope - \(\epsilon\): Error term

Scatter Plot

Simple Linear Regression

Call:
lm(formula = Lung_Cancer_Prevalence_Rate ~ Cigarettes_per_Day, 
    data = data)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.00710 -0.50056 -0.00056  0.49944  0.99944 

Coefficients:
                    Estimate Std. Error t value Pr(>|t|)    
(Intercept)        1.5005578  0.0015127 991.941   <2e-16 ***
Cigarettes_per_Day 0.0002180  0.0001255   1.736   0.0825 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.578 on 220630 degrees of freedom
Multiple R-squared:  1.366e-05, Adjusted R-squared:  9.13e-06 
F-statistic: 3.014 on 1 and 220630 DF,  p-value: 0.08253

Simple Linear Regression Model

  • Model Summary:
    • Intercept (\(\beta_0\)): 1.5
    • Slope (\(\beta_1\)): 0

Regression Line Visual

`geom_smooth()` using formula = 'y ~ x'

3D Model