HW3: Isoslides and Statistics

Made by: Nathan P

June 8th, 2024

## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout

Introduction : ‘Hypothesis Testing’

For this presentation project I choose to do the topic, hypothesis testing.

Now what is hypothesis testing in the world of Statistics? Hypothesis testing refers to the formal procedure in which statisticians investigate the world using statistics. Now this could be as simple as, which is a more popular bakary item, cookies or brownies; or it could be incredibly complex, which has a more threatening impact on our environments globally, deforestation or fossil fuels and their everyday usage?

Main Steps

Now there are 5 main steps in the process of hypothesis testing.

  1. State your hypothesis (as a null hypothesis and alternate hypothesis)

  2. Collect the data for testing of the hypothesis

  3. Perform appropriate statistical testing

  4. Decide whether to reject or cast out your null hypothesis

  5. Present your results and findings

These may vary depending on how you go about your testing and research but when you test your hypothesis, it will always follow these steps in some sort of regard.

My example of hypothesis testing | IRIS DATASET

Here’s a prime example of step 1:

H0: The flower species, virginica, is, on average, not bigger than the flower species, setosa and versicolor.

Ha: The flower species, virginica, is, on average, are bigger than the flower species, setosa and versicolor.

Displaying the data - Code (p1)

mod = lm(Sepal.Length ~ Sepal.Width, data = iris)
x = iris$Sepal.Length; y = iris$Sepal.Width

xax <- list(
  title = "Sepal Length",
  titlefont = list(family="Modern Computer Roman")
)

yax <- list(
  title = "Sepal Width",
  titlefont = list(family =("Modern Computer Roman")),
  range = c(0,10)
)
fig <- plot_ly(x=x, y=y, type="scatter", mode="markers", name="Iris Sepel Data",
               width = 800, height=430) %>%
              add_lines(x = x, y = fitted(mod), name="fitted") %>%
              layout(xaxis = xax, yaxis = yax) %>%
              layout(margin = list(
                l = 150,
                r = 50,
                b = 20,
                t = 40
              )
              
            )
config(fig, displaylogo=FALSE)

Displaying the data (ScatterPlot) - Graph (p2)

Displaying the data (BoxPlot) - First Graph, Length (p1)

boxplot(formula = Petal.Length ~ Species, data = iris)

Displaying the data (BoxPlot) - Second Graph, Width (p2)

boxplot(formula = Petal.Width ~ Species, data = iris)