Difference between revisions of "R Analysis"

From REALab Wiki
Jump to navigation Jump to search
Line 40: Line 40:


====[[R organizing data#how to read your data into R|how to read your data into R]]====
====[[R organizing data#how to read your data into R|how to read your data into R]]====
*[R organizing data#reading in a single delimited file?|reading in a single delimited file?]
*[[R organizing data#reading in a single delimited file?|reading in a single delimited file?]]
*[R organizing data#reading in multiple delimited files and storing into a main data frame?|reading in multiple delimited files and storing into a main data frame?]
*[[R organizing data#reading in multiple delimited files and storing into a main data frame?|reading in multiple delimited files and storing into a main data frame?]]
*[R organizing data#reading in files and creating a subject variable/other variable based on the file names?|reading in files and creating a subject variable/other variable based on the file names?]
*[[R organizing data#reading in files and creating a subject variable/other variable based on the file names?|reading in files and creating a subject variable/other variable based on the file names?]]
*[R organizing data#factorizing numerical IVs?|factorizing numerical IVs?]
*[[R organizing data#factorizing numerical IVs?|factorizing numerical IVs?]]
*[R organizing data#summary of attentional_blink.R script so far?|summary of attentional_blink.R script so far?]
*[[R organizing data#summary of attentional_blink.R script so far?|summary of attentional_blink.R script so far?]]
*[R organizing data#applying what we have learned so far to the gaze cueing data set?|applying what we have learned so far to the gaze cueing data set?]
*[[R organizing data#applying what we have learned so far to the gaze cueing data set?|applying what we have learned so far to the gaze cueing data set?]]


====how to fill out and complete your main data frame====
====how to fill out and complete your main data frame====

Revision as of 23:00, 6 March 2013

This wiki is designed to help anyone perform statistical analyses on their data using R. It is divided into 3 broad sections: the first section outlines basics of how R deals with data using built in data sets, the second will help you to read in and organize your own data, and the third will help to summarize, run stats, and output graphs of your data.

Each section is organized into a series of questions. Start from the beginning if you are new to R, or click on a question to go to a detailed answer and/or examples.


To get started, download R for free from the R website

Part 1: R basics

Part 2: Organizing your data

This section describes how to load in data files into a data frame, add or drop columns, create a new data frame from a subset of the full data, and generally get your data into the form you need so you can then conduct your analyses.

prep stuff: data sets & making a new script

First download the following data sets, and unzip them to a local folder:

(you can also find these in the bar.laboratory@gmail.com dropbox account, in the "\stats meetings\data sets" folder - please make copies for yourself as these should remain in this folder as originals)

how to read your data into R

how to fill out and complete your main data frame

  • adding a new variable based on another variable (selecting string subset by static position)
  • adding a new variable based on another variable (selecting string subset by regular expression)
  • adding a new variable based on another variable (logical statement using exact matches)
  • adding a new variable based on another variable (logical statement using static subset position)
  • adding a new variable based on another variable (logical statement using regular expressions)

how to select a subset of your main data frame

  • assigning a new data frame
  • selecting columns from your main data frame
  • selecting rows from your main data frame
  • selecting columns and rows from your main data frame
  • changing your RT variable into a validity effect variable (invalid RT - valid RT)

Part 3: Analyzing your data

This section outlines how to perform descriptive stats, inferential stats, and output graphs once your data frame is organized