Introduction to R: The Basics Rosales de Veliz L., David S.L., McElhiney D., Price E., & Brooks G. Contributions from Ragan. M., Terzi. F., & Smith. E.

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Introduction to GTECH 201 Session 13. What is R? Statistics package A GNU project based on the S language Statistical environment Graphics package Programming.
Maths for Computer Graphics
R for Research Data Analysis using R Day1: Basic R Baburao Kamble University of Nebraska-Lincoln.
Review of Matrix Algebra
Introduction to Exploratory Descriptive Data Analysis in S-Plus Jagdish S. Gangolly State University of New York at Albany.
Lecture 2 MATLAB fundamentals Variables, Naming Rules, Arrays (numbers, scalars, vectors, matrices), Arithmetical Operations, Defining and manipulating.
How to Use the R Programming Language for Statistical Analyses Part I: An Introduction to R Jennifer Urbano Blackford, Ph.D. Department of Psychiatry Kennedy.
Matrix Approach to Simple Linear Regression KNNL – Chapter 5.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
Basic R Programming for Life Science Undergraduate Students Introductory Workshop (Session 1) 1.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Introduction to SPSS Edward A. Greenberg, PhD
Sébastien Lê Agrocampus Rennes A very short introduction to “R” The “Rcmdr” package and its environment.
1 Week 3: Vectors and Matrices (Part III) READING: 2.2 – 2.4 EECS Introduction to Computing for the Physical Sciences.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Piotr Wolski Introduction to R. Topics What is R? Sample session How to install R? Minimum you have to know to work in R Data objects in R and how to.
R Programming Yang, Yufei. Normal distribution.
Class Opener:. Identifying Matrices Student Check:
Introduction to Matrices and Matrix Approach to Simple Linear Regression.
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
The goal is to give an introduction to the mathematical operations with matrices. A matrix is a 2-dimensional arrangement of (real valued) data. The data.
4.1: Matrix Operations Objectives: Students will be able to: Add, subtract, and multiply a matrix by a scalar Solve Matrix Equations Use matrices to organize.
Chapter 6 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Matrix Operations and Their Applications.
Slide Copyright © 2009 Pearson Education, Inc. 7.3 Matrices.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
INTRODUCTION TO MATLAB DAVID COOPER SUMMER Course Layout SundayMondayTuesdayWednesdayThursdayFridaySaturday 67 Intro 89 Scripts 1011 Work
Unit 1 MATRICES Dr. Shildneck Fall, WHAT IS A MATRIX? A Matrix is a rectangular array of numbers placed inside brackets. A Matrix is a rectangular.
INTRODUCTION TO MATLAB Dr. Hugh Blanton ENTC 4347.
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Introduction to Exploratory Descriptive Data Analysis in S-Plus Jagdish S. Gangolly State University of New York at Albany.
Section 9-1 An Introduction to Matrices Objective: To perform scalar multiplication on a matrix. To solve matrices for variables. To solve problems using.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Data & Graphing vectors data frames importing data contingency tables barplots 18 September 2014 Sherubtse Training.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Precalculus Section 14.1 Add and subtract matrices Often a set of data is arranged in a table form A matrix is a rectangular.
Chapter 4 Section 1 Organizing Data into Matrices.
Chapter 5: Matrices and Determinants Section 5.1: Matrix Addition.
An Introduction to Programming in Matlab Emily Blumenthal
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
Pinellas County Schools
Introduction to R Chris Free. Introduction to R Free! Superior (if not comparable) to commercial alternatives Available on all platforms Not just for.
ECE 1304 Introduction to Electrical and Computer Engineering
13.4 Product of Two Matrices
12-1 Organizing Data Using Matrices
2) Platform independent 3) Predefined functions
Matrix Operations SpringSemester 2017.
Lab 1 Introductions to R Sean Potter.
WarmUp 2-3 on your calculator or on paper..
Matrices Definition: A matrix is a rectangular array of numbers or symbolic elements In many applications, the rows of a matrix will represent individuals.
Use of Mathematics using Technology (Maltlab)
Introduction to Matrices
Warmup Solve each system of equations. 4x – 2y + 5z = 36 2x + 5y – z = –8 –3x + y + 6z = 13 A. (4, –5, 2) B. (3, –2, 4) C. (3, –1, 9) D. no solution.
2.2 Introduction to Matrices
Matlab Training Session 2: Matrix Operations and Relational Operators
Data analysis with R and the tidyverse
EECS Introduction to Computing for the Physical Sciences
1.8 Matrices.
Matrix Operations Ms. Olifer.
Matrix Operations SpringSemester 2017.
1.8 Matrices.
Introduction to Matrices
Presentation transcript:

Introduction to R: The Basics Rosales de Veliz L., David S.L., McElhiney D., Price E., & Brooks G. Contributions from Ragan. M., Terzi. F., & Smith. E. Midwestern Educational Research Association in Illinois, November 2012.

Overview 1.Getting Started 2.The Basics 3.Data Input 4.R Commander 5.Descriptive Statistics 6.Means Comparisons 7.Relationships 8.Factor Analysis

Getting Started To install R on your MAC or PC you first need to go to project.org/. project.org/

Installing Packages

Using Help Command ?solve help.search or ?? –allows searching for help in various ways

R Basics R is object base –Types of objects (scalar, vector, matrices and arrays –Assignment of objects Building a data frame

R as a Calculator > [1] 3550 or various calculations in the same row > 2+3; 5*9; 6-6 [1] 5 [1] 45 [1] 0

Operation Symbols SymbolMeaning +Addition -Subtraction *Multiplication /Division % Modulo (estimates remainder in a division) ^Exponential

Numbers in R: NAN and NA NAN (not a number) NA (missing value) –Basic handling of missing values > x [1] NA > mean(x) [1] NA > mean(x,na.rm=TRUE) [1] 4.5

Objects in R Objects in R obtain values by assignment. This is achieved by the gets arrow, <-, and not the equal sign, =. Objects can be of different kinds.

Built in Functions R has many built in functions that compute different statistical procedures. Functions in R are followed by ( ). Inside the parenthesis we write the object (vector, matrix, array, dataframe) to which we want to apply the function.

Vectors Vectors are variables with one or more values of the same type. A variable with a single value is known as scalar. In R a scalar is a vector of length 1. There are at least three ways to create vectors in R: (a) sequence, (b) concatenation function, and (c) scan function.

Arrays Arrays are numeric objects with dimension attributes. The difference between a matrix and an array is that arrays have more than two dimensions.

Matrices A matrix is a two dimensional array. The command colnames

String Characters In R, string variables are defined by double quotation marks. > letters [1] "a" "b" "c"

Subscripts and Indices Select only one or some of the elements in a vector, a matrix or an array. We can do this by using subscripts in square brackets [ ]. In matrices or dataframes the first subscript refers to the row and the second to the column.

Dataframe Researchers work mostly with dataframes. With previous knowledge you can built dataframes in R Also, import dataframes into R.

R Commander Loading R Commander –Packages -> Install Packages -> Cran Mirror Selection -> Rcmdr

Opening R Commander Open R -> Packages - > Load Packages -> Rcmdr

Loading Data with R Commander Data -> Load data

Active Data with R Commander Data ->Active data set -> Select active data set

File/Edit Options

Summaries Statistics -> Summaries

Descriptive Statistics

Mean, Standard Deviation, Skewness, Kurtosis

Contingency Tables

Correlations in R Commander

Independent T-Test Statistics -> Independent T Test

One Way ANOVA Statistics -> One Way ANOVA

Factor Analysis

Graphs in R Commander Box Plot Graphs -> Box Plots

Graphs in R Commander Scatter Plot Graphs -> Scatter Plot

Helpful Resources Fox, J. (2005). R commander: A basic-statistics user interface to R. Journal of Statistical Software. 14, (9), Teetor, P. (2011). 25 Recipes for Getting Started with R. Sebastopol, CA: O’Reilly Media Inc. Teetor, P. (2011). R cookbook. Sebastopol, CA: O’Reilly Media Inc. Crowley, M. J. (2007). The R Book. Chichester, New England: John Wiley & Sons, Ltd.

Questions Thank you for your time!! Leslie Rosales de Veliz Shannon David Danielle Mc Elhiney Emily Price Gordon