\documentclass[10pt]{article}

\usepackage{fullpage}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{titlesec}
\usepackage[section]{placeins}
\usepackage{xcolor}
\usepackage{breakcites}
\usepackage{lineno}
\usepackage{hyphenat}





\PassOptionsToPackage{hyphens}{url}
\usepackage[colorlinks = true,
            linkcolor = blue,
            urlcolor  = blue,
            citecolor = blue,
            anchorcolor = blue]{hyperref}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother


\usepackage[round]{natbib}
\let\cite\citep




\renewenvironment{abstract}
  {{\bfseries\noindent{\abstractname}\par\nobreak}\footnotesize}
  {\bigskip}

\titlespacing{\section}{0pt}{*3}{*1}
\titlespacing{\subsection}{0pt}{*2}{*0.5}
\titlespacing{\subsubsection}{0pt}{*1.5}{0pt}


\usepackage{authblk}


\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}










\begin{document}

\title{Citibike Gender Analysis}



\author[1]{Christian Moscardi}%
\affil[1]{New York University Shanghai}%


\vspace{-1em}



  
  \date{May 07, 2024}


\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup





\selectlanguage{english}
\begin{abstract}
Citibike provides historical records of all trips taken on its platform
-~ including start time, end time, and the gender of the rider taking
the trip. As such, we wonder whether the rider's gender has any effect
on the length of trips they take. We found a significant difference
between samples of male and female riders between January and July 2017
- on average, women took longer trips than men. However, notably, women
took far fewer trips total than men, indicating further exploration is
required to understand gender dynamics on citibike.%
\end{abstract}%



\sloppy




\section*{Introduction}

{\label{874460}}

Citibike is New York's bike share system. Individuals can take bikes for
30 or 45 minute trips (depending if they are purchasing a day-long pass
or a monthly pass, respectively) between various stations located
throughout centrally located areas in the city. Citibike's parent
agency, NYC Bike Share LLC, publishes the data about each trip that gets
taken - when and where it starts, when and where it ends, and other
information - including the rider's gender. Users can opt out of
reporting this information, but it exists for 90\% of trips {[}see
below{]}, and as such we consider it representative for the purposes of
this analysis.

It is well known that men ride bikes more than women in New York City.
This is reflected in the Citibike data - by the measure of total rides,
in the first 7 months of 2017, \textasciitilde{}5.7 million trips
reported a male rider while \textasciitilde{}1.9 million reported a
female rider {[}see below{]}. On the other hand, it may be interesting
to consider~\emph{how long} each of those trips was. If men take more
frequent and shorter trips, this may indicate a higher proclivity to use
Citibikes for very short trips or comfort with the idea of using the
system in general.

\par\null

\section*{Data}

{\label{996175}}

We use the first 7 months of 2017 Citibike data as stored on the CUSP
data facility. The Citibike dataset is considered to be extremely clean
- the dataset records almost all actual trips, and cleaning the dataset
is trivial. We do this analysis in Python, primarily using the Pandas
package (notebook attached). We've provided a couple of visualizations
to give a sense of the data.~\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/plot2/plot2}
\caption{{We can see a majority of trips are made by men, while most trips also
have a reported gender, as male or female.
{\label{608498}}%
}}
\end{center}
\end{figure}

\par\null

Next, this figure shows the histograms of the trip duration stratified
by the category of interest (gender)

\par\null\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/plot1/plot1}
\caption{{We can see that the distributions follow a similar shape, but do note
that there are more rides by men in each bin.
{\label{794344}}%
}}
\end{center}
\end{figure}

\par\null

\section*{Methodology}

{\label{752938}}

There are many ways to look for a difference in trip duration between
male and female riders. We present two alternatives that both lead to a
strong conclusion.

First, we note that the mean male trip duration is \textasciitilde{}701
seconds, while it is \textasciitilde{}805 seconds for females. To see if
this difference is significant, we can use a T-test. Revisiting Fig. 2
we may note that neither population appears normally distributed - a
Kolmogorov--Smirnov test with p-value of 0 confirms the visual intuition
in both cases. However, with \textasciitilde{}7 million records total,
we may consider it safe to use an unpaired 2-tailed,2-sample T-test (or
even a Z-test, given such large sample sizes) in this instance. We
choose unpaired because we can safely consider these trips to be
independently generated, and 2-tailed because we carry no preconceived
expectations about which gender takes longer or shorter trips (if there
even is a difference).

Second, we can also use a nonparametric Mann-Whitney U-test to confirm
the intuition that these are~ drawn from different populations without
making any distributional assumptions about our two populations of trip
durations. We do so to confirm the above results are sane, but also
present confidence intervals as generated by typical parametric
statistics.

We chose a significance level of .05 for both tests.

\par\null

\section*{Conclusions}

{\label{453185}}

In the case of both tests, we find p-values of 0, indicating there is a
significant difference between trip durations within the two
populations.

Using the t-statistics, our 95\% confidence intervals for trip durations
are as follows \textbf{} \textbf{(units in seconds)}

Females:~

\par\null

\begin{verbatim}
[805.57014345441655, 806.16627814344781]
\end{verbatim}



Males:

\par\null

\begin{verbatim}
[701.15823417842387, 701.32874881478654]
\end{verbatim}

Because our samples are so large, our confidence intervals are very
small.\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/plot3/plot3}
\caption{{The confidence bars are very small because we consider our estimates for
2017 YTD to be very precise, due to our large sample size.
{\label{535670}}%
}}
\end{center}
\end{figure}

While significant, these results only really apply for the timeframe
that we did the analysis in. Additionally, we'd want to keep those
unreported riders in mind. 10\% of the trips being predominantly female,
for example, could alter our results dramatically. Finally, results on
citibikers also don't apply to the cyclist population at large - we only
get a sense for Citibike riders' behavior here.

It would be interesting to break this down by subscriber type as well.



\section*{Acknowledgements}

{\label{687807}}

Thanks mom

\selectlanguage{english}
\FloatBarrier
\end{document}

