{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

06 Computational Statistics

# 06 Computational Statistics - Computational Statistics...

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

Computational Statistics Review of Splus/R Commands Consider Looking at Online Manuals

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

View Full Document
GUI Graphical User Interface GUI

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

View Full Document
Command Line Commands Elementary Commands

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

View Full Document
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 = × + = × + = = ÷ = = × = = +
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

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

View Full Document
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"
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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 41

06 Computational Statistics - Computational Statistics...

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

View Full Document
Ask a homework question - tutors are online