2024-06-03

Plotly Plot

Scatter plots provide a an important role in hypothesis testing to provide data visualizations of correlation between two variables and to make assumptions on hypothesis testing

Ggplot Number 1

Normal distribution is used hypothesis testing for many operations. One being to see if the mean stated differs from mean in the null hypothesis.

Ggplot Number 2

In hypothesis testing there is a type two error called beta. This is called the power function test.

Composite Hypothesis

Types of Hypothesis test

Simple : \(H_0: \theta = \theta_0\) and \(H_1: \theta > \theta_0\)

Composite One-Sided:

\(H_0: \theta \leq \theta_0\) and \(H_1: \theta > \theta_0\)

or \(H_0: \theta \geq \theta_0\) and \(H_1: \theta > \theta_0\)

Two-Sides Hypotheses:

\(H_0: \theta = \theta_0\) and \(H_1: \theta \neq \theta_0\)

Type One and Type Two Error

In hypothesis testing there going to be errors and mistakes made.

There are test that can be run to calculate the probability of error.

Type I error:

-\(H_0\) is true (\(\theta \in \Theta_0\)) and \(a = a_1\).

Type II error:

-\(H_1\) is true (\(\theta \in \Theta_1\)) and \(a = a_0\).

R Code

This code was used to see beta distribution. Beta distribution is used to test the success of the hypothesis to test it.

# library(ggplot2)
# x_b = seq(0, 1, length = 50)
# y_b = dbeta(x_b, shape1 = 2, shape2 = 5)
# beta_df = data.frame(x_b, y_b)
# 
# ggplot(beta_df, aes(x = x_b, y = y_b)) +
#   geom_line(color = "orange") +
#   ggtitle("Beta Distribution") +
#   xlab("X")+
#   ylab("Frequency")

Conclusion

  • Hypothesis testing is statistic technique to get insights to make wise decisions on data
  • There are multiple types of hypothesis can they can me made and rules to follow.
  • Researchers and analysts use hypothesis testing to make informed decisions and make conclusions