2024-02-01

Slide 1: Introduction

What is Simple Linear Regression?

Simple Linear Regression is a statistical method that allows us to model the relationship between a dependent variable (response) and a single independent variable (predictor). It helps us understand and predict the behavior of the dependent variable based on the independent variable.

Why Simple Linear Regression?

- Simple and interpretable model

- Useful for understanding the linear relationship between two variables

- Basis for more complex regression techniques

Slide 2: Simple Linear Regression Example Data

Variable Value
Mean X 0.0904059
Mean Y 0.0732650
Correlation 0.8786993
Intercept -0.1028031
Slope 1.9475284

Slide 3: ggplot 1

Slide 4: ggplot 2

Slide 5: plotyplot

Slide 6: Math Equations in Latex (1)

The probability density function (PDF) of the normal distribution is given by:

\[ f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}} \]

where \(\mu\) is the mean and \(\sigma\) is the standard deviation.

Slide 7: Math Equations in Latex (2)

The probability mass function (PMF) of the binomial distribution is given by:

\[ P(X = k) = \binom{n}{k} p^k (1-p)^{n-k} \]

where \(n\) is the number of trials, \(k\) is the number of successes, and \(p\) is the probability of success.

Slide 8: R Code

# This slide has a code snippet and also small explaination for the same!
# Set seed for reproducibility
set.seed(123)
# Generate random data
x <- rnorm(100)
y <- 2 * x + rnorm(100)
# Fit linear regression model
model <- lm(y ~ x)
# Create a data frame for plotting
plot_data <- data.frame(x, y)
# Create a ggplot with the linear regression line
gg <- ggplot(plot_data, aes(x = x, y = y)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE, color = "blue") +
  labs(title = "Simple Linear Regression Plot", x = "X-axis", y = "Y-axis")

Slide 9

Thankyou! Hope you liked my presentation