Statistics with Matlab - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Statistics with Matlab

Description:

Exercise: Construct a Histogram ... Descriptive Statistics 'Variability' Interquartile range, IQR ... Exercise: Summarizing Data ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 12
Provided by: cheserver
Category:

less

Transcript and Presenter's Notes

Title: Statistics with Matlab


1
Statistics with Matlab
  • Engineering Experimental Design
  • Winter 2003

2
Outline Matlab as a Tool for . . .
  • Summarizing data
  • Fitting data
  • Hypothesis testing

3
Some Matlab Tidbits
  • Matlab saves dates as a number, but not the same
    number as Excel
  • In Matlab, 1 Jan 1 0000
  • exceldates caldata(,1)
  • matlabdates datenum('30-Dec-1899')
    exceldates
  • datestr(matlabdates,2)

4
Exercise Construct a Histogram
  • Load the file calibration.xls from
    http//132.235.16.144/ChE408/ and save
  • Read the file into Matlab
  • caldata, headertext xlsread('calibration.xls',
    'Data')
  • Define the bins
  • edges 46 47 48 49 50 51 52 53 54 55 56 57
  • Count the number of entries in each bin
  • calfactors caldata(,2)
  • frequency histc(calfactors,edges)
  • Calculate the fraction of entries in each bin
  • total sum(frequency)
  • fraction frequency/total

5
Exercise Construct a Histogram
  • Make the bar charts
  • bar((edges0.5),frequency)
  • xlim(min(edge) max(edge))
  • figure
  • bar((edges0.5),fraction)
  • xlim(min(edge) max(edge))

6
How can I summarize my data?
  • Plots
  • plot command for y vs. x (to investigate
    correlations)
  • bar command (to make histogram)
  • Descriptive Statistics
  • Measures of location
  • Measures of variability

7
Descriptive Statistics Location
  • Mean (average)
  • Strongly affected by unusual points
  • mean_resp mean(calfactors)
  • Median (50 of data higher, 50 of data lower)
  • Seldom strongly affected by unusual points
  • median_resp median(calfactors)

8
Descriptive Statistics Variability
  • Standard Deviation
  • std_dev_resp std(calfactors)
  • A measure of the precision of a technique to
    compare with another technique
  • A measure of the range of observed data
  • Strongly affected by unusual points
  • Relative Standard Deviation
  • rsd_resp std(calfactors) / mean(calfactors)
  • Usually given as percentage
  • Variance
  • variance (std(calfactors))2

9
Descriptive Statistics Variability
  • Interquartile range, IQR
  • A measure of the range of measurements
  • Seldom strongly affected by unusual points
  • IQR q0.75 q0.25
  • q0.75 75 of data is lower, p75
    prctile(calfactors,.75)
  • q0.25 25 of data is lower, p25
    prctile(calfactors,.25)
  • Range
  • A measure of the spread of measurements
  • range max(calfactors)-min(calfactors)
  • Strongly affected by unusual points

10
Exercise Summarizing Data
  • Add to your histogram m-file to summarize the
    location and variability of the cal factor

11
Fitting Data Hypothesis Testing
  • I havent finished figuring this out yet
  • I will update these files when I do
  • Meantime, use Excel
Write a Comment
User Comments (0)
About PowerShow.com