- see final project guidelines to help with your development
- study an example of a "data creation" report for NLSY97
- RStudio cheatsheet for building dynamic documents
- official documentation to rmarkdown with illustrative examples
- download and save dsL_nlsy97.R
- download and save dsL_nlsy97_annotated.Rmd
- download and save this archived file and unzip it in you
./data/raw
folder
- Exam II results: html, md
- interactive visualization of effect size and NSHT
- Review my lecture on data manipulation using NLSY97 data.
- Reproduce and enchance the script (dsL_nlsy97.R) that produces the presentation above.
- We will be replicating Hadley's script (case-study.r) that accompanied his paper on tidy data.
- We will slightly adjusting it (case-study-andkov.R) to fit our environment and annotate it better.
- Student projects example: HRS retirement README
- use hrs_starter to get the data in and see the first few graphs
- consult Issue #15 for
geom_smooth
vocabulary
- how to create graphing functions, examplified with Boston case
- Handling model objects (S3/S4) glm_starter.R
- combine multiple graphs with
grid.arrange
- Introduction to data for potential class projects: HRS and NLSY97
- have cheatsheets on ggplot and data wrangling in quick access
- refer to the documentation on geom_smooth(), by Hadley Wickham
- exploring smoothers in graphs, UCLA
- simple example of adding polynomials to ggplot smoother
- read up on the difference between geom_smooth and stat_smooth on the RDocumentation.
- Load the script from './scripts/reports/R_starter.R`
- Create object 'ds' from 'MASS::Boston'
- Inspect and explore data
- QUESTIONS: what is the key determinant(s) of crime?
- inspect linear model using all variables as predictors of crime
- Create a basic scatter plot with
x=lstat
andy=crime
- Walk through all predictors with ggplot
- What predictor(s) could be mapped to color?
- Make
chasF
a factor and add level labels - As you walk through models again,
a) add custom color values
b) modify
goem_point
to optimize visual exploration c) add custom title to the color scale - Create a function to generate a graph with
y=crime
- remember to use
aes_string
- Map another variable to color (
radF
) - make the adjustements to the graph to accomodate
rad
variable - Create a dynamic title in
labs()
using `paste0()' - Subset data to remove target level of the predictor
- Re-analyze
- More on GLM and coefficient estimation. Check out this lecture on basic matrix algebra in R by James Steiger.
- Case : Advertising, replicating the figures and graphs
- R_starter.R
- glm_starter.R
- Validity in Research Design
- new script added that allows you to generate correlated data data, that is exact data that exhibit the specific interdependencies (correlations)
- Explore the data that lead Galton to discovery of regression
-
new script that explores the numeric example from Maxwell & Delaney (2004, p.91), table 3.3 - mood induction study
-
new starter script is added on using the glm function. Use it to get started with statistical modeling.
-
areaF : Quick graphs of model comparison. Copy/past the following content to get started.
rm(list=ls(all=TRUE)) # clear environment
cat("\f") # clear console
library(ggplot2) # load ggplot2 package for graphing
# load areaF function
source("https://raw.githubusercontent.com/andkov/psy532/master/scripts/graphs/areaF_graphing.R")
areaF(6136, 26, 6525, 29 )
- we will be looking at the exercise from ISLR, chapter 2, number 8.
- we will start with the unofficial solution
- and end up with an expanded and annotated version
##21 Sep 2015
- we will reproduce the example from Maxwell & Delaney (2004) p.77. Please open the following script template in RStudio.