320 likes | 529 Views
Study Guide. Biol 260 Lab Exam 2. Table of Contents. Lab 10 : F-test Lab 11 : t-test Lab 12 : Chi Square (X 2 ) Lab 13 : One-Way ANOVA Lab 15 : Two-Way ANOVA Lab 16 : Regression/Correlation. Lab 10: F-test.
E N D
Study Guide Biol 260 Lab Exam 2
Table of Contents • Lab 10: F-test • Lab 11: t-test • Lab 12: Chi Square (X2) • Lab 13: One-Way ANOVA • Lab 15: Two-Way ANOVA • Lab 16: Regression/Correlation
Lab 10: F-test • Sample variance: basic measure of dispersion of the sample and an estimate of the true pop. variance from which the data was taken. • Homogeneous: when the variances are equal. • F-test: (variance ratio test) general procedure for comparing any two sample variances. • Two sample variances: approx. equal and ratio ≈ 1.0 (sample error). Two Tailed Alternative • H0:σ2 = σ2 α = 0.025 • HA: σ2 ≠ σ2 One-Tailed Alternative • H0:σ2 ≤ σ2 • HA:σ2> σ2 F-table: Two-tailed Alternatives • Larger s2 in numerator • Fcalc < 1 | greater than 1. • Fcrit = α/2 | upper tail. • Fcrit = α/2 | lower tail, don’t need. • Lower Fcrit value
Lab 10: Variance Ratio (F-test) Two-Tailed (non-directional) • HA: σ2 ≠ σ2 • Fcalc: s2 larger = numerator. Obtaining Critical Fcritical • Choose α value • Two-tailed = α/2 | upper limit (tail) • One-tailed = α | upper limit • Table: p(F) < Fcritical • Find the column • Table top: v1 (num. s2). • Table bottom: v2 (denom. s2). • Fcritical = value in body of table. • Fcalc vs. Fcrit • Fcalc > Fcrit = reject H0. • Fcalc < Fcrit = accept H0 One-Tailed (directional) • HA: σ2 > σ2 • Fcalc: s21 = numerator (σ21). • H0 true: 50:50 chance either variance (s2) is greater. Degrees of Freedom (DOF) • v1: numerator s2 DOF. • v2: denominator s2 DOF. • DOF = n -1.
Lab 10: F-test Calculate Fcritical values (just want p-values) • Type data values. • “vartest c1 c2;” | runs the F-test. • “unstacked.” | runs with unstacked data. • Fcalc > Fcrit: p < 0.05 • Fcalc < Fcrit: p > 0.05 Untabled Degrees of Freedom (N/A) • Conservative Critical Values • Next lower tabled values = decrease the value of one of the variances (numerator or denominator). • ↓ DOF for num/den. = ↑ critical, tabled F value. • True Fcritical will be smaller than tabled one. • Fcalc < Fcrit: ↑ num./den. DOF; accept H0. • Fcalc > Fcrit: reject H0.
Lab 11: t-test or z-test (testing pop. means) T-test Information • T-test: compare the equality of two population means. • Equal variances: σ2 = σ2t-test or z-test • Unequal variances: σ2 ≠ σ2 t’-test and paired t-test. Two Sample Experimental Designs • Independent samples: (one control) replicatesare assigned independently and randomly to treatment groups or drawn independently from two diff pops (different species or different environments). • Paired samples: replicates are dependent; each one in a treatment is related to the paired replicate in another treatment (ex: twins assign. two diff diets). Null Hypothesis (H0) (ind. or paired) • H0: μ1 = μ2 • H0: μ1 – μ2 = 0 • H0: μ1 – μ2 = C0 • If equal: difference between two = 0. • C0: diff. between the two means is a value other than 0. Alternative Hypothesis (HA) (ind. or paired) • One tailed: HA: μ1 – μ2 > 0 • One-tailed HA: μ1 – μ2 < C0 • Two-tailed HA: μ1 – μ2 ≠ C0 • C0 = 0 testing H0 if means are equal.
Lab 11: Independent Sample z-test t-test Pop. Variances Known (σ2 known) • Use z-test (norm. std. distribution). • Zcalc: from the equation below. • Zcrit: from table, compare to Zcalc. Pop. Variances Unknown (σ2 unknown) • F-test: (pre-test) test if s21 = s22. • H0: σ2=σ2 • HA: σ2≠σ2 • DOF1: n1 – 1 • DOF2: n2 – 1 Correct order of Tests • F-test: test H0 if σ2=σ2. report p-value • Accept H0: σ2=σ2 • Homoscedastic • pool sample variances. • Calculate tcalc. • tcrit using t-table, DOF = n1 + n2 – 2. • Reject H0: σ2≠σ2 • Heteroscedastic • Calculate t’calc. • Calculate t’crit. • Write hypotheses • Two-sample, 1 tailed t-test • H0: μ1 ≥ μ2 • HA: μ1 < μ2 • Report p-values, write conclusions.
Lab 11: Independent Sample z-test t-test Two-Sample t-test (σ2=σ2) • σ2: aren’tsignificantly different. • s2p: pooled within-group variance. • Pooling: combing two sep estimates of the pop. Variance (σ2), use s1 and s2. • SS1/SS2: sums of squares (num. of s2). • DOF = n1 + n2 – 2. • σ2 ≠ σ2: reject H0 and incorrect to pool. • Incorrect to pool = do not use this eq. Two-Sample t-test, t’-test (σ2 ≠ σ2) • σ2: aresignificantly different. • Use: obs. s21 s22, not pooled s2p. • T’crit: (n1 = n2) use t-table, DOF = n -1 • Find t’crit for chosen α with this eq: • t1 = tcrit from table, DOF for n1 – 1. • ↓ t’crit = ↑ DOF • Tcalcbetw. t1 and t2, find exact t’crit. • Tcalc > both t1 and t2 reject H0. • Tcalc < both t1 and t2 accept H0.
Lab 11: Paired t-test and Minitab Paired Two-Sample Two-Tailed t-test Minitab • Type data values. • “Stat” “Basic Statistics” “Paired t…” • “Samples in columns” • First: c1 • Second c2 Paired t-test (σ2 known) • Samples called pairs or blocks. • Ex: offspring from same parents. • Calculate differences within the blocks. • Calculate tcalc using diff of two samples. • Special case of one-sample, H0: μD = 0. • New observations: Di = Xi,1 – Xi,2. • n = # of pairs of obs. ( = # of blocks). • H0: μD = 0 • Directional HA: μD > 0 • Non-directional HA: μD ≠ 0 Paired t-test (σ2 known) • Paired t-test DOF = n – 1. • tcalc > tcrit: reject H0 p ≤ α • tcalc < tcrit: accept H0 p > α
Lab 11: F-test (pre-test) and t-test Minitab (σ2 = σ2) F-test (are variances equal?)(unknown σ2) • Type data values. • “Stat” “Basic Statistics” “2 Variance…” • “Samples in Different Columns • First: c2 | larger σ2 • Second: c1 | smaller σ2 Independent Two-Sample One-Tailed (σ2 = σ2) • “Stat” “Basic Statistics” “2-sample t…” • “Samples in different columns” • First: c1 • Second: c2 • “Assume equal variances” | homoscedastic vs. hetero? • “Options”: Confidence level: “95.0” • Alternative: “greater than” | HA: μ > μ Alternative: “less than” | HA: μ < μ
Lab 12: X2 Chi Square X2 (GOF, Independence, and Homogeneity) • All X2 are one-tailed, directional, not-asymmetric, X2crit= α = 0.05. • H0: Oi = Ei expected freq. are correct X2 = small X2≈ 0.0. • HA: Oi≠Eiexpected freq. are not correct X2= large. • X2calc≥ X2crit: Oi = Eireject H0 X2calc = large. • X2calc < X2crit: Oi ≠ Eiaccept H0 X2calc= small.
Lab 12: X2 Chi Square Goodness of Fit X2: Goodness of Fit • Samples called pairs or blocks. • DOF = k-1-r
Lab 12: X2 Chi Square Goodness of Fit for Minitab GOF, Poisson, Intrinsic • “let c3=c1*c2” “sum(c2)” • “let k1=sum(c3)/64” “print k1” • “pdf c1 c4;” “poisson k1.” • “let c5=c4*64” • Write in exp./obs. quadrats. • “let c9=(c7-c8)**2” “let c10=c9/c8” “sum c10” GOF, Any Ratio, Extrinsic • “let c3=c1*c2” “let c4=c3/c2” “sum c4”
Lab 12: X2 Chi Square Independence X2 Independence • Individuals are selected at random and classified on the basis of 2 separate traits. • Relates 2 traits to each other (eye color and visual acuity), does 1 depend on other? • Whether traits occur independentlyin the sample or non-independence in sample? • Independent: the prop. of people brown, black, or red hair ≈ each eye color. • Not independent: prop. of people with different eye color ≠ (diff) hair color. • DOF = (r – 1) (c – 1) r = row c = column X2 Independence or Homogeneity Minitab • “stat” “tables” “Chi-square test (Two-way table in worksheet)…” • Columns containing the table: “c1-c4” * *
Lab 12: X2 Chi Square Homogeneity X2 Homogeneity • Individuals from each of several pops. are selected at random and classified at some single trait with 2 or more categories. • Sample the same pop. at diff. times and want to know if the proportions of diff. types remain the same (are homogenous) or if the prop. of different types differ. • To see if a trait differs within two samples ( • Independent: the frequencies do not differ between the groups (homogenous). • Not independent: frequencies do differ between the groups (not homogenous).
Lab 12: X2 Chi Square Homogeneity • Define what type of Chi Square it is. • Define that it is a Chi-Square. • Homogeneity, independence, Goodness of Fit (Poisson, medallion genetics)? • Write hypotheses • H0: visual acuity and eye color are independent of one another. • HA: visual acuity and eye color are not independent of one another. • Expected Proportion for Each “Trait” and Sum Columns/Rows
Lab 12: X2 Chi Square Homogeneity • Expected Frequency for each Trait • Obtain a summed Chi Square Value (X2total) = X2calc • On the next slide. • What is your X2crit value? • X2crit = X2crit a = 0.05, df = (r-1)(c-1). • What is your p-value? • Obtained in Minitab. • Write conclusions: Accept/Reject H0? How does this relate to above question? • Accept H0: there’s no diff. b/e sexes in distance fish moved (homogenous).
Lab 12: X2 Chi Square Homogeneity • Obtain a summed Chi Square Value (X2total) = X2calc
Transform Data • Levene’s test variances not equal transform log of data Levene’s test again variances equal run ANOVA with transformed data.
One-Way ANOVA • ANOVA: (analysis of variance) analyzing the variances to compare the equality of more than two populations means. Lab 13: One-Way ANOVA Sum of Squares • SSA: (sum of squares among) estimate of variance from dispersion of sample means for each group around the grand mean of all observations. • SSW: (sum of squares within) (SSE = error) estimate of variance from dispersion of observations within each of the groups around their separate means. • SST: (sum of squares total) total sum of squared deviations of observations from the grand mean of all the data. ANOVA Hypotheses • Conceptual Hypothesis (two-tailed) • H0: μ1 = μ2 = μ3 = … = μk. • HA: not all μ’s are equal. • Practical Hypothesis (one-tailed) • H0: σ2groups ≤ σ2within • HA: σ2groups > σ2within • σ2groups = σ2among • ↓ MSA = μ do not differ. • ↑ MSA = μ do differ.
F-test Hypothesis (one-tailed) • H0: σ2A ≤ σ2W | do ANOVA • HA: σ2A > σ2W | no ANOVA Fcalc • MSA always in numerator. • MSW always in denominator Fcritical • Fcritical = Fk-1, N-k • MSA DOF = k – 1. • MSW DOF = N – k. Interpretation • Fcalc > Fcrit: reject ANOVA H0. • Fcalc < Fcrit: accept ANOVA H0. Sum of Squares • H0 true: (σ2 = σ2) MSA ≈ MSW. • H0 false: (σ2 ≠ σ2) MSA > MSW Hartley’s Fmax Test • Requires n = n in all groups. • Fmax • Fcritical • Top number: α = 0.05 • Bottom number: α = 0.01 • Columns = k (total # of group variance) • Rows = df = n-1 = of the group variances. • Reject H0: perform transformation of data to equalize the variances. • Bartlett’s and Levene’s test in Minitab just use the p-value. Lab 13: One-Way ANOVA Binomial Poisson
Lab 13: One-Way ANOVA Minitab • Write Hypotheses for F-test (σ2 = σ2) • H0: σ2w = σ2W = σ2W | do ANOVA • HA: at least 2σ2 are not equal | no ANOVA • Write Conceptual Hypotheses (two-tailed) • H0: μ1 = μ2 = μ3 = … = μk. • HA: not all μ’s are equal. • Write Practical Hypotheses (one-tailed) • H0: σ2groups ≤ σ2within • HA: σ2groups > σ2within • σ2groups = σ2among • Report p-values, write conclusions from ANOVA. • P < 0.05, σ2groups > σ2within not all μ’s are equal do comparisons. • Comparisons (Tukey and Interval Plot) (μ’s ≠ μ’s) • Do comparisons when means aren’t equal. • Qcritα, k, v k = # of groups v = df of MSw/win α = 0.05 • No overlap: means are different (μ’s differ). overlap 0 (zero) • Overlap: means not different (μ’s don’t differ). overlap 0 (zero)
Run Levene’s F-test (report p-value, transform data or not?) • Type data values. • Data Stack Columns… • Stack the following columns: c1-c3 | highlight columns and push “select”. • Columns in current worksheet: c6 | stack data in this column. Label c6 • Store subscripts in: c7 | column for subscripts. Label c7 • Stat ANOVA Test of Equal Variances… • Response: c6 | where stacked data located. • Factors: c7 | where subscripts located. • Confidence level: 95.0 | do transformations or not? • Run One-Way ANOVA “Stacked Data” • Data stack Columns... • Stack the following columns: c1-c4 | list of columns containing data. • Column of current worksheet: c6 | where you want stacked data stored. • Store subscripts in: c7 | where you want subscripts stored. • Stat ANOVA One-Way… • Response: c6 | column containing stacked data. • Factor: c7 | column containing subscripts. Lab 13: One-Way ANOVA Minitab • p-value = 0.000, then p < 0.001
Interval Plot (1st way) (Graphed comparison interval) • Type data values. | should already be done at this point. • Stat ANOVA Interval Plot… | or Data Graph Interval Plot… • “One Y” “With Groups” | select this graph type. • Graph Variables: c6 | column containing data. • Categorical variables grouping: c7 | column containing stacked data. • Double-click on the error bars. | new window “Edit Interval Bar” opens. • Click the “Options tab” • Type of error: “Standard Error” | type in standard error for data set. • Multiple: | ½ Qcrit • Select: “pool error across groups” | this shifts the graph. • Tukey’s Comparison (2nd way) • Stack data values | should have already done in ANOVA. • Stat ANOVA One-Way… | performs one-way ANOVA. • Response: c6 | column containing data. • Factor: c7 | column containing stacked data. • Select “Comparisons” button in ANOVA • Tukey’s, family error rate: 5 | desired α level. Lab 13: One-Way ANOVA Minitab
Lab 15: Two-Factor ANOVA • p-value = 0.000, then p < 0.001 • Error = within.
Step 1: Pretest Hypotheses • H0: σ2A = σ2B = σ2C = σ2D = σ2E = σ2F = σ2G = σ2H. (within σ2). • HA: at least 2σ2 w/in groups are not equal. Step 2: type data values in Minitab, label c6, c7, c8 • Site 1 = 1 Site 2 = 2 • Type the data values in Minitab. | unstacked data, columns 1 -4. • Data Stack Columns… | will stack the data. • Stacking the following columns: c1-c4 | these columns will be stacked. • Column of current worksheet: c6 | stacked data in this column. • Store subscripts in: c7 | Factor A: subscripts this colmn. • Use variable names in subscript column | Allows #’s as subscripts. • Calc Make Patterned Data Simple Set of Numbers… • Store patterned data in: c8 | Factor B: subscripts this colmn. • From first value: 1 | small Factor B value. • To last value: 2 | large Factor B value. • In steps of: 1 | difference of two (2 – 1 = 1). • List each value 5 | # of obs./data values in 1 cell. • List the whole sequence: 4 | diff types Factor A (# of col). Lab 15: Two-Factor ANOVA
Step 3: Run Levene’s Test (p-value) • Stat ANOVA Test for Equal Variances… • Response: c6 | contains stacked data. • Factors: c7 c8 | contains subscripts. • p-value: 0.297, accept H0, σ2w/in groups = σ2w/in groups, no transformations. Step 4: ANOVA Hypotheses (2 way = conceptual only) • H1: H0: μnone = μfert = μirrig = μfert x irrig | Factor A • HA: not all μ’s are equal. • H2: H0: μsite1= μsite2 | Factor B • HA: not all μ’s are equal. • H3: H0: no interaction exists between treatment and site on the mean weight of Poplar trees (independent). • HA: interactions exist between treatment and site on the mean weight of Poplar trees (dependent). Step 5: run ANOVA, report p-values, write Conclusions • H1: p < 0.001, reject H0, not all μ’s are equal. • H2: p < 0.001, reject H0, not all μ’s are equal. • H3: p < 0.001, reject H0, interactions exist b/e treatment & sites on mean weights. Lab 15: Two-Factor ANOVA
Lab 15: Two-Factor ANOVA Step 5: run ANOVA, report p-values, write Conclusions • Stat ANOVA General Linear Model | run two-factor ANOVA. • Response: c6 | stacked data. • Model: c7 c8 c7*c8 | two factors and the interaction Step 6: run Interaction Plot (only if you reject H3 H0) • p-value < 0.001, reject H3 H0, so do interaction plot. • Stat ANOVA Interaction Plots… | Interaction Plot. • Responses: c6 | stacked data. • Factors: c7 c8 | contains subscripts. • Display full interaction plot matrix | select this.
Interaction Plot on Left • Site 1: overall site 1 had higher weights within the individual treatment groups. • Site 2: overall site 2 had the lower weights within the individual treatment groups. Interaction Plot on Right • All 4 Treatments: with all 4 treatments (none, fertilizer, irrigation, f x i) as you go from site 1 to site 2, there’s a decrease in the weights of the trees in one year. • None: weights of site 1, no treatment are higher than the weights in site 2 without treatment; and the weights are lower compared to the rest of the treatments. • Fertilizer: weights in site 1 are higher than the weights in site 2 when fertilizer was added; the weights are lower than irrig and fert/irrig but higher than no treatment. • Irrigation: weights in site 1 are higher than the weights in site 2 when fertilizer was added; the weights are ↓ than fert/irrig but higher than fertilizer & no treatment. • Fert. x Irrig: weights in site 1 are higher than weights in site 2 when fert/irrigation were added; all other weights are lower when given other treatments. • In general: suggests that the weights of the Poplar trees tend to be highest, whether in site 1 or site 2, if they are treated with both fertilizer and irrigation; treatment site 1 had the highest weights within treatments and overall treatments. Lab 15: Two-Factor ANOVA
Lab 16: Regression Step 1: Plot your data, is it linear? Create scatter plot. • Graph scatterplot simple • Y variable: c2 X variable: c1 • Copy and paste graph into a document, state “looks linear” Step 2: Report Null and Alternative • H0: β = 0. no significant linear relationship between _____ & _____ • HA: β ≠ 0. there is significant linear relationship between _____ & _____ Step 3: run one-way ANOVA or one-sample t-test • Stat regression Regression • Response: c1 | col dependent variable (Y) • Predictors: c2 | col. Independent variable (X) • Storage: Residuals, fits Step 4: Report equation, report R2 (in Minitab R-Sq) • y = 2.972 + 1.79(°C) R2 = 95.2% of heart beats that can be explained by reg. line. Dependent and independent Variable • X = independent variable = doesn’t change (temp, age, pH) • Y = dependent variable = change in relation to X (breeding changes rel. to temp).
Lab 16: Regression Step 5: Graph equation (w/ CI) fitted line plot • Stat Regression Fitted line plot… • Response Y: c2 | dependent variable. • Response X: c1 | independent variable. • Select Options tab Options • Select display confidence interval, display prediction interval Step 6: Graph residuals, plot, and do interpretation (paragraph). • Stat regression Regression • Response: c1 | col dependent variable (Y) • Predictors: c2 | col. Independent variable (X) • Select Graph • Residuals vs. variable c1 | col independent variable (X) Reasons why t-test more flexible than ANOVA • Alternative hypothesis can be one-tailed or two-tailed. • β = doesn’t have to be zero, can be another number, can test various H0’s.
Step 1: Report Null and Alternative • H0: ρ = 0 no correlation ρ = population correlation coefficient. • HA: ρ≠ 0 correlation r = sample correlation coefficient. Step 2: Report p-value and interpretation. • Stat Basic statistics Correlation… • Variables: c1 c2 | enter the variables Y1 and Y2. • Report the p-value and what the p-value means. • H0: r = 0 no correlation exists between 2 variables. • HA: r ≈ +1 implies strong positive association b/e ____ & ____ (↑ X ↑Y). • HA: r ≈-1 implies strong negative association b/e ____ & ____ (↑ X ↓ Y). Step 3: Report r-value and interpretation • Pearson's correlation = r-value = 0.976 • Strong positive association between heart beat and temp in frogs (r = 0.976). Step 4: Basic scatterplot of values • Use from Regression. Finding values out of data or in data • In our example we cant find values for ex. = 28 because it is our of the range of values that we have, so type “unable to do so.” Lab 16: Correlation