R Workshop #2 Basic Data Analysis
What we did last week: Understand the basics of how R works Generated objects (vectors, matrices, etc.) Read in data in a variety of ways Looked at parts of our data
What we will do this week: Creating variables Recoding variables Renaming variables Subsetting data Descriptive statistics Looping through data Correlations, T.Tests, and Crosstabs Simple linear models
Looping You want to do something to all the rows or columns in your data (create a variable, recode a variable….) that is not a simple operation You tell R the conditions in which it should use your command: – for (i in 1:10){ } – if ( x > 9) { } – ifelse() – while()
Next Week Merging (and matching) datasets Data visualization What else?