2024-10-17

## 
## 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

Step 1

\(\bullet\) State the null hypothesis

The null hypothesis is what is being tested

In the following example we are testing to see if all the population means are equal

\(H_0 = \mu_1 > \mu_2\)

\(H_0 =\) The null hypothesis
\(\mu_n =\) The population mean

Step 2

\(\bullet\) State the alternate hypothesis

The alternate hypothesis is what makes the null hypothesis false

With the same example the alternate hypothesis would be

\(H_1 = \mu_1 < \mu_2\)

\(H_1 =\) The alternate hypothesis

\(\mu_n =\) the population mean

Step 3

\(\bullet\) Set the \(\alpha\) value

The \(\alpha\) value is the confidence level

The standard is a confidence level of 95% or \(\alpha = 0.05\)

With this we can create a table of all possible outcomes

\(H_0\) is True \(H_0\) is False
Accept \(H_0\) Correct Type II Error
Reject \(H_0\) Type I Error Correct

Step 3.5

A visual interpretation of 95% confidence level. The area is probability that event in wrong while the green is correct

Step 4

\(\bullet\) Collect the data

Some useful tools is plotly’s interactive box plot to examine the data prior to preforming F-test

Step 5

\(\bullet\) Calculate the needed F statistic

To find your f statitic use this R code

qf(p,df1,df2,lower.tail=FALSE)****

p is the significance level for this case 0.05

df1 is the numerator degrees of freedom

df2 is the denominator degrees of freedom

This code returns the f statistic from the F table

Like below with input qf(0.05, 2, 20,lower.tail=FALSE) outputs

## [1] 3.492828

Step 6

\(\bullet\) Establish acceptance zones for null hypothesis
The green is the probability the null hypothesis is accepted, red being rejected

Step 7

\(\bullet\) Make conclusions

If your calculated F statistic from your one way ANOVA test is higher than the F value from the table then you must reject the null hypothesis

If your calculated F statistic is less than the F table result then you fail to reject the null hypothesis