Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- - - title: Hawks Analysis author: Your Name date: 2 0 2 3 - 0 1 - 3 0 output: word _

---
title: "Hawks Analysis"
author: "Your Name"
date: "2023-01-30"
output:
word_document: default
html_document: default
---
```{r message=FALSE, warning=FALSE}
library(table1)
library(tolerance)
library(infer)
library(tidyverse)
```
```{r include=FALSE}
hawks.df <- read.csv("Hawks_subset.csv")
```
## Comparing Tail Span in Hawks
Data were collected on random samples of three different species of hawks, Sharp-shinned (SS) and Cooper's hawks (CH).
## Question of Interest
# EDA
```{r echo=FALSE, message=FALSE, warning=FALSE}
table1( ~Tail | Species, data = hawks.df )
```
## Boxplot
```{r echo=FALSE, message=FALSE, warning=FALSE}
ggplot(hawks.df, aes(x = Species, y = Tail, colour=Species))+
geom_boxplot()+
labs(title = "Boxplot of Tail Span by Species",
subtitle ="(with mean symbol)",
caption = "Your Name",
y = "Tail Span",
x = "Species")+
stat_summary(fun=mean, geom="point", shape=20, size=5, color="darkblue", fill="darkblue")+
theme(legend.position = "none")
```
# Confidence Interval and Hypothesis Test for the Difference in the Population Mean Tail Span
```{r echo=FALSE, message=FALSE, warning=FALSE}
t.test(Tail ~ Species, mu=0, conf.level =0.95,
data = hawks.df)
```
## Confidence Interval for the Difference in Population Median Tail Span
```{r echo=FALSE, message=FALSE, warning=FALSE}
wilcox.test(Tail ~ Species, conf.int = TRUE,
conf.level =0.95, data= hawks.df)
```
## 95% Bootstrap CI for the Difference in the Population Mean Tail Span
```{r echo=FALSE, message=FALSE, warning=FALSE}
Tail.boot <- hawks.df %>%
specify(response = Tail, explanatory = Species)%>%
generate(reps =1000, type = "bootstrap")%>%
calculate(stat = "diff in means",
order = c("CH","SS"))
percentile_ci <- get_ci(Tail.boot)
Tail.boot %>% visualize()+ shade_confidence_interval(percentile_ci)+
labs(x="Difference (CH - SS) in Sample Mean Tail Span",
y= "Frequency",
title= "Hawk Analysis Bootstrap Distribution")
```
```{r echo=FALSE, message=FALSE, warning=FALSE}
percentile_ci <- get_ci(Tail.boot)
percentile_ci
```
## Tolerance Intervals
## CH Species
```{r echo=FALSE, message=FALSE, warning=FALSE}
CC.Tail <- hawks.df %>%
filter(Species %in%"CH")%>%
select(Tail)%>% drop_na(Tail)%>% as.data.frame()
normtol.int(CC.Tail$Tail,
alpha =0.05, P =0.95, side =2)
```
## SS Species
```{r echo=FALSE, message=FALSE, warning=FALSE}
SS.Tail <- hawks.df %>%
filter(Species %in%"SS")%>%
select(Tail)%>% drop_na(Tail)%>% as.data.frame()
normtol.int(SS.Tail$Tail,
alpha =0.05, P =0.95, side =2)
```

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

Students also viewed these Databases questions

Question

10:16 AM Sun Jan 29 Answered: 1 week ago

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago