06 Computational Statistics - Computational Statistics...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Computational Statistics Review of Splus/R Commands Consider Looking at Online Manuals
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
GUI ± Graphical User Interface ± GUI
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Command Line Commands ± Elementary Commands
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Arithmetic Operators 2+3 5 2-3 -1 2*3 6 2/3 0.6666667 2^3 8 2**3 8 2+3*4^2 50 50 )) 4 ( 3 ( 2 4 3 2 8 2 667 . 0 3 2 3 / 2 6 3 2 1 3 2 5 3 2 2 2 3 = × + = × + = = ÷ = = × = = +
Background image of page 6
Assignment Operator x<-9 x 9 rm(x) x Problem: Object "x" not found Use traceback() to see the call stack x_9 # This is no longer used in R x 9 x=9 x 9 sqrt(x) 3
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objects objects(pat="x*") [1] "x" "x.025" [3] "x.95" "x.975" [5] "x.bar" "x.bar.minus.mu" [7] "x.breaks" "x.cuts" [9] "x.loc" "x.new" [11] "x.new1" "x.new2" [13] "x.new3" "x1" [15] "x1.max" "x1.min" [17] "x2" "xbar" [19] "xbar1" "xbar2"
Background image of page 8
Object Types x = 24 x 24 x = c(1,5,9) x 1 5 9 x = matrix(1:12,nrow=3,ncol=4) x [,1] [,2] [,3] [,4] [1,] 1 4 7 10 [2,] 2 5 8 11 [3,] 3 6 9 12 x = matrix(1:12,nrow=3,ncol=4,byrow=T) x [,1] [,2] [,3] [,4] [1,] 1 2 3 4 [2,] 5 6 7 8 [3,] 9 10 11 12 Scalar Vector Matrix
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object Types x = list(males=c(1,5,9),females=c(2,4,9,3)) x $males: 1 5 9 $females: 2 4 9 3 x = data.frame(males=c(1,5,9),females=c(2,4,9)) x males females 1 1 2 2 5 4 3 9 9 List Data Frame
Background image of page 10
Accessing Elements of Objects x = matrix(1:12,nrow=3,ncol=4,byrow=T) x[,1] 1 5 9 x[1,] 1 2 3 4 x = list(males=c(1,5,9),females=c(2,4,9,3)) x$males 1 5 9 x = data.frame(males=c(1,5,9),females=c(2,4,9)) x$males 1 5 9 x[,1] 1 5 9 Matrix List Data Frame
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Use of Brackets x[c(1,3)] 0 20 x[-1] 10 20 y = 1:2 x[-y] 20 x[2] = 100 x 0 100 20 x = seq(0,20,10) x 0 10 20 x[1] 0 x[1:2] 0 10 x[5] NA
Background image of page 12
Logic x = seq(10) x>5 F F F F F T T T T T x!=3 T T F T T T T T T T x==3 F F T F F F F F F F x[x>5] 6 7 8 9 10 x[x>=5] 5 6 7 8 9 10 sum(x[x>=5]) 45
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 41

06 Computational Statistics - Computational Statistics...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online