Knicks_Rev <- read.csv("knicks rev.csv")
colnames(Knicks_Rev) <- c("Year","Rev")
Metro_GDP <- read.csv("metro gdp.csv")
Draft_Pick <- read.csv("Pick.csv")
Payroll <- read.csv("Team Payroll.csv")
Attendence_Wins <- read.csv("Attendence and wins.csv")
Disposable_Income <- read.csv ("Disposable income ny.csv")

This will take all of the data I have in excel and bring it over to R and sort all of it out. The data that I will be using is the Knicks team revenue, the teams payroll, the GDP of the New York metro area, Knicks first draft pick, Disposable income per capita in NY, average attendence per game, and the Knicks win Percentage.

Data1 <- merge(Draft_Pick, Knicks_Rev)
Data1 <- merge(Data1,Metro_GDP)
Data1 <- merge(Data1,Payroll)
Data1 <- merge(Data1,Disposable_Income)
Data1 <- merge(Data1,Attendence_Wins)
library("ggplot2")

This action will simply merge all of my data into a data set called data1.

plot <- ggplot(Data1,aes(Year, First.Number.Pick.they.had.In.the.Draft))

plot + geom_point(aes(size=Team.Win.percentage,color=Average.attendence.per.game)) + geom_smooth(method="lm")

This plot shows that more recently the Knicks win percentage has increased then had a significant drop off. It also shows that the even with a Good pick in the draft(top 10), it really hasnt shown any improvement in the teams win percentage from the year before. Some possible reasons for showing no positive correlation is that the teams can draft someone high but wont live up to/ play up to the high standards they were supposed to play at.

plot <- ggplot(Data1,aes(Year, First.Number.Pick.they.had.In.the.Draft))

plot + geom_point(aes(size=Rev,color=GDP.of.the.New.York.metro.area)) + geom_smooth(method="lm")

This plot shows that since 2001 the New York metro area and the Knicks team revenue have both had a steady increase over the years.

plot <- ggplot(Data1,aes(Year, Team.Win.percentage))

plot + geom_point(aes(size=Rev,color=Payroll)) + geom_smooth(method="lm")

This plot shows that over the years the teams win percentge has been pretty consistant, it had gone up during the 2010-2012 seasons then straight down hill to a franchise low of .207%. This also shows that as teams Revenue has gone up consistantly over the years that the payroll has flucuated but the winning years tend show some of the lower team payroll years.

plot <- ggplot(Data1,aes(Year, Rev))

plot + geom_point(aes(size=Per.Capita.Personal.Disposable.Income.in.NY,color=GDP.of.the.New.York.metro.area)) + geom_smooth(method="lm")

This plot shows that the Teams Revenue, GDP in New York metro area, and Disposable Income per capita in New York have all gone up at a consistent pace from 2001-2014.

out <- lm(formula = First.Number.Pick.they.had.In.the.Draft ~ Team.Win.percentage + Rev + Per.Capita.Personal.Disposable.Income.in.NY + GDP.of.the.New.York.metro.area + Payroll + Average.attendence.per.game,data=Data1)
summary(out)
## 
## Call:
## lm(formula = First.Number.Pick.they.had.In.the.Draft ~ Team.Win.percentage + 
##     Rev + Per.Capita.Personal.Disposable.Income.in.NY + GDP.of.the.New.York.metro.area + 
##     Payroll + Average.attendence.per.game, data = Data1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -15.4953 -10.7596   0.5148   8.8205  19.9305 
## 
## Coefficients:
##                                               Estimate Std. Error t value
## (Intercept)                                  4.774e+01  3.665e+02   0.130
## Team.Win.percentage                         -4.104e+00  6.022e+01  -0.068
## Rev                                          8.051e-07  6.173e-07   1.304
## Per.Capita.Personal.Disposable.Income.in.NY -2.621e-03  5.349e-03  -0.490
## GDP.of.the.New.York.metro.area              -9.174e-11  2.414e-10  -0.380
## Payroll                                      6.707e-08  4.332e-07   0.155
## Average.attendence.per.game                  6.776e-04  1.650e-02   0.041
##                                             Pr(>|t|)
## (Intercept)                                    0.900
## Team.Win.percentage                            0.948
## Rev                                            0.233
## Per.Capita.Personal.Disposable.Income.in.NY    0.639
## GDP.of.the.New.York.metro.area                 0.715
## Payroll                                        0.881
## Average.attendence.per.game                    0.968
## 
## Residual standard error: 15.8 on 7 degrees of freedom
## Multiple R-squared:  0.3922, Adjusted R-squared:  -0.1287 
## F-statistic: 0.753 on 6 and 7 DF,  p-value: 0.6273

This will show that at the y intercept the draft pick will be around 47 and for every pick lower that the team will have the team win percentage has to decrease by .004. This also shows that every 80 increase in team revenue will have a .001 increase in the teasms win percentage.

library(lmtest)
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## 
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
bptest(out)
## 
##  studentized Breusch-Pagan test
## 
## data:  out
## BP = 11.593, df = 6, p-value = 0.0717

This shows that the data is marginal significant. Which means that it is homoskedastic but very close to being heteroskedastic.