1 spreadsheet problem solving applied statistics table lookup

28
1 Spreadsheet Problem Solving applied statistics table lookup

Upload: damian-grant

Post on 24-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Spreadsheet Problem Solving  applied statistics  table lookup

1

Spreadsheet Problem Solving applied statistics

table lookup

Page 2: 1 Spreadsheet Problem Solving  applied statistics  table lookup

2

Using Excel for statistical calculations

Broad capabilities, well beyond the scope of this course[ChE’s will learn many more features in

Applied Data Analysis (CHEN 3010)]

Built-in functions (COUNT, AVERAGE, STDEV, . . . )

Data Analysis toolbox (Descriptive Statistics, Histogram,Regression, . . . )

We will concentrate today on descriptive statistics

Trendline curve-fitting feature

Page 3: 1 Spreadsheet Problem Solving  applied statistics  table lookup

3

Characterizing a set of data

1 2 ny , y , , y iy , i 1,2, ,n

Central value or tendency(most likely value, estimate of true value)

Sample average

n

ii 1

yy

n

Median

n+1

2

in 2 n 2 1

n odd: y

y with y sorted in ascending ordery yn even:

2

Mode most frequently occurring value in the series

there are others: geometric mean, harmonic mean,m-estimator, first moment

[ AVERAGE(•) ]

[ MEDIAN(•) ]

[ MODE(•) ]

Page 4: 1 Spreadsheet Problem Solving  applied statistics  table lookup

4

Spread or dispersion of the data (describes uncertainty)

Range max minR y y

Inter-quartile range (iqr) 75%ile 25%ileiqr y y

Sample standard deviation n

2

ii 1

y yS

n 1

Resolution decimal place farthest to the right to whicha measurement may be reliably read

Standard error of the mean estimate y

SS

n

There are others, e.g., median absolute deviation.

[ MAX(•) - MIN(•) ]

[ STDEV(•) ]Note: sample variance issquare of S, [ VAR(•) ]

Page 5: 1 Spreadsheet Problem Solving  applied statistics  table lookup

5

Other quantities of use in statistical calculations

sample count n

sample sumn

ii 1

y

sample sum of squaresn

2i

i 1

y

“corrected” sum of squares n

2

ii 1

y y

[ COUNT(•) ]

[ SUM(•) ]

[ SUMSQ(•) ]

[ VAR(•) * (n-1) ]

Page 6: 1 Spreadsheet Problem Solving  applied statistics  table lookup

6

Example data set:

Measurements taken on a silicon wafer used for makingmicrocircuits

Page 7: 1 Spreadsheet Problem Solving  applied statistics  table lookup

7

Sample statistics using formulas

Page 8: 1 Spreadsheet Problem Solving  applied statistics  table lookup

8Finding the median andquartiles

Page 9: 1 Spreadsheet Problem Solving  applied statistics  table lookup

9

Using the Data Analysis toolbox

Note: if the Data Analysis . . .item is not on the Tools menu,you will have to go to the Add-insmenu and activate the checkboxfor Analysis Toolpak. If the AnalysisToolpak item is not on the Add-inslist, it will have to be installed fromMicrosoft Office Set-up.

Page 10: 1 Spreadsheet Problem Solving  applied statistics  table lookup

10

Setting up for descriptive statistics

Page 11: 1 Spreadsheet Problem Solving  applied statistics  table lookup

11

Results from Descriptive Statistics

Format AutoFormat OK

reformat table adjust display forappropriatesignificant figures

Page 12: 1 Spreadsheet Problem Solving  applied statistics  table lookup

12

Table Look-up

A great deal of information is organized in the form oftables and Excel provides a number of built-in functionsthat allow for the extraction of appropriate data from tables.

Excel’s lookup functions are:

LOOKUP

VLOOKUP

HLOOKUP

MATCH

INDEX

OFFSET

Page 13: 1 Spreadsheet Problem Solving  applied statistics  table lookup

13

LOOKUP(Lookup_value,Lookup_vector,Result_vector)

search downthe lookupvector

find eithera matchingvalue, ora valuegreater thanthe lookupvalue, whicheveroccurs first

go to the same position inthe result vector, and extractthe value there

Page 14: 1 Spreadsheet Problem Solving  applied statistics  table lookup

14

Example of LOOKUP use

text inalphabeticalorder

create name“material”for this column

this columnwill be the“lookup vector”

numerical valuesof bulk density

create name“density” forthis column

this column willbe the“result vector”

Page 15: 1 Spreadsheet Problem Solving  applied statistics  table lookup

15

Create LOOKUP functionformulas

this cell is named “choice”

Lookup_value,Lookup_vector,Result_vector

What happens when our choice is not in the lookup vector?

LOOKUP goes down listuntil it finds a name > “potash”,“salt” in this case, then it backsup one to “oyster shells” andreturns the answer for that

Page 16: 1 Spreadsheet Problem Solving  applied statistics  table lookup

16

Important: the lookup vector must be in ascending order. For text labels,this means alphabetic order. Upper- or lower-case letters don’t matter.

Page 17: 1 Spreadsheet Problem Solving  applied statistics  table lookup

17

VLOOKUP(Lookup_value,Table_array,col_index_num,Range_lookup)

searchdownleftcolumnoftablearraytofindmatch

Which column number forextraction of result? 1, 2, 3 or 4?

result

optional argument:if FALSE, requiresan exact match

Page 18: 1 Spreadsheet Problem Solving  applied statistics  table lookup

18

Example of VLOOKUP use

Table of properties of various granular materials

named “MaterialTable”

Page 19: 1 Spreadsheet Problem Solving  applied statistics  table lookup

19

Need to sort the table in ascending (alphabetical) order forfirst column

Using VLOOKUP to extract information from the table:

What if our choice value has a typo?

cell named“choice”

Page 20: 1 Spreadsheet Problem Solving  applied statistics  table lookup

20

typo, should be “Millet”

result shown as invalid

With 4th argument as TRUE, or absent, you would see:

results for “Flaxseeds”,next earlier item in table

Page 21: 1 Spreadsheet Problem Solving  applied statistics  table lookup

21

Application of VLOOKUP: Linear interpolation from atable of physical properties

For any %HNO3

from 0 to 90, wewant an automaticestimate of theheat capacity

Page 22: 1 Spreadsheet Problem Solving  applied statistics  table lookup

22

Create index columns to the right and left of the table

name this“NitricTable2” name this

“NitricTable1”

Page 23: 1 Spreadsheet Problem Solving  applied statistics  table lookup

23

Create an input cell and name it “input”

Enter a formula using VLOOKUP todetermine the row index for the“lower bracketing value”

Enter a simple “add 1 to the above” formula for the rowindex of the “higher bracketing value”

Page 24: 1 Spreadsheet Problem Solving  applied statistics  table lookup

24

Enter VLOOKUP functions based on “NitricTable2” andusing the low and high row indices to extract the bracketingvalues of %HNO3 and Heat Capacity.

Using Insert Name Create, transfer the 6 labelsin column F over as names on the cells to the right incolumn G

Page 25: 1 Spreadsheet Problem Solving  applied statistics  table lookup

25

LowPct HighPct

LowHC

HighHC

linear approximationbetween to locationsin the table

input%HNO3

HeatCapestimate

input LowPct

HeatCap HighHC LowHC LowHCHighPct LowPct

Enter this formula in a cell to compute the estimatedheat capacity

Page 26: 1 Spreadsheet Problem Solving  applied statistics  table lookup

26

Automatic linear interpolationformula and results

Page 27: 1 Spreadsheet Problem Solving  applied statistics  table lookup

27

Change values of the input to get different results[including bad results when input outside of

acceptable range]

the good the bad and the ugly!

Page 28: 1 Spreadsheet Problem Solving  applied statistics  table lookup

28

Other lookup functions:

HLOOKUP like VLOOKUP, except horizontalrather than vertical looks acrosstop row of table and then extracts fromindexed row

MATCH does not extract a value, but, instead, returnsa relative location (position number) of avalue in a lookup array

INDEX extracts a value from a table (2-dimensionalarray of cells with rows and columns) giventhe column index and the row index

OFFSET extracts a cell address or range from a tablegiven the offset location from the upper-left-hand corner of the table

See “Help” for more details on these