Introduction

The data set we are using represents the daily total of cyclist counts on the Queensboro Bridge. The data was collected from the Traffic Information Management Systems(TIMS). Each of the records shows the total number of cyclists per 24 hours at the Queenboro Bridge.

Data Description

Date = The observation ID

Day = Day of the week the data was collected

HighTemp = High temperature projected for the day

LowTemp = low temperature projected for the day

Precipitation = Precipitation amount for the day

Queensboro Bridge = Bridge the data was conducted on

Total = Total amount of cyclists per day

Before we use the data set we had to change the original form it is in. Both Queenboro Bridge and Total contained commas which made them character values. To use these variables in our model we removed the commas which resulted in them becoming numeric and therefore usable for the mode.

Research Question

The research question is the amount of cyclist crossing the Queensboro Bridge independent based on Hightemp, Lowtemp, Precipitation, and weekday.

Poisson Regression

The poisson regression model analyzes counts of data. The model looks at how much the independent variables influence the rate.

The regression model is:

\(log(Response) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + ... + \beta_p x_p\)

The poisson regression model has 4 basic assumptions:

Poisson Response: the response variable is a count per unit of time or space described by poisson distribution

Independence: The observations are independent from one another

Mean and Variance are equal: The mean of a poisson random variable must be equal to the variance; if this assumption fails it will result into an issue of dispersion.

Linearity: The log of the mean rate is a linear function of lambda

To begin we start by looking at a poisson regression model using the glm() function. We ignore the total amount of cyclists who cross the bridge each day from the data set. We ignore this observation because it is not important to the model as we are trying to see the amount of cyclists who cross the bridge based on weather and week day.

The poisson regression table coefficients show that everything but Low Temp, Monday, and Thursday are statistically significant. Showing that if we look at cyclist count across weather and weekday there will is evidence to support possible discrepancy between weather and weekday. The significance of the model however does not imply the model is important. There are many things that could impact the statistical significance of some variables such as: sample size, effect size, variability, correlation, random chance, and multiple comparisons.

When looking at Low temp, Monday, and Thursday there is no significant evidence to show potential discrepancy across weather and weekday.

The total population of cyclists for each day also depends on the number of days the data was taken. We ignore the total cyclists for each day of the days a sample was taken which implies the sample was not used effectively.

Poisson Regression on rates

Through a poisson regression on rates we can determine that the mean count is proportional to t.

The poisson rates model uses log(t) as an offset. The offset is an adjustment term and a group of observations that may have the same offset, or the individuals that have different values of t. since log(t) is an observation it will change the value of the estimated counts.

The regression model for rates is:

\(log(Response/t) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + ... + \beta_p x_p\)

The model used for Poisson regression on rates is the same as used for a poisson regression model. We will use that model and include the offset observation as its own part of the model.

The poisson regression on rates table shows that the log of cyclists is not the same among weather and days of the week. The log rates on Friday(baseline) were higher than the other days of the week and Low Temp had the lowest log rate. The coefficients show the change of log rate between Friday(baseline) and every other weekday. The coefficients for weather show the change of log rate between associate weather and reference group. We also see Wednesday, Thursday,and Saturday are not statistically significant to the model.

Graphical comparisons

In the two previous sections the poisson regression models gave us numerical information about the potential discrepancy across Days of the week among the weather. We will create two graphics that will make any hidden patterns visible.

The calculations we are using for the graphics are based on the regression equation coefficients given to us in table 3, Poisson Regression on Rates.

We will be looking at the High temp,Low Temp, and Precipitation on each day of the week to create the graph. We will be using exp(-1.2734) as the baseline for days of the week, Friday.The baseline for the temperature will be given as exp(-0.0047), High Temp.

The graph will focus on temperature and precipitation being on the x-axis and the week days as the lines. The range of the each of the 3 weather types per day will be found. The range number will be the three points on the graph.

Full model

The regression models created are not appropriate due to the total cyclist who crossed the bridge each day not being included in the model.

In this model we will be adding the total cyclist data to improve the model performance.

We see that on Friday there is significantly more cyclist who cross the bridge than on any other day of the week.There is very little significant difference between any other days of the week. We must further investigate why Friday has so many more people crossing the bridge.

The graph shows a linear relationship between weather and total cyclist. The cyclist rate stays about the same for High temp and precipitation. The rate begins to decrease as the temperature decreases. The pattern is consistent with the data since there are more cyclists when there is no precipitation and a high temp. It is uncommon to see a large amount of cyclist on a day with high precipitation and low temps.

We also see through the graph that weather and days of the week have no interaction, thus the rate is parallel.

We also see that Sunday and Wednesday are not statistically significant.

We satisfy the assumption of independent observations and linearity as we look at the graph.

Conclusion

The poisson regression model and the poisson regression model on rates both shows that there is a high number of cyclists on Friday compared to the other days of the week. This shows that there is a connection between day of the week which could result in a pattern being shown. In the first model we see that precipitation decreased the amount of cyclists significantly. The second model was also most affected by precipitation however it was not as severe as the in the first model. The results shown from the models confirm the research question. We see there is a difference in cyclists based on weekday, and weather conditions.