%% To be compiled with pdflatex. This gives high quality fonts (ps2pdf decrease the resolution of the document), but is very unpractical if this .tex-file is to be used as a model for other documents; xdvi is much more practical for previews than any .pdf-reader I know of. - Steffen Gr?nneberg \documentclass[a4paper, english, 11pt, reqno]{amsart} \usepackage{a4, amsmath, graphicx, amssymb, verbatim, listings, alltt, babel, paralist, mathrsfs, ae, natbib} \usepackage[latin1]{inputenc} \usepackage[section]{placeins} \begin{document} \title{Solutions, week 34, STK3100} \author{Steffen Gr?nneberg (steffeng@math.uio.no)} \date{} \maketitle{} \lstset{numbers=left, numberstyle=\tiny, numbersep=5pt, breaklines=true, frame=shadowbox, basicstyle=\small} \section*{Assignment 1} \lstinputlisting[language=R]{opg1.R} \begin{figure}[ht] \centerline{\includegraphics[height=9.5cm]{opg1_1.pdf}} \caption{Boys and girls plotted in different frames} \end{figure} \begin{figure}[ht] \centerline{\includegraphics[height=9.5cm]{opg1_2.pdf}} \caption{Boys and girls plotted in the same frame} \end{figure} \begin{figure}[ht] \centerline{\includegraphics[height=9.5cm]{opg1_3.pdf}} \caption{Boys and girls with the fitted linear regression} \end{figure} \begin{figure}[ht] \centerline{\includegraphics[height=9.5cm]{opg1_4.pdf}} \caption{Scatterplot and histogram of the residuals} \end{figure} \begin{figure}[ht] \centerline{\includegraphics[height=9.5cm]{opg1_5.pdf}} \caption{Other visual residual diagnostics} \end{figure} \section*{Assignment 2} \lstinputlisting[language=R]{opg2.R} \begin{figure}[ht] \centerline{\includegraphics[height=7.5cm]{opg2_1.pdf}} \caption{Proportion of beetles killed versus dosage of poison} \end{figure} \begin{figure}[ht] \centerline{\includegraphics[height=7.5cm]{opg2_2.pdf}} \caption{Fitted logistic regression together with the actual observations} \end{figure} \end{document}