Question
Apply an ANOVA test on supp and dose to check whether the len isdiffers with supp and/or with dose. we will have to compare betweenOJ
Apply an ANOVA test on supp and dose to check whether the len isdiffers with supp and/or with dose. we will have to compare betweenOJ and VC. also, 0.5, 1.0, and 2.0. and we will use res =st.f_oneway(vector1, vector2) to apply ANOVA. before doing that wewill have to prepare and filter the data (according to dose orsupp) then putting the data in new variable)
len | supp | dose |
2.4 | OJ | 0.5 |
3.5 | VC | 1.0 |
3 | OJ | 0.5 |
5 | VC | 2.0 |
import numpy as np
import pandas as pd
import scipy.stats as st
import matplotlib.pyplot as plt
import os
%matplotlib inline
Answer the following questions by providing Python code:
We will use the dataset "data_ToothGrowth.csv".
- len = teeth length.
- supp = supplementary type with two possible values: VC (vitaminC) or OJ (orange juice).
- dose (mgr/day) = dosage per day with three possible values:0.5, 1.0, 2.0.
df = pd.read_csv('data_ToothGrowth.csv', header='infer')
1). Perform the EDA and ANOVA (?= 5%) with the 'supp'variable.
Summarize the result.
i) # Categories of 'supp'.
ii)
# Group by category.
iii)
# Multiple Boxplots.
iv)
# ANOVA.
iiv)
# Result summary.
2). Perform the EDA and ANOVA (?= 5%) with the 'dose'variable.
Summarize the result.
i)
# Categories of 'dose'.
ii)
# Group by category.
iii)
# Multiple Boxplots.
v)
# ANOVA.
iv)
# Result summary.
Answer by using Python
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
To perform the EDA and ANOVA on the supp variable and the dose variable well follow these steps Load the data and perform the EDA for supp Perform ANOVA for supp and summarize the results Perform the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started