[Tex/LaTex] My beamer failed to produce references with “LaTeX Warning: Citation `xxxxx’ undefined on input line 322.”

beamerbibtexciting

this is my code for bibtex:

@article{alikhani2013presentation,
  title={Presentation of clustering-classification heuristic method for improvement accuracy in classification of severity of road accidents in Iran},
  author={Alikhani, Mahdi and Nedaie, Ali and Ahmadvand, Alimohammad},
  journal={Safety science},
  volume={60},
  pages={142--150},
  year={2013},
  publisher={Elsevier}
}

@article{chang1999analysis,
  title={Analysis of injury severity and vehicle occupancy in truck-and non-truck-involved accidents},
  author={Chang, Li-Yen and Mannering, Fred},
  journal={Accident Analysis \& Prevention},
  volume={31},
  number={5},
  pages={579--592},
  year={1999},
  publisher={Elsevier}
}

@article{chen2016investigating,
  title={Investigating driver injury severity patterns in rollover crashes using support vector machine models},
  author={Chen, Cong and Zhang, Guohui and Qian, Zhen and Tarefder, Rafiqul A and Tian, Zong},
  journal={Accident Analysis \& Prevention},
  volume={90},
  pages={128--139},
  year={2016},
  publisher={Elsevier}
}

@article{feng2016risk,
  title={Risk factors affecting fatal bus accident severity: Their impact on different types of bus drivers},
  author={Feng, Shumin and Li, Zhenning and Ci, Yusheng and Zhang, Guohui},
  journal={Accident Analysis \& Prevention},
  volume={86},
  pages={29--39},
  year={2016},
  publisher={Elsevier}
}

@article{michalaki2015exploring,
  title={Exploring the factors affecting motorway accident severity in England using the generalised ordered logistic regression model},
  author={Michalaki, Paraskevi and Quddus, Mohammed A and Pitfield, David and Huetson, Andrew},
  journal={Journal of safety research},
  volume={55},
  pages={89--97},
  year={2015},
  publisher={Elsevier}
}

@article{yeung2013road,
  title={Road traffic accidents in Singapore expressway tunnels},
  author={Yeung, Jian Sheng and Wong, Yiik Diew},
  journal={Tunnelling and Underground Space Technology},
  volume={38},
  pages={534--541},
  year={2013},
  publisher={Elsevier}
}

@article{zhang2016traffic,
  title={Traffic accidents involving fatigue driving and their extent of casualties},
  author={Zhang, Guangnan and Yau, Kelvin KW and Zhang, Xun and Li, Yanyan},
  journal={Accident Analysis \& Prevention},
  volume={87},

this is my code in tex file:

\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Frankfurt}
\usefonttheme{serif}
\usecolortheme{dolphin}
\usepackage{ragged2e}
\usepackage{graphicx}
\usepackage{apacite}

\begin{document}
\frame{\titlepage}
\begin{frame}
\frametitle{\bf Scope of Presentation}
\tableofcontents
\end{frame}

\section{Introduction}
\begin{frame}
\frametitle{\bf Introduction}
\vspace{1cm}
{\alert {\bf {1.25 million}} people die each year!}
\centerline{ \vspace*{-1cm}

}
\end{frame}

\begin{frame}
\begin{block}{\small \bf Major Concerns of Road Accidents}
\begin{itemize}
\item {\small Injuries suffered by casualties.}
\item {\small Errors made by drivers or riders.}
\end{itemize}
\end{block}
\begin{alertblock}{\small \bf Errors of Drivers or Riders}
\begin{itemize}
\item {\small Involved \alert{\bf{73 \%}} of all accidents reported.}
\item {\small Led to accidents and caused injuries.}
\end{itemize}
\end{alertblock}
\begin{block}{\small \bf Can be overcomed by:}
\begin{itemize}
\item {\small Identifying the reasons contributing to casualty severity.}
\item {\small Identifying factors contributing to driver errors.}
\end{itemize}
\end{block}
\end{frame}
\begin{frame}
\frametitle{Continuation}
{However, in this study we focused on the reasons contributing to \alert{\underline{\bf casualty severity}}.}
\begin{block}{\small \bf Methods used:}
\begin{itemize}
\item {\small{\bf{Chi-squared Test}} - to identify the factors.}
\item {\small{\bf{Multinomial Logistic Regression}} - to explain the relationship.}
\end{itemize}
\end{block}
\end{frame}

\section{Literature Review}
\begin{frame}
\frametitle{Literature Review}
\justifying
\setbeamertemplate{itemize items}[square]
  \begin{itemize}
\justifying
  \item Michalaki et al. (2015) classified the factors affecting road accident severity into two categories; namely, engineering (road/ vehicle/ environment related) and human.
  \item Chang and Mannering (1999) discusses that the causes leading to the levels of accident severity are always complicated by the presence of multiple factors, which includes the characteristics of the individual, of the vehicle, of the environment, of the roadway and of others. 
  \item One of the characteristics of roadway which lead to accidents, according to Yeung and Wong (2013) include steep enough roads which may cause poor speed control due to their gravitational effects.
  \end{itemize}
\end{frame}
\begin{frame}
\setbeamertemplate{itemize items}[square]
\begin{itemize}
\justifying
  \item Feng et al. (2016) used cluster analysis to categorise drivers into various types in accordance with their characteristic variables, in order to distinguish the 'problem driver'.
  \item According to Zhang et al. (2016), drivers in developing countreis, particularly commercial vehicle drivers are more probable to drive during fatigue for financial and economic reasons and to meet work schedules.
  \item As road accidents differ in their nature, identifying factors that affect crash severity may help to reduce number of deaths in traffic accidents, as well as reduce the number of accidents with severe injuries (Alikhani et al., 2013).
  \item Statistical models which are the primary method used in traffic crash analyses are based on certain assumptions regarding data and model structures, which inevitably cause limitations in these studies (Chen et al., 2016).
  \end{itemize}
\end{frame}

\section{Objective}
\begin{frame}
\frametitle{Objectives}
\setbeamertemplate{itemize items}[square]
  \begin{itemize}
\justifying
  \item To investigate whether a factor has significant effect on the overall casualty severity using Chi-squared test of independence.
  \item To test whether a factor has significant effect on the casualty severity of driver or rider only using Chi-squared test of independence.
  \item To identify the relationship between factors that have significant effect on the casualty severity and casualty severity using multinomial logistic regression. 
  \end{itemize}
  \end{frame}


\section{Methodology}
\begin{frame}
\frametitle{Methodology}
{\bf Chi-squared Test of Independence}
\setbeamertemplate{itemize items}[square]
  \begin{itemize}
\justifying
  \item Both the overall data involving all categories of casualties and extracted data involving only driver or rider are investigated.
  \item Independent variables studied for both cases are the same, which are road surface conditions, sex of casualty and number of vehicles involved in an accident.
  \item Chi-squared test of independence was used to test whether there is relationship between dependent variable and independent variable in both cases respectively.
  \end{itemize}
  \end{frame}

 \begin{frame}
\frametitle{Methodology}
{\bf Multinomial Logistic Regression}
\setbeamertemplate{itemize items}[square]
  \begin{itemize}
\justifying
  \item Extension for the binary logistic regression when the categorical dependent outcome has more than two levels.
  \item It allows for more than two categories of the dependent or outcome variable, using maximum likelihood estimation to evaluate the probability of categorical membership.
  \item In this study estimated the effect of the factors ( road surface conditions, sex of casualty and number of vehicles involved in an accident) on the casualty severity.
  \end{itemize}
  \end{frame}

\begin{frame}
\frametitle{Methodology}
\setbeamertemplate{itemize items}[square]
  \begin{itemize}
\justifying
  \item The factors to be tested using multinomial logistic regression were determined by the results of Chi-squared test of independence.
  \item  Reference categories used in the multinomial logistic regression in this study are Slight and Serious respectively.
  \end{itemize}
  \end{frame}

\section{Results and Discussion}
\begin{frame}[shrink=13]
\frametitle{\bf Results and Discussion}
{\bf Chi-squared Test of Independence}
\begin{table}[h]
\begin{center}
\begin{tabular}{| c | c | c | c | c | }
\hline
&  \bf \small Independent variable &\bf \small ${\chi}^{2}$ &\bf \small d.f & \bf \small p-value \\
\hline
{\bf \small Overall} &\small Road surface conditions &\small 5.2885114 &\small 8 &\small 0.7263414 \\ 
{\bf \small data}& \small Sex of casualty & \small 49.14360 & \small 2 & \small $2.131095\times 10^{-11}$ \\ 
& \small Number of vehicles & \small 58.00532 & \small 12 & \small $5.200716\times 10^{-8}$ \\
\hline
{\bf \small Driver} & \small Road surface conditions & \small 3.9410581 & \small 8 & \small 0.8624018 \\ 
{\bf \small Rider}& \small Sex of casualty & \small 39.43588 & \small 2 & \small $2.732791\times 10^{-9}$ \\
{\bf \small only}& \small Number of vehicles & \small 19.96530975 & \small 12 & \small 0.06774504 \\ \hline
\end{tabular}
\end{center}
\caption{ Summary of Chi-Squared Test of Independence}
\end{table}
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
{\bf Multinomial Logistic Regression for Overall Data}
\begin{table}[h]
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
& [SexofCasualty=Female] & -2.505 & .082 \\ 
& [SexofCasualty=Male] & 0 & . \\
& [NumberofVehicles=1] & 16.947 & 22909701.225 \\
& [NumberofVehicles=2] &    16.266 & 11592380.553 \\
Fatal & [NumberofVehicles=3] &  15.956 & 8502118.348 \\
& [NumberofVehicles=4] & .811 & 2.250 \\
& [NumberofVehicles=5] &     .548 & 1.729 \\
& [NumberofVehicles=6] & .962 & 2.618 \\
& [NumberofVehicles=7] &     0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf slight} as reference category} 
\end{table}
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
\begin{table}[h]
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
& [SexofCasualty=Female] & -.854 & .426 \\ 
& [SexofCasualty=Male] & 0 & . \\
& [NumberofVehicles=1] & 16.947 & 23525565.605 \\
& [NumberofVehicles=2] &    16.135 & 10169275.777 \\
Serious & [NumberofVehicles=3] &    15.951 & 8462327.026 \\
& [NumberofVehicles=4] & 15.135 & 3742829.265 \\
& [NumberofVehicles=5] &     14.822 & 2734681.478 \\
& [NumberofVehicles=6] & 16.671 & 17382557.115 \\
& [NumberofVehicles=7] &     0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf slight} as reference category} 
\end{table}
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
\begin{table}[h] 
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
& [SexofCasualty=Female] &-1.651    & .192 \\ 
& [SexofCasualty=Male] & 0 & . \\
& [NumberofVehicles=1] & -.027  & .974 \\
& [NumberofVehicles=2] & .131   & 1.140 \\
Fatal & [NumberofVehicles=3] & .005 & 1.005 \\
& [NumberofVehicles=4] & -14.324 & 6.012E-007 \\
& [NumberofVehicles=5] &     -14.274 & 6.323E-007 \\
& [NumberofVehicles=6] & -15.709 & 1.506E-007 \\
& [NumberofVehicles=7] &     0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf serious} as reference category} 
\end{table} 
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
\begin{table}[h] 
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
& [SexofCasualty=Female] & .854 & 2.348 \\ 
& [SexofCasualty=Male] & 0 & . \\
& [NumberofVehicles=1] & -16.947 & 4.251E-008 \\
& [NumberofVehicles=2] &     -16.135 & 9.834E-008 \\
Slight& [NumberofVehicles=3] &   -15.951 & 1.182E-007 \\
& [NumberofVehicles=4] & -15.135 & 2.672E-007 \\
& [NumberofVehicles=5] &     -14.822 & 3.657E-007 \\
& [NumberofVehicles=6] & -16.671 & 5.753E-008 \\
& [NumberofVehicles=7] &     0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf serious} as reference category} 
\end{table} 
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
{\bf Multinomial Logistic Regression for Driver or Rider}
\begin{table}[h] 
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
Fatal & [SexofCasualty=Female] & -20.561 & 1.176E-009\\ 
& [SexofCasualty=Male] & 0 & . \\
Serious & [SexofCasualty=Female] & -1.218 & .296\\
& [SexofCasualty=Male] & 0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf slight} as reference category} 
\end{table} 
\end{frame}
\begin{frame}
\frametitle{Results and Discussion}
\begin{table}[h] 
\begin{tabular}{|cl|c|c|} 
\hline
\multicolumn{2}{|c|}{ Casualty Severity} & B & Exp(B) \\  \hline
Fatal & [SexofCasualty=Female] & -19.343 & 3.978E-009\\ 
& [SexofCasualty=Male] & 0 & . \\
Slight & [SexofCasualty=Female] & 1.218 & 3.382\\
& [SexofCasualty=Male] & 0 & . \\ \hline
\end{tabular}
\caption{B and exp(B) when {\bf serious} as reference category} 
\end{table} 
\end{frame}

\section{Conclusion}
\begin{frame}
\frametitle{\bf Conclusion}
\begin{itemize}
\justifying
\item From the Chi-squared test for overall data, we found that casualty severity is dependent on sex of casualty and number of vehicles.
\item From the Chi-squared test for driver or rider data, we found that casualty severity is dependent on sex of casualty.
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\justifying
\item Multinomial logistic regression for overall data showed that the severity of female when compared to male is less likely to be fatal or serious relative to slight and less likely to be fatal relative to serious. 
\item Multinomial logistic regression for overall data also showed that when 1 vehicle are involved, the odds of severity is fatal rather than slight and the odds of severity is serious rather than slight are the highest.
\item We also found that the odds of severity is fatal rather than serious when 2 vehicles are involved are the highest.
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\justifying
\item Multinomial logistic regression for driver or rider also showed that the severity of female driver or rider when compared to male is less likely to be fatal or serious relative to slight and less likely to be fatal relative to serious. 
\item This finding is consistent with previous study of Insurance Institute for Highway Safety (2016) which suggest that crashes involving male drivers often are more severe than those involving female drivers.
\end{itemize}
\end{frame}

\section{Future Work}
\begin{frame}
\frametitle{\bf Future Work}
{\bf There are some limitations in this study.}
\begin{itemize}
\item The results presented in this articles are based on part of the data.
\item There are some factors that have missing data.
\end{itemize}
{\bf Future work:}
\begin{itemize}
\justifying
\item Future research with different data are needed to confirm results of this study.
\item More independent factor can be added as their unique characteristics may play a significant role.
\begin{itemize}
\item Lightning Condition
\item Weather Condition
\item Type of Vehicle
\item Driving Experiences of Driver
\end{itemize}
\end{itemize}
\end{frame}

\section{References}
\begin{frame}[shrink=20]
\frametitle{\bf References}
\nocite {alikhani2013presentation}
\nocite {chang1999analysis}
\nocite {chen2016investigating}
\nocite {feng2016risk}
\nocite {michalaki2015exploring}
\nocite {yeung2013road}
\nocite {zhang2016traffic}
\bibliographystyle{apacite}
\bibliography{slide}
\end{frame}


\end{document}

I really dont know whats wrong that the beamer able to run without references.

Anyone can tell me whats wrong? thanks

enter image description here
this is what i mean the references appear twice.

Best Answer

Instead of trying to shrink the frame, I would just manually choose a smaller font size. For apacite this can be done with \renewcommand{\bibliographytypesize}{\scriptsize}

The problem with the second "References" entry in the toc is due to the fact, that apacite normally start a new chapter or section at the begin of the bibliography. This can be circumvented with the solution from https://tex.stackexchange.com/a/163494/36296

Off-topic: You should not use \bf, this is deprecated.

\begin{filecontents}{\jobname.bib}
@article{alikhani2013presentation,
  title={Presentation of clustering-classification heuristic method for improvement accuracy in classification of severity of road accidents in Iran},
  author={Alikhani, Mahdi and Nedaie, Ali and Ahmadvand, Alimohammad},
  journal={Safety science},
  volume={60},
  pages={142--150},
  year={2013},
  publisher={Elsevier}
}

@article{chang1999analysis,
  title={Analysis of injury severity and vehicle occupancy in truck-and non-truck-involved accidents},
  author={Chang, Li-Yen and Mannering, Fred},
  journal={Accident Analysis \& Prevention},
  volume={31},
  number={5},
  pages={579--592},
  year={1999},
  publisher={Elsevier}
}

@article{chen2016investigating,
  title={Investigating driver injury severity patterns in rollover crashes using support vector machine models},
  author={Chen, Cong and Zhang, Guohui and Qian, Zhen and Tarefder, Rafiqul A and Tian, Zong},
  journal={Accident Analysis \& Prevention},
  volume={90},
  pages={128--139},
  year={2016},
  publisher={Elsevier}
}

@article{feng2016risk,
  title={Risk factors affecting fatal bus accident severity: Their impact on different types of bus drivers},
  author={Feng, Shumin and Li, Zhenning and Ci, Yusheng and Zhang, Guohui},
  journal={Accident Analysis \& Prevention},
  volume={86},
  pages={29--39},
  year={2016},
  publisher={Elsevier}
}

@article{michalaki2015exploring,
  title={Exploring the factors affecting motorway accident severity in England using the generalised ordered logistic regression model},
  author={Michalaki, Paraskevi and Quddus, Mohammed A and Pitfield, David and Huetson, Andrew},
  journal={Journal of safety research},
  volume={55},
  pages={89--97},
  year={2015},
  publisher={Elsevier}
}

@article{yeung2013road,
  title={Road traffic accidents in Singapore expressway tunnels},
  author={Yeung, Jian Sheng and Wong, Yiik Diew},
  journal={Tunnelling and Underground Space Technology},
  volume={38},
  pages={534--541},
  year={2013},
  publisher={Elsevier}
}

@article{zhang2016traffic,
  title={Traffic accidents involving fatigue driving and their extent of casualties},
  author={Zhang, Guangnan and Yau, Kelvin KW and Zhang, Xun and Li, Yanyan},
  journal={Accident Analysis \& Prevention},
  volume={87},
}
\end{filecontents}

\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Frankfurt}
\usefonttheme{serif}
\usecolortheme{dolphin}
\usepackage{ragged2e}
%\usepackage{graphicx}
\usepackage{apacite}
\renewcommand{\bibliographytypesize}{\scriptsize}

\makeatletter
\let\st@rtbibsection\@bibnewpage
\let\st@rtbibchapter\@bibnewpage
\makeatother

\setbeamerfont{frametitle}{series=\bfseries}

\begin{document}
\frame{\titlepage}
\begin{frame}
\frametitle{Scope of Presentation}
\tableofcontents
\end{frame}


\section{References}
\begin{frame}
\frametitle{References}
\nocite {alikhani2013presentation}
\nocite {chang1999analysis}
\nocite {chen2016investigating}
\nocite {feng2016risk}
\nocite {michalaki2015exploring}
\nocite {yeung2013road}
\nocite {zhang2016traffic}
\bibliographystyle{apacite}
\bibliography{\jobname}
\end{frame}


\end{document}

enter image description here