An introduction to R: get familiar with R Guangxu Liu Bio7932.

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

Machine Learning Homework
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
EViews Student Version. Today’s Workshop Basic grasp of how EViews manages data Creating Workfiles Importing data Running regressions Performing basic.
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
An Introduction to spss & endnote
Applied Econometrics Second edition
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
Graphing With Excel Presented by Frank H. Osborne, Ph. D. © 2008 ID 2950 Technology and the Young Child.
Using Excel for Data Analysis in CHM 161 Monique Wilhelm.
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.
How To Make Graphs in Microsoft Excel Outline Making Bar Graphs Making Scatter Plots – 1 series Making Scatter Plots – Multiple Series.
MKCL’s Quasi Online Examination - Practice Exam System
DISCLAIMER This guide is meant to walk you through the physical process of graphing and regression in Excel…. not to describe when and why you might want.
Getting Started With Java Downloading and installing software Running your first program Dr. DwyerFall 2012.
Basic R Programming for Life Science Undergraduate Students Introductory Workshop (Session 1) 1.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Key features of Windows 7 as used in CIS 121 Introduction to Computer Information Systems 1.
Graphical Analysis Tutorial Version GA 3.2. Entering Data Enter your independent (x) data and dependent (y) data into the columns shown By double-clicking.
Step 1: Import Pictures Step 2: Add Titles Step 3: Narrate Story & Customize Motion.
To download PhotoStory: Go to On the left side under Product Resources, click on Downloads.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
Introduction to R Part 2. Working Directory The working directory is where you are currently saving data in R. What is the current working directory?
Arko Barman with modification by C.F. Eick COSC 4335 Data Mining Spring 2015.
1 1 Slide © 2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Ranjeet Department of Physics & Astrophysics University of Delhi Working with Origin.
1 1 Slide © 2004 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
An Introduction to Designing and Executing Workflows with Taverna Katy Wolstencroft University of Manchester.
Data Presentation & Graphing Introduction to Mechanical Engineering The University of Texas-Pan American College of Science and Engineering.
PowerPoint Minimizer. Content 1.What is a PowerPoint Minimizer? 2.Why using a minimizer? 3.How to use it? 4.Tips on minimizing PowerPoint.
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
Introduction to SPSS. Object of the class About the windows in SPSS The basics of managing data files The basic analysis in SPSS.
Excel Workshop CHEM 2001, FALL Make some calculations Always begin a function with ‘=‘ Multiply X and Y Multiply X by 50 (2 methods) – Absolute.
Graphing with Excel The Basics. Working With Excel The spreadsheet program Excel is useful for constructing data tables and graphs The results can easily.
Guide for Mahara My Views PY1 team 3 - Yihong Huo, Jian Ren, Poonam Kala 1Guide of My Views - Team 3.
Graphical Analysis in Excel EGN 1006 – Introduction to Engineering.
Introduction to Correlation & Regression with SAS Sam Gordji Weir 107.
Introduction to R Introductions What is R? RStudio Layout Summary Statistics Your First R Graph 17 September 2014 Sherubtse Training.
1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Performing statistical analyses using the Rshell processor Original material by Peter Li, University of Birmingham, UK Adapted by Norman.
Making Bar Graphs and Scatter Plots in Microsoft Excel 2007.
Conduct Simple Correlations Section 7. Correlation –A Pearson correlation analyzes relationships between parametric, linear (interval or ratio which are.
Tech Training 12/16/19 How to add a post How to edit a post How to add & assign a category How to add tags.
© 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license.
Introduction to SAS/willow (Unix) Sam Gordji Weir 107.
EXCEL GRAPHING *Basic Graphing Steps* by A.B. -NNHS.
1. 2 Download Windows Media Player 10: Download PhotoStory3
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
Introduction to Eviews Eviews Workshop September 6, :30 p.m.-3:30 p.m.
Correlation and Regression Stats. T-Test Recap T Test is used to compare two categories of data – Ex. Size of finch beaks on Baltra island vs. Isabela.
How to access and display WAV data Water Action Volunteers… Compile environmental data on Wisconsin rivers and streams Use data gathered by volunteers.
IENG-385 Statistical Methods for Engineers SPSS (Statistical package for social science) LAB # 1 (An Introduction to SPSS)
- Sharing, - Layout, - & using Screens with App Inventor Earl Bergquist, Garfield High School Crucial Things to know:
Machine Learning Homework Gaining familiarity with Weka, ML tools and algorithms.
*Bring Money for Yearbook!
Performing statistical analyses using the Rshell processor
By Dr. Madhukar H. Dalvi Nagindas Khandwala college
How To Setup HP Printer For USB Connection In Windows?
How to Uninstall Trend Micro Antivirus with Diagnostic Toolkit.
Introduction to R.
2-7 Curve Fitting with Linear Models Holt Algebra 2.
Simple Linear Regression
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Lesson 4 Creating a page with Web Matrix
self-paced eLearning series
Using R for Data Analysis and Data Visualization
Add some WordArt to your cover slide
Presentation transcript:

An introduction to R: get familiar with R Guangxu Liu Bio7932

1. Download and installation of R 2. Get familiar with R 3. Input data and read data from file 4. Commonly used R code 5. Something need to be aware 6. Reference for R Step by step proc. Outline

1.Downloading R official website: Where to download R.

After we choose the correct server and computer system, we will get something like below. What we want is here!

Choose again?!! Here it is!

Installation: Proc: Simply use the download installation file. Simply use the download installation file. Available options: Choose install direction Choose install direction language (English, simple Chinese only) ? language (English, simple Chinese only) ? Set up the methods for viewing help information(html, txt, chm) Set up the methods for viewing help information(html, txt, chm) Select components, customize …. Select components, customize ….

2. Get familiar with R (Sorry about using chinese version) File; Edit; Others; Package; Help function Basic introduction of R, such as Version… Working place, where we write code, see the verbal or numerial results

3. Input data and read data from file Basic proc: Basic proc: x<-function() x<-function() x=data name; <- assignment; function()=the methods for reading data x=data name; <- assignment; function()=the methods for reading data Function(): Function(): c() for example, x<-c(1,2,3,4,5) c() for example, x<-c(1,2,3,4,5) read.table() read.table() scan() scan() Read data using Rcmdr package Read data using Rcmdr package

Examples: Read data with Rcmdr package Load package from package option

Rcmdr

Rcmdr windows (right windows below)

Rcmdr-Data-Inport data (Thanks god, Rcmdr is in English!) File can be read by Rcmdr includes txt,spss,mintab, stata,excel….

For example: open the excel file contains the data, select the data you want to input and copy it by right click and copy or ctl+c. Then switch back to Rcmdr windows and choose data input from txt & clipboard

Data name 1.Variable name in first line or not 2. NA How the data are separated (Tabs here for excel)

All setting looks fine now Read the data

The R code for what we did Output window? Do not show graphic results General information of the data

An example show how t-test results displayed in output windows T test R code Results form the t-test

Lot ’ s functions here, such as make graph, load statistics package

R code for box plot If we make graph (box plot for example)

Graph result shows in R graphics window (right windows)

View data and edit your data View data window shows the data View data and edit data after data input

Edit data in the data edit windows

4. Commonly used R code ls() show all the available data (objects) ls() show all the available data (objects) in the work space or memory in the work space or memory rm() delete data, remove objects rm() delete data, remove objects ? get online help about *** ? get online help about *** lm() fit a simple regression and look at it lm() fit a simple regression and look at it resid() residuals from one model resid() residuals from one model fitted() fits from one model fitted() fits from one model plot() scatter plot plot() scatter plot 5. Something needs to be kept in mind Capital letter matters: v≠V Data (Objects) are vector or matrix Some examples

VCL and vcl are different data objects Commends: don’t use capital letter at all is a good idea Use ls() show the data in workspace

Use “?ls” to learn more about ls() fuction Online help (don’t need internet connection in fact)

Use ?lm learn more about lm() There are lot’s components in lm() Details about all those components

A simple example (without data input part) Step 1: Read and built a new data with name f Use f to view the data f in workspace Data from fertilization data of Liu (2006), and we know there should have a simple linear relationship between ln and density. Density=log(sperm/egg density) ln=log(fertilized egg/unfertilized egg). So the model will be ln=a+b*density+error

Use fm<-lm(ln~density,data=f) to build up the linear model fm<-lm(ln~density,data=f) Assign fm as the linear model Model is based on ln and density, use ln as dependent and density as variable There ln and density come from

Use fm to view fm Shows what’s fm

Use summary(fm) to see more details Details of fm, including df, SE, t value and P

Use plot(fitted(fm),resid(fm),xlab="fitted",ylab="residual",main="residual vs fits") check residual vs fits. Graph shown on the right side window Use plot(fitted(fm),resid(fm),xlab="fitted",ylab="residual",main="residual vs fits") check residual vs fits. Graph shown on the right side window Here xlab(),ylab(),main() are R codes to give x,y and the whole graph labels.

6.Reference for R ( This makes me change my presentation title to “An introduction to R: get familiar with R” 1.Free reference on R official website 2. Practical Regression and Anova using R, Julian J. Faraway, 2002

Thanks Picture above from