Download presentation
Presentation is loading. Please wait.
Published byReynard Benson Modified over 9 years ago
1
Understanding Your Data Set Statistics are used to describe data sets Gives us a metric in place of a graph What are some types of statistics used to describe data sets? –Average, range, variance, standard deviation, coefficient of variation, standard error
2
Length NumberPondLake 13438 27882 34858 42476 56460 65870 73499 86640 92268 104491 Average=47.268.2 Table 1. Total length (cm) and average length of spotted gar collected from a local farm pond and from a local lake.
3
Are the two samples equal? –What about 47.2 and 47.3? If we sampled all of the gar in each water body, would the average be different? –How different? Would the lake fish average still be larger? Length NumberPondLake 13438 27882 34858 42476 56460 65870 73499 86640 92268 104491 Average=47.268.2
4
Range Simply the distance between the smallest and largest value Length (cm) Figure 1. Range of spotted gar length collected from a pond and a lake. The dashed line represents the overlap in range.
5
Length (cm) Does the difference in average length (47.2 vs. 68.2) seem to be much as large as before?
6
Variance An index of variability used to describe the dispersion among the measures of a population sample. Need the distance between each sample point and the sample mean.
7
Figure 2. Mean length (cm) of each spotted gar collected from the pond. The horizontal solid line represents the sample mean length.
8
We can easily put this new data set into a spreadsheet table. By adding up all of the differences, we can get a number that is a reflection of how scattered the data points are. –Closer to the mean each number is, the smaller the total difference. After adding up all of the differences, we get zero. –This is true of all calculations like this What can we do to get rid of the negative values? #LengthMeanDifference 13447.2 -13.2 27847.2 30.8 34847.2 0.8 42447.2 -23.2 56447.2 16.8 65847.2 10.8 73447.2 -13.2 86647.2 18.8 92247.2 -25.2 104447.2 -3.2 Sum =0
9
Sum of Squares #LengthMeanDifferenceDifference 2 13447.2 -13.2174.24 27847.2 30.8948.64 34847.2 0.80.64 42447.2 -23.2538.24 56447.2 16.8282.24 65847.2 10.8116.64 73447.2 -13.2174.24 86647.2 18.8353.44 92247.2 -25.2635.04 104447.2 -3.210.24 Sum = 0 3233.6 Now 3233.6 is a number we can use! This value is called the SUM OF SQUARES.
10
Back to Variance Sum of Squares (SOS) will continue to increase as we increase our sample size. –A sample of 10 replicates that are highly variable would have a higher SOS than a sample of 100 replicates that are not highly variable. To account for sample size, we need to divide SOS by the number of samples minus one (n-1). –We’ll get to the reason (n-1) instead of n later
11
Calculate Variance (σ 2 ) σ 2 = S 2 = (X i – X m ) 2 / (n – 1) SOS Degrees of Freedom Variance for Pond = S 2 = 3233.6 / 9 = 359.29
12
More on Variance Variance tends to increase as the sample mean increases –For our sample, the largest difference between any point and the mean was 30.8 cm. Imagine measuring a plot of cypress trees. How large of a difference would you expect (if measured in cm)? The variance for the lake sample = 400.18.
13
Standard Deviation Calculated as the square root of the variance. –Variance is not a linear distance (we had to square it). Think about the difference in shape of a meter stick versus a square meter. By taking the square root of the variance, we return our index of variability to something that can be placed on a number line.
14
Calculate SD For our gar sample, the Variance was 359.29. The square root of 359.29 = 18.95. –Reported with the mean as: 47.2 ± 18.95 (mean ± SD). Standard Deviation is often abbreviated as σ (sigma) or as SD. SD is a unit of measurement that describes the scatter of our data set. –Also increases with the mean
15
Standard Error Calculated as: SE = σ / √(n) –Indicates how close we are to estimating the true population mean –For our pond ex: SE = 18.95 / √10 = 5.993 –Reported with the mean as 47.2 ± 5.993 (mean ± SE). –Based on the formula, the SE decreases as sample size increases. Why is this not a mathematical artifact, but a true reflection of the population we are studying?
16
Sample Size The number of individuals within a population you measure/observe. –Usually impossible to measure the entire population As sample size increases, we get closer to the true population mean. –Remember, when we take a sample we assume it is representative of the population.
17
Effect of Increasing Sample Size I measured the length of 100 gar Calculated SD and SE for the first 10, then included the next additional 10, and so on until all 100 individuals were included.
18
Sample Size
19
SD = Square root of the variance (Var = (X i – X m ) / (n – 1))
20
Sample Size SE = SD / √(n)
22
Population: a data set representing the entire entity of interest - What is a population? Sample: a data set representing a portion of a population Population Sample
23
Population mean – the true mean for that population -a single number Sample mean – the estimated population mean -a range of values (estimate ± 95% confidence interval) Population Sample
24
As our sample size increases, we sample more and more of the population. Eventually, we will have sampled the entire population and our sample distribution will be the population distribution Increasing sample size
25
Variance = (x-x) 2 N-1 i= x N N Mean = x = Standard Deviation = (x-x) 2 N-1 Go to Excel Mean = 169/6 = 28.17 Range = 25 – 32 SOS = 40.83 Variance = 40.83 / 5 = 8.16 Std. Dev. = 40.83/5 = 2.86 Std. Err. = 2.86 / √ 6 = 1.17 Standard Error = SD √N
26
MEAN ± CONFIDENCE INTERVAL When a population is sampled, a mean value is determined and serves as the point-estimate for that population. However, we cannot expect our estimate to be the exact mean value for the population. Instead of relying on a single point-estimate, we estimate a range of values, centered around the point-estimate, that probably includes the true population mean. That range of values is called the confidence interval.
27
Confidence Interval Confidence Interval: consists of two numbers (high and low) computed from a sample that identifies the range for an interval estimate of a parameter. There is a 5% chance (95% confidence interval) that our interval does not include the true population mean. y ± (t /0.05 )[( ) / ( n)] 28.17 ± 2.29 25.88 30.45
28
Hypothesis Testing –Null versus Alternative Hypothesis Briefly: –Null Hypothesis: Two means are not different –Alternative Hypothesis: Two means are not similar A test statistic based on a predetermined probability (usually 0.05) is used to reject or accept the null hypothesis < 0.05 then there is a significant difference > 0.05 then there is NO significant difference
29
Are Two Populations The Same? Boudreaux: ‘My pond is better than your lake, cher’! Alphonse: ‘Mais non! I’ve got much bigger fish in my lake’! How can the truth be determined?
30
Two Sample t-test Simple comparison of a specific attribute between two populations If the attributes between the two populations are equal, then the difference between the two should be zero This is the underlying principle of a t-test If P-value > 0.05 the means are not significantly different; If P < 0.05 the means are significantly different
31
Analysis of Variance Can compare two or more means Compares means to determine if the population distributions are not similar Uses means and confidence intervals much like a t-test Test statistic used is called an F statistic (F-test), which is used to get the P value If P-value > 0.05 the means are not significantly different; If P< 0.05 the means are significantly different Post-hoc test separates the non-similar ones
32
Analysis of Variance Compares means to determine if the population distributions are not similar Uses means and confidence intervals much like a t-test Test statistic used is called an F statistic (F-test)
33
Normal Distribution Most characteristics follow a normal distribution –For example: height, length, speed, etc. One of the assumptions of the ANOVA test is that the sample data is ‘normally distributed.’
34
Sample Distribution Approaches Normal Distribution With Sample Size
37
Variance = (x-x) 2 N-1 i= x N N Mean = x = Standard Deviation = (x-x) 2 N-1 Mean = 169/6 = 28.17 Range = 25 – 32 SOS = 40.83 Variance = 40.83 / 5 = 8.16 Std. Dev. = 40.83/5 = 2.86 Std. Err. = 2.86 / √ 6 = 1.17 Standard Error = SD √N
38
Calculate a SOS based on an overall mean (total SOS) ANOVA – Analysis of Variance
39
TrtmntReplicateLengthOverall MeanSOS Total Pond13457.7561.69 Pond27857.7412.09 Pond34857.794.09 Pond42457.71135.69 Pond56457.739.69 Pond65857.70.09 Pond73457.7561.69 Pond86657.768.89 Pond92257.71274.49 Pond104457.7187.69 Lake13857.7388.09 Lake28257.7590.49 Lake35857.70.09 Lake47657.7334.89 Lake56057.75.29 Lake67057.7151.29 Lake79957.71705.69 Lake84057.7313.29 Lake96857.7106.09 Lake109157.71108.89 9040.2 This provides a measure of the overall variance (Total SOS).
40
Calculate a SOS based for each treatment (Treatment or Error SOS).
41
TrtmntReplicateLengthTrtmnt MeanSOS Error Pond13447.2174.24 Pond27847.2948.64 Pond34847.20.64 Pond42447.2538.24 Pond56447.2282.24 Pond65847.2116.64 Pond73447.2174.24 Pond86647.2353.44 Pond92247.2635.04 Pond104447.210.24 Lake13868.2912.04 Lake28268.2190.44 Lake35868.2104.04 Lake47668.260.84 Lake56068.267.24 Lake67068.23.24 Lake79968.2948.64 Lake84068.2795.24 Lake96868.20.04 Lake109168.2519.84 6835.2 This provides a measure of the reduction of variance by measuring each treatment separately (Treatment or Error SOS). What happens to Error SOS when the variability w/in each treatment decreases?
42
Calculate a SOS for each predicted value vs. the overall mean (Model SOS)
43
TrtmntReplicateLengthTrtmnt MeanOverall MeanSOS Model Pond13447.257.7110.25 Pond27847.257.7110.25 Pond34847.257.7110.25 Pond42447.257.7110.25 Pond56447.257.7110.25 Pond65847.257.7110.25 Pond73447.257.7110.25 Pond86647.257.7110.25 Pond92247.257.7110.25 Pond104447.257.7110.25 Lake13868.257.7110.25 Lake28268.257.7110.25 Lake35868.257.7110.25 Lake47668.257.7110.25 Lake56068.257.7110.25 Lake67068.257.7110.25 Lake79968.257.7110.25 Lake84068.257.7110.25 Lake96868.257.7110.25 Lake109168.257.7110.25 2205 This provides a measure of the distance between the mean values (Model SOS). What happens to Model SOS when the two means are close together? What if the means are equal?
44
Detecting a Difference Between Treatments Model SOS gives us an index on how far apart the two means are from each other. – Bigger Model SOS = farther apart Error SOS gives us an index of how scattered the data is for each treatment. –More variability = larger Error SOS = more possible overlap between treatments
45
Magic of the F-test The ratio of Model SOS to Error SOS (Model SOS divided by Error SOS) gives us an overall index (the F statistic) used to indicate the relative ‘distance’ and ‘overlap’ between two means. –A large Model SOS and small Error SOS = a large F statistic. Why does this indicate a significant difference? –A small Model SOS and a large Error SOS = a small F statistic. Why does this indicate no significant difference?? Based on sample size and alpha level (P-value), each F statistic has an associated P-value. –P < 0.05 (Large F statistic) there is a significant difference between the means –P ≥ 0.05 (Small F statistic) there is NO significant difference
46
A B A Showing Results
47
Regression For the purposes of this class: –Does Y depend on X? –Does a change in X cause a change in Y? –Can Y be predicted from X? Y= mX + b Predicted values Overall Mean Actual values
48
When analyzing a regression-type data set, the first step is to plot the data: XY 35114 45120 55150 65140 75166 55138 The next step is to determine the line that ‘best fits’ these points. It appears this line would be sloped upward and linear (straight).
49
1) The regression line passes through the point (X avg, Y avg ). 2) Its slope is at the rate of “m” units of Y per unit of X, where m = regression coefficient (slope; y=mx+b) The line of best fit is the sample regression of Y on X, and its position is fixed by two results: (55, 138) Y = 1.24(X) + 69.8 slopeY-intercept Rise/Run
50
Testing the Regression Line for Significance An F-test is used based on Model, Error, and Total SOS. –Very similar to ANOVA Basically, we are testing if the regression line has a significantly different slope than a line formed by using just Y_avg. –If there is no difference, then that means that Y does not change as X changes (stays around the average value) To begin, we must first find the regression line that has the smallest Error SOS.
51
100 120 140 160 180 304050607080 Independent Value Dependent Value Error SOS The regression line should pass through the overall average with a slope that has the smallest Error SOS (Error SOS = the distance between each point and predicted line: gives an index of the variability of the data points around the predicted line). overall average is the pivot point 55 138
52
For each X, we can predict Y:Y = 1.24(X) + 69.8 XY_ActualY_Pred SOS Erro r 35114113.20.64 45120125.631.36 55150138144 65140150.4108.16 75166162.810.24 294.4 Error SOS is calculated as the sum of (Y Actual – Y Predicted ) 2 This gives us an index of how scattered the actual observations are around the predicted line. The more scattered the points, the larger the Error SOS will be. This is like analysis of variance, except we are using the predicted line instead of the mean value.
53
Total SOS Calculated as the sum of (Y – Y avg ) 2 Gives us an index of how scattered our data set is around the overall Y average. Overall Y average Regression line not shown
54
XY_Actual Y AverageSOS Total 35114138576 45120138324 55150138144 651401384 75166138784 1832 Total SOS gives us an index of how scattered the data points are around the overall average. This is calculated the same way for a single treatment in ANOVA. What happens to Total SOS when all of the points are close to the overall average? What happens when the points form a non-horizontal linear trend?
55
Model SOS Calculated as the Sum of (Y Predicted – Y avg ) 2 Gives us an index of how far all of the predicted values are from the overall average. Distance between predicted Y and overall mean
56
Model SOS Gives us an index of how far away the predicted values are from the overall average value What happens to Model SOS when all of the predicted values are close to the average value? XY_Pred Y Avera ge SOS Mod el 35113.2138615.04 45125.6138153.76 55138 0 65150.4138153.76 75162.8138615.04 1537.6
57
All Together Now!! XY_ActualY_PredSOS Error Y_AvgSOS Total SOS Model 35114113.20.64138576615.04 45120125.631.36138324153.76 551501381441381440 65140150.4108.161384153.76 75166162.810.24138784615.04 294.418321537.6 SOS Error = (Y_Actual – Y_Pred) 2 SOS Total = (Y_Actual –Y_ Avg) 2 SOS Mode l = (Y_Pred – Y_Avg) 2
58
Using SOS to Assess Regression Line Model SOS gives us an index on how ‘different’ the predicted values are from the average values. – Bigger Model SOS = more different –Tells us how different a sloped line is from a line made up only of Y_avg. –Remember, the regression line will pass through the overall average point. Error SOS gives us an index of how different the predicted values are from the actual values –More variability = larger Error SOS = large distance between predicted and actual values
59
Magic of the F-test The ratio of Model SOS to Error SOS (Model SOS divided by Error SOS) gives us an overall index (the F statistic) used to indicate the relative ‘difference’ between the regression line and a line with slope of zero (all values = Y_avg. –A large Model SOS and small Error SOS = a large F statistic. Why does this indicate a significant difference? –A small Model SOS and a large Error SOS = a small F statistic. Why does this indicate no significant difference?? Based on sample size and alpha level (P-value), each F statistic has an associated P-value. –P < 0.05 (Large F statistic) there is a significant difference between the regression line a the Y_avg line. –P ≥ 0.05 (Small F statistic) there is NO significant difference between the regression line a the Y_avg line.
60
Mean Model SOS Mean Error SOS 100 120 140 160 180 304050607080 Independent Value Dependent Value Basically, this is an index that tells us how different the regression line is from Y_avg, and the scatter of the data around the predicted values. = F
61
Correlation (r): A nother measure of the mutual linear relationship between two variables. ‘r’ is a pure number without units or dimensions ‘r’ is always between –1 and 1 Positive values indicate that y increases when x does and negative values indicate that y decreases when x increases. –What does r = 0 mean? ‘r’ is a measure of intensity of association observed between x and y. –‘r’ does not predict – only describes associations between variables
62
r > 0 r < 0 r = 0 r is also called Pearson’s correlation coefficient.
63
R-square If we square r, we get rid of the negative value if it is negative) and we get an index of how close the data points are to the regression line. Allows us to decide how much confidence we have in making a prediction based on our model. Is calculated as Model SOS / Total SOS
64
r 2 = Model SOS / Total SOS = Model SOS = Total SOS
65
= Model SOS = Total SOS r2 = Model SOS / Total SOS numerator/denominator Small numerator Big denominator R 2 = 0.8393
66
R-square and Prediction Confidence
67
Finally…….. If we have a significant relationship (based on the p-value), we can use the r-square value to judge how sure we are in making a prediction.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.