PSYC 193 - Winter 2018

Data Analysis and Visualization using R

This is an introductory course for students interested in data analysis using computer programs. The class introduces fundamental concepts in data analysis, tailored for psychological research. Common research designs in Psychology will be reviewed. Hands-on experiences with designing small-scale experiments, and data collection, organization, and analysis. This class places an emphasis on communicating research results using visualization tools in the R programming language.

Upper Division Standing required.
Enforced prerequisite: Introductory Statistics.
Preferred prerequisites: Research Methods and a programming course in MatLab, Python, Java, C++, or HTML/CSS/Javascript.

Instructor: Jonas Lau [silau -et- ucsd.edu]

Office Hours: Fridays 2-4 @ Mandler 1586


Objectives:

  1. Hands-on experience in doing statistics with R
    Parametric tests: Z-test, one-sample, paired-, two-sample t-tests, one-way between-subjects ANOVA, correlation / linear regression
    Research Practice: power, effect size, assumptions of tests
  2. Data visualization: bar chart, histogram, scatterplot (best-fit line), distributions
  3. General programming: commenting, data types, data structure, operations, functions, loops
  4. Data handling: formatting, recoding, & factorizing

Syllabus: Subject to change
Week Topic Programming Assignment Topic
1 Introduction:
Statistics Concept Review
[slides]
Installing R and RStudio Coffee drinking and study efficiency
Probability
Normal Distribution
[slides] [R Notebook]
[activity]
Basic operations /
Array / Data Frame /
pnorm(), qnorm()
HW1: Arrays, Data Frames,
Functions, and Design
[link] [retrieval]
2 Parameter Estimation
[slides]
pnorm(), qnorm() M&M's in a bag
Experimental design
[slides]
[activity]
HW2: Probability/Quantile
Conversion,
Hypothesis Testing,
Confidence Interval,
and Function
[link] [submission link] [retrieval]
Mozart Effect
3 Statistical Power
[slides] [R Notebook]
[poll]
for-loop The Official SAT Practice
Sample size estimation /
Data Processing

[slides] [R Notebook] [data set]
[activity]
read.csv(), aggregate(),
factor(), as.numeric()
HW3: Hypothesis testing,
Statistical Power
[link] [submission link] [retrieval]
4 One-sample t-test
[slides]
data cleaning, t.test(),
pwr package
Face Reading
Paired-samples t-test
(preparation)
[slides]
HW4: Hypothesis testing,
Statistical Power
[link] [submission link] [retrieval]
Blind Tasting
5 Paired-samples t-test
[slides] [R Notebook] [data set]
wide vs long data frame,
subsetting with [ ]
Independent-samples t-test
[slides] [R Notebook] [data set]
var.test(),
effsize package
HW5: Hypothesis testing,
Statistical Power
[link] [submission link] [retrieval]
Sleeping Pills and Sleep Quality
6 Midterm exam
[submission link]
One-way ANOVA
[slides] [R Notebook] [data set]
bartlett.test()
aov(), summary()
Midterm corrections Fitting Room Tricks
7 Lab/ Post-hoc tests
[slides] [R Notebook]
TukeyHSD(),
ggplot()
Correlation / Simple linear regression
[slides] [R Notebook] [data set]
cor(), lm() HW6: Hypothesis testing,
Prediction
[link] [submission link] [retrieval]
Brain Size and Intelligence
8 Multiple Regression 1
[slides] [R Notebook] [UCI data set]
predict(), resid() Wine Quality
Multiple Regression 2
[slides] [R Notebook]
vif(), step() HW7: Regression
[link] [submission link]
[data set] [retrieval]
Family involvement
in K-12 Education
9 Two-way ANOVA 1
[slides] [R Notebook] [data set]
Second Language Acquisition
Two-way ANOVA 2 HW8: ANOVA
[link] [submission link]
[data set] [retrieval]
10 Lab/ Two-way ANOVA Visualization
[slides]
Review / catch-up
[slides]
[data set]
11 Final Exam
[Submission Link]

Optional Reference Textbooks:
For general statistics:
Dean, S. & Illowsky, B. (2018). Collaborative Statistics. https://cnx.org/contents/XgdE-Z55@40.9:LnCgyaMt@17/

For Introduction to R programming:
Dalgaard, P. (2008). Introductory statistics with R. Springer: New York. http://roger.ucsd.edu/record=b6618095~S7

For R graphing (ggplot):
Chang, W. (2012). R graphics cookbook. O'Reilly Media, Inc. http://roger.ucsd.edu/record=b8037800~S9



Grading:
Percentage
Homework 40%
Midterm (Open notes / book) 30%
Final (Cumulative, Open notes / book) 30%
SONA 3% (Extra Credit)

Homework Assignments:
Homework Assignments are released every Friday, and due on the following Friday at 23:59. Each day of late submission (round up to 1 day) leads to a deduction of 25% of the homework grade.
The only way you can get better at programming is by practicing, upon understanding the material. There is really no shortcut to the learning process. Your homework assignments are designed in a way to help you conceptualize the lecture materials, and to work on problems akin to those you will encounter in your research career.
While research projects in real-life are usually collaborative, homework assignments are designed to be completed independently. Submissions of the homework assignments should be solely your own work. You are encouraged to form study groups to discuss the class materials, but not the homework before the submission deadline. If you encounter any questions, you are welcome to discuss with the instructor.



Academic Integrity:
Academic honesty should be taken seriously in college education. It generally means that you do not claim the work that is not your own. If you make reference to other people’s work, you have to give them credits, usually in the form of citation. Academic integrity also entails working independently on your homework assignments and exams when you are expected to do so. More information on academic Integrity:
UC San Diego Academic Integrity Office
When in doubt, seek advice from the instructor or contact the Office of Academic Integrity.



Experiment Participation:
Psychology is the scientific study of the human mind and brain. Its development relies heavily on human participation. As a research active institute, The Psychology Department at UC San Diego maintains a subject pool that allows researchers to post their experiments / studies. Participating in an experiment gives you a perspective of how an experiment is conducted. You are offered three extra credits for participating in the research studies. More information:
UC San Diego SONA Experiments
Alternatively, you can write a two-page long paper in lieu of participating in a study (excluding references). The papers should be formatted with APA style. Each paper is worth a maximum of one credit. They will be graded on a 5-point scale, and you will receive a partial / full credit depending on the quality of the paper. If you decide to write a research paper, please contact the instructor for the possible topics. The last day to hand in your paper is 3/15.



Diversity Statement:
As a member of the society and the scientific community, I highly value the diversity in our environment. It is important for us to embrace the differences among ourselves and learn from each other. I believe that diversity in the community makes us better and smarter people. No one in the class should encounter discriminations due to their background or view points that are not considered mainstream. If you encounter hostile behaviors against you due to your background or view points, please contact the instructor immediately. More information:
UC San Diego Academic Affairs



Students with disabilities:
Accommodations for exams will be made for students with disabilities. Please provide the instructor with your Authorization for Accommodation letter so that arrangements can be made. For more information, please visit the websites of The Office for Students with Disabilities (OSD) at UC San Diego and Psychology Student Advising:
Office for Students with Disabilities (OSD)
UC San Diego Psychology Student Advising