Introduction to Exploratory Descriptive Data Analysis in S-Plus II

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

Section 13-4: Matrix Multiplication
Descriptive Exploratory Data Analysis 9/6/2007 Jagdish S. Gangolly State University of New York at Albany.
Descriptive Exploratory Data Analysis 9/6/2007 Jagdish S. Gangolly State University of New York at Albany.
Matrix Multiplication To Multiply matrix A by matrix B: Multiply corresponding entries and then add the resulting products (1)(-1)+ (2)(3) Multiply each.
Maths for Computer Graphics
Introduction to Exploratory Descriptive Data Analysis in S-Plus Jagdish S. Gangolly State University of New York at Albany.
Warm-up 1.Review notes from Friday. 2.What is the dimension of the matrix below?
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
4.2 Operations with Matrices Scalar multiplication.
10/2/2015 Acc 522 Statistical Methods for Forensic Accounting & Assurance (Fall 2008) Gangolly 1 Statistical Methods for Forensic Accounting & Assurance.
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.
Descriptive Exploratory Data Analysis III Jagdish S. Gangolly State University of New York at Albany.
Matrix Arithmetic. A matrix M is an array of cell entries (m row,column ) and it must have rectangular dimensions (Rows x Columns). Example: 3x x.
An Introduction to R graphics Cody Chiuzan Division of Biostatistics and Epidemiology Computing for Research I, 2012.
AIM: How do we perform basic matrix operations? DO NOW:  Describe the steps for solving a system of Inequalities  How do you know which region is shaded?
4.3 Matrix Multiplication 1.Multiplying a Matrix by a Scalar 2.Multiplying Matrices.
Class Opener:. Identifying Matrices Student Check:
How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product.
Matrix Algebra Section 7.2. Review of order of matrices 2 rows, 3 columns Order is determined by: (# of rows) x (# of columns)
Matrix Operations.
 6. Use matrices to represent and manipulate data, e.g., to represent payoffs or incidence relationships related in a network.  7. Multiply matrices.
Introduction to Exploratory Descriptive Data Analysis in S-Plus Jagdish S. Gangolly State University of New York at Albany.
Matrix Operations.
Algebra Matrix Operations. Definition Matrix-A rectangular arrangement of numbers in rows and columns Dimensions- number of rows then columns Entries-
3.6 Multiplying Matrices Homework 3-17odd and odd.
Descriptive Exploratory Data Analysis II Jagdish S. Gangolly State University of New York at Albany.
3.5 Perform Basic Matrix Operations Add Matrices Subtract Matrices Solve Matric equations for x and y.
An Introduction to Programming in Matlab Emily Blumenthal
1 Introduction to R A Language and Environment for Statistical Computing, Graphics & Bioinformatics Introduction to R Lecture 3
A rectangular array of numeric or algebraic quantities subject to mathematical operations. The regular formation of elements into columns and rows.
Ch. 12 Vocabulary 1.) matrix 2.) element 3.) scalar 4.) scalar multiplication.
Descriptive Exploratory Data Analysis II
13.4 Product of Two Matrices
12-1 Organizing Data Using Matrices
Multiplying Matrices.
Matrices Rules & Operations.
Linear Algebra review (optional)
Matrix Operations.
Mr. Hartzer, Hamtramck High School
Matrix Operations.
Matrix Multiplication
Matrix Operations Monday, August 06, 2018.
Matrix Operations.
2) Platform independent 3) Predefined functions
Matrix Operations SpringSemester 2017.
Warm Up Use scalar multiplication to evaluate the following:
Multiplying Matrices.
WarmUp 2-3 on your calculator or on paper..
Use of Mathematics using Technology (Maltlab)
Graphics in S-Plus Jagdish S. Gangolly School of Business
MATRICES MATRIX OPERATIONS.
2.2 Introduction to Matrices
Introduction to Exploratory Descriptive Data Analysis in S-Plus
Matrices.
Multiplying Matrices.
3.5 Perform Basic Matrix Operations
3.6 Multiply Matrices.
Linear Algebra review (optional)
1.8 Matrices.
What is the dimension of the matrix below?
Matrix Operations SpringSemester 2017.
1.8 Matrices.
Multiplying Matrices.
3.5 Perform Basic Matrix Operations Algebra II.
Multiplying Matrices.
Introduction to Matrices
MATRICES MATTER!.
Multiplying Matrices.
Presentation transcript:

Introduction to Exploratory Descriptive Data Analysis in S-Plus II Jagdish S. Gangolly School of Business State University of New York at Albany 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Accessing elements country.data[1:2, 2:3] Population and inflation in austria and france country.data[3, 1:2] gdp and population of germany dimnames(country.data)[1] Names of the first rows in country.data 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Matrix arithmetic I Addition & Subtraction: The dimensions of the matrices must be the same e.g., A + B or A – B Scalar can be add to, subtracted from, multiplied by, or divided into a matrix. Matrix multiplication: The dimensions must be compatible (the number of rows in the first matrix must be the same as the columns of the second) eg., A %*% B Element-wise multiplication: A*B (matrix dimensions must be the same) 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Merging Matrices Binding vectors to Matrices and merging matrices: bind rows (rbind), bind columns (cbind) 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Arrays I Arrays can of up to eight dimensions. array(1:24, c(3,4,2)) 13 16 19 22 1 4 7 10 23 20 14 17 2 5 8 11 24 18 21 15 3 12 6 9 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Arrays II Useful functions for matrices: rowMeans, colMeans, rowSums, colSums, rowVars, colVars,… apply(data, dim, function,…) Example: x <- array(1:24, c(3,4,2)) > apply(x, 1, max) [1] 22 23 24 > apply(x, 2, max) [1] 15 18 21 24 > apply(x, 3, max) [1] 12 24 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Data Frames I Provides flexibility by allowing binding of vectors of different types together. Data types are preserved in data frames, and so functions such as max, mean, etc. can be computed. You can use sapply to find out the data types e.g., sapply(barley, class) yield variety year site "numeric" "ordered" "ordered" "ordered" 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Data Frames II You can find out if a data is a frame e.g., is.data.frame(country.data) [1] F You can refer to individual variables in a data frame e.g., country.frame$gdp [1] 227 1534 2365 country.frame$pop [1] 8 58 82 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Data Manipulation: Lists Lists are data structures pasted together e.g., Ger.lang <- c(“austria”, “germany”, “leichtenstein”, “switzerland”) country.list <- list(country.frame, Ger.lang) > country.list [[1]]: gdp pop inflation austria 227 8 1.3 france 1534 58 1.2 germany 2365 82 1.8 [[2]]: [1] "austria" "germany" "leichtenstein" "switzerland" 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) S-Plus Graphics graphsheet( ) : To open a graphics window. Each time you invoke this, a new graphics window is opened. dev.off() : Close the most recent graphics device opened. graphics.off() : Close all graphics devices. plot comma-separated variables, plot character) 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) Graphing Data plot command examples: a. plot(geyser$waiting, geyser$duration) b. attach(geyser) plot(waiting, duration) Syntax: plot (x, y, main, sub, xlab, ylab, type) 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) Figure Layouts par() command Example: par (mar=c(1,1,1,1)) margins 1” all around) par (mfrow=c(2,2) 4 (2 x 2) figures on a graph sheet to be plotted by row (mfcol, if to be filled by column) 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) Trellis Graphics I A matrix of graphs Example: >par(mfrow=c(2,2)) # 2 X 2 matrix of figures >x <- 1:100/100:1 >plot(x) # plot cell (1,1) >plot(x, type=“l”) # plot cell (1,2) line >hist(x) # plot cell (2,1) histogram >boxplot(x) # plot cell (2,2) boxplot 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Trellis Graphics: Singer Data 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) Trellis Graphics I Syntax: Dependent variable ~ explanatory variable |conditioning variable, Data set 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)

Acc 522 Statistical Methods for Business Decisions (J Gangolly) Trellis Graphics II Example: histogram(~height | voice.part, data=singer) No dependent variable for histogram Height is explanatory variable Data set is singer 11/16/2018 Acc 522 Statistical Methods for Business Decisions (J Gangolly)