Go to this link to access some starter code (Assignment2.Rmd) and the Assignment2-Instructions on JupyterHub:
I can also provide the rmd file:
—
title: “Put an informative title in here”
author: “ADD YOUR NAME HERE – STUDENT NUMBER”
subtitle: Assignment 2
output:
pdf_document: default
—
“`{r, include=FALSE}
knitr::opts_chunk$set(warning = FALSE, message = FALSE)
“`
# Introduction
<Here you should have a few paragraphs of text introducing the problem, getting the reader interested/ready for the rest of the report.>
<Introduce terminology.>
<Highlight hypotheses.>
<Optional: You can also include a description of each section of this report as a last paragraph.>
# Data
## Data Collection Process
<Here goes a paragraph describing the data collection process.>
<Be sure to identify any forseeable drawbacks, limitations, biases, etc.>
<You should probably cite the Toronto Open Data Portal and any associated sites/locations of your specific data. For example if you are studying TTC data you might want to include a citation of your specific data and a TTC website. That’s 3 citations in this one paragraph.>
## Data Summary
<Type here a paragraph introducing the data and its context.>
“`{r, include = FALSE}
# Here you can load in and clean the data (you may need to do the cleaning in a separate R script).
# You may need additional chunks, in case you want to include some of the cleaning output.
# Notice that the include=FALSE means that the code, and its resulting output, in this chunk will not appear in the pdf.
“`
<Type here a summary of the cleaning process. Make sure it is reproducible based off the text.>
<Include a description of the important variables.>
“`{r, include=FALSE}
# Use this to calculate some summary measures.
“`
<Include a description of the numerical summaries. Remember you can use `r ` to use inline R code.>
“`{r, echo = TRUE}
# Use this to create some plots.
“`
<Include a clear description of the plot(s). I would recommend one paragraph for each plot. Make sure plots are numbered and labelled.>
All analysis for this report was programmed using `R version 4.1.1`.
# Methods
<Include some text introducing the model/methodology.>
<Note: One dollar sign outside the LaTeX will leave the math notation in the line of text. Whereas, two dollar signs outside the LaTeX will put the math notation on its own line outside of the text. See examples below.>
**Example 1:**
The simple linear regression model is $y=beta_0 + beta_1x + epsilon$. Where $beta_0$ represents the intercept of the regression line….
**Example 2:**
The simple linear regression model is: $$y=beta_0 + beta_1x + epsilon$$. Where $beta_0$ represents the intercept of the regression line…
<Here you should describe the model. What does each Greek letter represent. Clarify any assumptions of this model.>
<Please describe the process in which you will select the independent variables in the model. Be sure to use citations if you are using any external resources.>
# Results
“`{r, include = FALSE}
# Here you can load in and clean the data.
# You may need additional chunks.
# I would recommend not including any of the Cleaning process output in the pdf – hence the “include = FALSE” at the start of the chunk.
“`
<Here you can give a brief explanation of the variables that you will be using in your regression model. Clarify the types of these variables.>
“`{r, include = FALSE}
# Here you can run a linear regression on your two variables of interest.
#lm(y~x, data = your_data) # This is for a simple linear regression.
“`
<Below you should include a well formatted table of your results.>
| $hat{beta}_0$ | 1.000 |
|————— | ——–|
| $hat{beta}_1$ | 2.000 |
<Include an explanation/interpretation of the results of the table. You should explain the parameters (betas) from a practical perspective. It might be helpful to make a prediction for an arbitrary set of x values (E.g., The expected bedtime of an 80 year old male is predicted to be…).>
<Remember you can use `r ` to use inline R code.>
“`{r, echo=FALSE}
# Use this to calculate generate a scatterplot of your variables if desired.
# You can use abline to overlay the scatterplot with the regression line (again, if desired).
“`
<Include an explanation/interpretation of the plots/tables. Make sure to comment on the appropriateness of the assumptions.>
All analysis for this report was programmed using `R version 4.1.1`. I used the `glm()` function in base `R` to derive the estimates of a frquentist logistic regression in this section [4].
# Conclusions
<Here you should give a summary of the research question/hypotheses, methods and results. What are the findings.>
<Highlight Key Results.>
<Talk about big picture.>
## Weaknesses
<Comment on any Weaknesses. If you were handing off this work to a colleague/friend who is going to build on the analysis what would you warn them about? What obstacles did you face? Were there any improvements that could have been made?>
## Next Steps
<Comment on Future Work/Next Steps/Recommendations. If you were handing off this work to a colleague/friend who is going to build on the analysis what would you recommend they look into? Did you notice anything in the data/results that you wanted to look into but didn’t have the time/resources? Are there any weaknesses/limitations that could be looked into in future work? What if you had more time or more data what would you want to try to look into?>
## Discussion
<End with a concluding paragraph to wrap up the report.>
newpage
# Bibliography
1. Grolemund, G. (2014, July 16) *Introduction to R Markdown*. RStudio. [https://rmarkdown.rstudio.com/articles_intro.html](https://rmarkdown.rstudio.com/articles_intro.html). (Last Accessed: October 12, 2021)
2. Dekking, F. M., et al. (2005) *A Modern Introduction to Probability and Statistics: Understanding why and how.* Springer Science & Business Media.
3. Allaire, J.J., et. el. *References: Introduction to R Markdown*. RStudio. [https://rmarkdown.rstudio.com/docs/](https://rmarkdown.rstudio.com/docs/). (Last Accessed: October 12, 2021)
4. Peter Dalgaard. (2008) *Introductory Statistics with R, 2nd edition*.


0 comments