diff --git a/Mini Project Byers.pptx b/Mini Project Byers.pptx new file mode 100644 index 0000000..39ef7fa Binary files /dev/null and b/Mini Project Byers.pptx differ diff --git a/idea1.html b/idea1.html new file mode 100644 index 0000000..363b54a --- /dev/null +++ b/idea1.html @@ -0,0 +1,446 @@ + + + + + + + + + + + + + +idea1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Idea #1

+

1) Research +Question

+

How do the number/type of roads/factories/oil wells in an area impact +the number of air quality and asthma/lung health issues? I want to +explore if more factories in an area coincides with more lung health +issues and the same with more roads and oil wells in the area. I also +want to see if an increase in factories results in worse air quality, as +well as the same process with roads and oil wells. I am thinking of +confining this research to Pennsylvania as it is easier to find county +by county data if you focus on one state and I feel that state by state +data is too broad for my idea.

+

2) Data +source

+

a) With details about how you +will get the data

+

b) What variables the dataset has +or you will create

+

c) This can get pretty long, +which is fine!

+

I plan to use data about the road systems such as the miles of road +in each state, broken down by rural/urban, interstate/not. This data +comes from the US Department of Transportation Federal Highway +Administration and is state by state. I found detailed road information +for PA cities.

+

I found data from the US Census regarding the types and number of +each type of business in every county of each US state. This data is +available from 2002 to 2022.

+

I have found data through the Center for Disease Control that +supplies the number and percentage of people with asthma in each state +from 1999 to 2020. I have also found data from Pennsylvania Commonwealth +detailing the percentage of students who have asthma by county.

+

I found data showing how many oil and gas wells have been drilled in +each county of Pennsylvania and it can be displayed by whatever dates +you want to search for. This data is from the Pennsylvania Department of +Environmental Protection.

+

3) What you will do with the +data, EDA, model specification.

+

I want to create heat maps with the amount of roads per county, oil +wells and factories. I would also break this down by population and land +size as well. I would repeat the same process with number of people with +lung health issues. I would try to create a model that predicted the +number/percentage of people with lung issues/asthma based on roads, +factories, air quality and oil/gas wells.

+ + + + +
+ + + + + + + + + + + + + + + diff --git a/idea1.md b/idea1.md new file mode 100644 index 0000000..6f3090d --- /dev/null +++ b/idea1.md @@ -0,0 +1,30 @@ +**Idea #1** + + +**1) Research Question** + +How do the number/type of roads/factories/oil wells in an area impact the number of air quality and asthma/lung health issues? I want to explore if more factories in an area coincides with more lung health issues and the same with more roads and oil wells in the area. I also want to see if an increase in factories results in worse air quality, as well as the same process with roads and oil wells. I am thinking of confining this research to Pennsylvania as it is easier to find county by county data if you focus on one state and I feel that state by state data is too broad for my idea. + +** +2) Data source** + +* +a) With details about how you will get the data* + +* +b) What variables the dataset has or you will create* + +* +c) This can get pretty long, which is fine!* + +I plan to use data about the road systems such as the miles of road in each state, broken down by rural/urban, interstate/not. This data comes from the US Department of Transportation Federal Highway Administration and is state by state. I found detailed road information for PA cities. + +I found data from the US Census regarding the types and number of each type of business in every county of each US state. This data is available from 2002 to 2022. + +I have found data through the Center for Disease Control that supplies the number and percentage of people with asthma in each state from 1999 to 2020. I have also found data from Pennsylvania Commonwealth detailing the percentage of students who have asthma by county. + +I found data showing how many oil and gas wells have been drilled in each county of Pennsylvania and it can be displayed by whatever dates you want to search for. This data is from the Pennsylvania Department of Environmental Protection. + +**3) What you will do with the data, EDA, model specification.** + +I want to create heat maps with the amount of roads per county, oil wells and factories. I would also break this down by population and land size as well. I would repeat the same process with number of people with lung health issues. I would try to create a model that predicted the number/percentage of people with lung issues/asthma based on roads, factories, air quality and oil/gas wells. diff --git a/idea2.html b/idea2.html new file mode 100644 index 0000000..26a0d7d --- /dev/null +++ b/idea2.html @@ -0,0 +1,438 @@ + + + + + + + + + + + + + +idea2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Idea #2

+

1) Research +Question

+

I would like to research how to predict the winner of a basketball +game. What factors play bigger parts in determining a win? Number of +assists, number of steals, 3 point percentage, field goal percentage, +free throws, time in possession, and turnovers are some of the +statistics I’d like to look at. This analysis could have an impact on +winning more games which is always the goal of sports.

+

2) Data +source

+

a) With details about how you +will get the data

+

b) What variables the dataset has +or you will create

+

c) This can get pretty long, +which is fine!

+

Dickinson mens basketball has given me access to their databases +which include data about their team going back to 2015 and all NCAA mens +basketball teams. They have every statistic I mentioned above and many +many more.

+

3) What you will do with the +data, EDA, model specification.

+

I want to create some visualizations and maybe shot heat maps before +creating a model - likely a mixed effects regression model to determine +points scored and also maybe a mixed effects logistical model +determining whether Dickinson will win the game or not.

+

4) What are some ethical +considerations for this topic?

+

I don’t think there are many ethical considerations as the data is +only about basketball which is not really a sensitive topic. There is no +personal information about players beyond height, weight, year and name +(name can be easily excluded from results if desired). I will need to +talk to the basketball coaches about where this data can go but from our +first meeting they seemed very open with me using it in a class for a +project.

+ + + + +
+ + + + + + + + + + + + + + + diff --git a/idea2.md b/idea2.md new file mode 100644 index 0000000..e284ba5 --- /dev/null +++ b/idea2.md @@ -0,0 +1,28 @@ +**Idea #2** + + +**1) Research Question** + +I would like to research how to predict the winner of a basketball game. What factors play bigger parts in determining a win? Number of assists, number of steals, 3 point percentage, field goal percentage, free throws, time in possession, and turnovers are some of the statistics I'd like to look at. This analysis could have an impact on winning more games which is always the goal of sports. I would also like to try predicting stats like which players will have a double-double in a game. + +** +2) Data source** + +* +a) With details about how you will get the data* + +* +b) What variables the dataset has or you will create* + +* +c) This can get pretty long, which is fine!* + +Dickinson mens basketball has given me access to their three databases which include data about their team going back to 2015 and all NCAA mens basketball teams. They have every statistic I mentioned above and many many more. + +**3) What you will do with the data, EDA, model specification.** + +I want to create some visualizations and maybe shot heat maps before creating a model - likely a mixed effects regression model to determine points scored and also maybe a mixed effects logistical model determining whether Dickinson will win the game or not. + +**4) What are some ethical considerations for this topic?** + +I don't think there are many ethical considerations as the data is only about basketball which is not really a sensitive topic. There is no personal information about players beyond height, weight, year and name (name can be easily excluded from results if desired). I will need to talk to the basketball coaches about where this data can go but from our first meeting they seemed very open with me using it in a class for a project. diff --git a/idea3.html b/idea3.html new file mode 100644 index 0000000..8559cbb --- /dev/null +++ b/idea3.html @@ -0,0 +1,438 @@ + + + + + + + + + + + + + +idea3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

Idea #3

+

1) Research +Question

+

I have read about Monte Carlo simulations and I would like to try to +do some with basketball win percentage. What are the odds Dickinson Mens +Basketball wins a game against a certain team based on a set of +factors?

+

2) Data +source

+

a) With details about how you +will get the data

+

b) What variables the dataset has +or you will create

+

c) This can get pretty long, +which is fine!

+

Dickinson mens basketball has given me access to their databases +which include data about their team going back to 2015 and all NCAA mens +basketball teams. They have statistics as a team and as individual +players for all the basic statistics like free throw %, field goal %, 3 +point %, steals, assists, time with possession and turnovers. They also +have many more statistics for team and individual.

+

3) What you will do with the +data, EDA, model specification.

+

I would run Monte Carlo simulations after creating data +visualizations of the variables I chose to use in the simulations. I +would run simulations of past games to see what the accuracy percentage +of the predictor is before using it to predict upcoming games.

+

4) What are some ethical +considerations for this topic?

+

I don’t think there are many ethical considerations as the data is +only about basketball which is not really a sensitive topic. There is no +personal information about players beyond height, weight, year and name +(name can be easily excluded from results if desired). I will need to +talk to the basketball coaches about where this data can go but from our +first meeting they seemed very open with me using it in a class for a +project.

+ + + + +
+ + + + + + + + + + + + + + + diff --git a/idea3.md b/idea3.md new file mode 100644 index 0000000..f277876 --- /dev/null +++ b/idea3.md @@ -0,0 +1,30 @@ +**Idea #3** + + +**1) Research Question** + +I have read about Monte Carlo simulations and I would like to try to do some with basketball win percentage. What are the odds Dickinson Mens Basketball wins a game against a certain team based on a set of factors? + + +** +2) Data source** + +* +a) With details about how you will get the data* + +* +b) What variables the dataset has or you will create* + +* +c) This can get pretty long, which is fine!* + +Dickinson mens basketball has given me access to their three databases which include data about their team going back to 2015 and all NCAA mens basketball teams. They have statistics as a team and as individual players for all the basic statistics like free throw %, field goal %, 3 point %, steals, assists, time with possession and turnovers. They also have many more statistics for team and individual. + +**3) What you will do with the data, EDA, model specification.** + +I would run Monte Carlo simulations after creating data visualizations of the variables I chose to use in the simulations. I would run simulations of past games to see what the accuracy percentage of the predictor is before using it to predict upcoming games. + + +**4) What are some ethical considerations for this topic?** + +I don't think there are many ethical considerations as the data is only about basketball which is not really a sensitive topic. There is no personal information about players beyond height, weight, year and name (name can be easily excluded from results if desired). I will need to talk to the basketball coaches about where this data can go but from our first meeting they seemed very open with me using it in a class for a project. diff --git a/miniproject.R b/miniproject.R new file mode 100644 index 0000000..085a654 --- /dev/null +++ b/miniproject.R @@ -0,0 +1,97 @@ +#read in data +co2emis <- read.csv("/Users/magsb/Downloads/per-capita-co2-sector.csv") +asthma <- read.csv("/Users/magsb/Documents/Downloads/county_asthma.csv") +miles <- read.csv("/Users/magsb/Downloads/miles.csv") + +#packages +library(ggplot2) +library(tidyverse) +library(gridExtra) +library(reshape2) + +#add data column to asthma dataframe +asthma$per_diag <- + c(8.61, 7.94, 7.99, 6.15, 6.01, 8.98, 17.27, 8.97, 10.33) + +#EDA +co2emis |> + ggplot(aes(x = Year, y = manufacturing.and.construction, color = "blue")) + + geom_point() + +co2emis |> + ggplot(aes(x = Year, y = energy.production, color = "green")) + + geom_point() + + + +plot3 <- asthma |> + ggplot(aes(x = County, y = conventional_wells+unconventional_wells, fill = County)) + + geom_col() + + labs( + y = "Number of Wells", + title = "Number of Unconventional and Conventional Wells" + ) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + + scale_fill_brewer(palette="Paired") + + theme(legend.position = "none") +plot3 + +plot2 <- asthma |> + ggplot(aes(x= County, y = Asthma_hosp, fill = County)) + + geom_col() + + labs( + y = "Hospitalization Rate", + title = "Hospitalization Rate for Childhood Asthma", + caption = "Number of children hospitalized per 100,000" + ) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + + scale_fill_brewer(palette="Paired") + + theme(legend.position = "none") +plot2 + +plot1 <- miles |> + ggplot(aes(x = County, y = truck_dvmt, fill = County )) + + geom_col() + + labs(y = "Daily Vehicular Miles Traveled", + title = "Truck only DVMT per County")+ + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + + scale_fill_brewer(palette="Paired") + + theme(legend.position = "none") +plot1 + + + +grid.arrange(plot1, plot2, plot3, ncol=3) + + + +trucks <- miles |> + ggplot(aes(x = County, y = truck_dvmt, fill = County )) + + geom_col() + + labs(y = "Daily Vehicular Miles Traveled for Trucks", + title = "Truck DVMT per county")+ + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +trucks + + + +df2 <- melt(asthma, id.vars='County') +df2 <- df2 |> filter(variable == "Asthma_hosp" | variable == "per_diag") +head(df2) + +ggplot(df2, aes(x=County, y=value, fill=variable)) + + geom_bar(stat='identity', position='dodge') + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + +plot4 <- asthma |> + ggplot(aes(x= County, y = per_diag, fill = County)) + + geom_col() + + labs( + y = "Percent Diagnosed", + title = "Percent of K-12 Students Diagnosed with Asthma" + ) + + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) + + scale_fill_brewer(palette="Paired") + + theme(legend.position = "none") +plot4 \ No newline at end of file