0% found this document useful (0 votes)
46 views11 pages

Intro With R

This document introduces R, a free and open-source statistical software. It can be used for both command-line and GUI-based operations. R is maintained by experts and available on all platforms. The document outlines how to perform basic operations in R like assignments, help functions, and probability functions. It also covers how to create and read in data, perform basic statistics, use additional packages, write functions, and find useful websites for learning more about R.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views11 pages

Intro With R

This document introduces R, a free and open-source statistical software. It can be used for both command-line and GUI-based operations. R is maintained by experts and available on all platforms. The document outlines how to perform basic operations in R like assignments, help functions, and probability functions. It also covers how to create and read in data, perform basic statistics, use additional packages, write functions, and find useful websites for learning more about R.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Introduction With R

Data Team
Types of statistical software
command-line software
◦ requires knowledge of syntax of commands
◦ reproducible results through scripts
◦ detailed analyses possible

GUI-based software
◦ does not require knowledge of commands
◦ not reproducible actions

hybrid types (both command-line and GUI)

INTRODUCTION TO R 3
Well-known statistical software
SAS
SPSS
Minitab
Statgraphics
S-Plus
R

INTRODUCTION TO R 4
R
free
maintained by top quality experts
available on all platforms
continuous improvement
Available through www.r-project.org

5
Basic operations
assignment operation: a <- 2+sqrt(5)
help function:
◦ help(pnorm)
◦ help.search(“normal distribution”)

probability functions:
◦ d (density): dgamma(x,n,θ)
◦ p (probability=cdf): pweibull(x,3,2)
◦ q (quantile): qnorm(0.95)
◦ r (random numbers): rexp(10,θ)

INTRODUCTION TO R 6
Data creation + I/O
create
◦ vectors: c(1,2,3)
◦ matrices: matrix(c(1,2,3,4,5,6),2,3,byrow=T) (2=#rows)
◦ list

patterns:
◦ “:” (1,2,3) = 1:3
◦ seq (1,2,3) = seq(1,3,by=1)

working directories and files:


◦ setwd
◦ getwd
◦ attach

read data

INTRODUCTION TO R 7
Basic statistics
summary
mean
stdev
t.test
boxplot

INTRODUCTION TO R 8
Packages
specialized functions available through packages and libraries
in Windows interface choose Packages -> Load Packages
examples of packages:
◦ qcc (quality control)
◦ survival

INTRODUCTION TO R 9
Functions
Analyses that have to be performed often can be put in the form of functions
Example: simple <- function(data,mean=0,alpha=0.05)
{hist(data),t.test(data,conf.level=alpha,mu=mean,alternative=“two-sided”)}

simple(data,4) uses the default value 0.05 and test the null hypothesis mu=4.

INTRODUCTION TO R 10
Useful web sites
www.r-project.org
http://cran.r-project.org/doc/contrib/Short-refcard.pdf
http://www.uni-muenster.de/ZIV/Mitarbeiter/BennoSueselbeck/s-html/
shelp.html
http://www.maths.lth.se/help/R/
http://www.mas.ncl.ac.uk/~ndjw1/teaching/sim/R-intro.html
http://stats.math.uni-augsburg.de/JGR/
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/index.html

INTRODUCTION TO R 11

You might also like