# 1. Lecture Time and Location

• Time: 14:00 - 16:50, Each Friday
• Location: 501, Main Building South

# 2. Prerequisites

Students of this course should be familiar with the basic concepts used in statistics, such as Mean, Standard Deviation, Normal Distribution, t-statistic, ANOVA, F-ratio, p-value, Hypothesis Testing etc. To acheive this, Students should have already finished some introductory courses in statistics, such as Statistics for the Behavioral Sciences, or other courses at the same level. Students can also learn these basic concepts by themselves.

# 3. Course Information

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories by John Chambers and colleagues. R provides a wide variety of statistical (linear and nonlinear modeling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed.

Linear models, their variants, and extensions are among the most useful and widely used statistical tools for social research. This course aims to provide an accessible, in-depth, modern treatment of regression analysis, linear models, generalized linear models, and closely related methods.

# 4. Text Books

• Wickham, H. (2019). Advanced R (2 ed.). Boca Baton, UK: CRC Press.
• Wickham, H., & Grolemund, G. (2016). R for Data Science: Import, Tidy, Transform, Visualize, and Model Data. Sebastopol, CA: O’Reilly Media.
• Fox, J. (2016). Applied Regression Analysis and Generalized Linear Models (3 ed.). Thousand Oaks, CA: SAGE.

# 5. Syllabus and Lecture Notes

• Part 0: Introduction
1. Course introduction
1. R foundations
• Part I: Data craft
1. Data wrangling
1. Examining Data
1. Transforming data
• Part II: Linear models and least squares
1. Linear least-squares regression
1. Statistical Inference for Regression
1. Dummy-variable regression
1. Analysis of variance
• Part III: Linear-model diagnostics
1. Unusual and influential data
1. Non-Normality, Nonconstant Error Variance, and Nonlinearity
1. Collinearity and Its Purported Remedies
• Part IV: Generalized linear models
1. Logit and Probit Models for Categorical Response Variables
1. Generalized Linear Models
• Part V. Extending Linear and Generalized Linear Models
1. Time-Series Regression and Generalized Least Squares
1. Nonlinear Regression
1. Nonparametric Regression
1. Bootstrapping Regression Models
• Part VI: Mixed-Effects Models
1. Linear Mixed-Effects Models
1. Generalized Linear and Nonlinear Mixed-Effects Models

# 6. Final Examination

• To successfully complete the examination, your computer should have already installed the R software and at least two extra R packages: rmarkdown and car.

• Unzip and rename the Rmd file into the following format SurnameGivenname_Student Number.Rmd in Pinyin, such as ZhangSan_20170708.Rmd.

• Open the renamed .Rmd file with R and change the Name-Number region in the front matter of the Rmd file to your own name in Chinese characters and your student number, such as 张三 - 20181030.

---
title: "期末考试试卷"
subtitle: "R语言与数据可视化和统计"
author: "张三 - 20181030"    # <- Your name and student number
lastmod: "2020-12-23"
date: '2019-01-04'
output:
html_document
---                           # <- You can write any text after this
• A Rmd document can include both normal texts and legal R code. The R code should be enclosed by {r} XXX , i.e., the XXX region; and the normal texts that do not include the R code should be out of those regions. For example,
a. You can add any text here.

{r}

b. You can also add any text here.
install.packages("rmarkdown", dependencies = TRUE)
output_format = "html_document")
• Send both the finished .Rmd file, such as ZhangSan_20181030.Rmd and the knitted .html file， such as ZhangSan_20181030.html to the following email address: zhanlikan@blcu.edu.cn before 2020-12-24, 2359.