Difference between revisions of "R Analysis"

From REALab Wiki
Jump to navigation Jump to search
Line 6: Line 6:
To get started, download R for free from the [http://www.r-project.org/ R website]
To get started, download R for free from the [http://www.r-project.org/ R website]


==Analyzing data using R==
==Part 1: R basics==
 
 
===Part 1: R basics===
*What is a data frame?
*What is a data frame?
*Viewing the whole data frame?
*Viewing the whole data frame?
Line 25: Line 22:
*How to load a library/package?
*How to load a library/package?


===Part 2: Organizing your data===
==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.
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.


Line 43: Line 40:
*changing your RT variable into a validity effect variable (invalid RT - valid RT)
*changing your RT variable into a validity effect variable (invalid RT - valid RT)


===Part 3: Analyzing your data===
==Part 3: Analyzing your data==
This section outlines how to perform descriptive stats, inferential stats, and output graphs once your data frame is organized
This section outlines how to perform descriptive stats, inferential stats, and output graphs once your data frame is organized

Revision as of 21:07, 23 February 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

  • What is a data frame?
  • Viewing the whole data frame?
  • Viewing the head or tail of a data frame?
  • Summary of data frame?
  • Viewing Single row/single column?
  • Single variable of the data frame?
  • Summary of single variable of the data frame?
  • Viewing the names of all variables in the data frame?
  • Changing a variable name?
  • Changing all variables names?
  • Creating a new variable from scratch?
  • Creating a new variable based on values of another variable?
  • Specifying Independent and Dependent variables?
  • How to load a library/package?

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.

how to read your data into R

  • reading in a single delimited file
  • reading in multiple-delimited files and storing into a main data frame

how to 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)
  • adding a new variable based on another variable (logical statement using regular expression)

how to select a subset of 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