1 Some R Basics EPP 245/298 Statistical Analysis of Laboratory Data.

Slides:



Advertisements
Similar presentations
Exam II Marks. Chapter 20.1 Correlation Correlation is used when we wish to know whether two randomly distributed variables are associated with each.
Advertisements

AP Statistics Section 11.2 B. A 95% confidence interval captures the true value of in 95% of all samples. If we are 95% confident that the true lies in.
BINF 702 Spring 2014 Practice Problems Practice Problems BINF 702 Practice Problems.
SPH 247 Statistical Analysis of Laboratory Data April 2, 2010SPH 247 Statistical Analysis of Laboratory Data1.
1 ANOVA Homework Solutions EPP 245/298 Statistical Analysis of Laboratory Data.
The Normal Distribution. n = 20,290  =  = Population.
Hypothesis Testing Steps of a Statistical Significance Test. 1. Assumptions Type of data, form of population, method of sampling, sample size.
Lesson #22 Inference for Two Independent Means. Two independent samples: Again interested in (  1 –  2 ) n1n1 n2n2 Use to estimate (  1 –  2 )
1 Business 90: Business Statistics Professor David Mease Sec 03, T R 7:30-8:45AM BBC 204 Lecture 24 = Start Chapter “Fundamentals of Hypothesis Testing:
Statistics. Overview 1. Confidence interval for the mean 2. Comparing means of 2 sampled populations (or treatments): t-test 3. Determining the strength.
Final Jeopardy $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 LosingConfidenceLosingConfidenceTesting.
BCOR 1020 Business Statistics Lecture 28 – May 1, 2008.
Mean for sample of n=10 n = 10: t = 1.361df = 9Critical value = Conclusion: accept the null hypothesis; no difference between this sample.
1 Some R Basics EPP 245/298 Statistical Analysis of Laboratory Data.
Tuesday, October 22 Interval estimation. Independent samples t-test for the difference between two means. Matched samples t-test.
Statistics 101 Class 9. Overview Last class Last class Our FAVORATE 3 distributions Our FAVORATE 3 distributions The one sample Z-test The one sample.
Hypothesis testing simplified. Objective: Describe a variable - Mean, Median, Mode, Standard Deviation Examples: What is the percentage of totally satisfied.
Part IV – Hypothesis Testing Chapter 4 Statistics for Managers Using Microsoft Excel, 7e © 2014 Pearson Prentice-Hall, Inc. Philip A. Vaccaro, PhD MGMT.
1 Inference About a Population Variance Sometimes we are interested in making inference about the variability of processes. Examples: –Investors use variance.
Inferences about the slope of the regression line.
Hypothesis Testing Using The One-Sample t-Test
6.1 - One Sample One Sample  Mean μ, Variance σ 2, Proportion π Two Samples Two Samples  Means, Variances, Proportions μ 1 vs. μ 2.
Lab 5 Hypothesis testing and Confidence Interval.
Two Sample Tests Ho Ho Ha Ha TEST FOR EQUAL VARIANCES
Lecture 8 1 Hypothesis tests Hypothesis H 0 : Null-hypothesis is an conjecture which we assume is true until we have too much evidence against it. H 1.
Analysis & Interpretation: Individual Variables Independently Chapter 12.
Statistics for clinical research An introductory course.
Lecture 9 1 Reminder:Hypothesis tests Hypotheses H 0 : Null-hypothesis is an conjecture which we assume is true until we have too much evidence against.
1 Peter Fox Data Analytics – ITWS-4963/ITWS-6965 Week 2b, February 6, 2015 Lab exercises: beginning to work with data: filtering, distributions, populations,
Comparing the Means of Two Dependent Populations The Paired T-test ….
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Statistical Inferences Based on Two Samples Chapter 9.
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.
Chapter 9 Hypothesis Testing and Estimation for Two Population Parameters.
Assume we have two experimental conditions (j=1,2) We measure expression of all genes n times under both experimental conditions (n two- channel.
Variance Harry R. Erwin, PhD School of Computing and Technology University of Sunderland.
Chapter 12 Tests of a Single Mean When σ is Unknown.
Using R for Marketing Research Dan Toomey 2/23/2015
Basics of Hypothesis Testing 8.2 Day 2. Homework Answers.
STAT 3130 Statistical Methods I Lecture 1 Introduction.
Medical Statistics Medical Statistics Tao Yuchun Tao Yuchun Practice 2.
Foundations of Sociological Inquiry Statistical Analysis.
CONFIDENCE INTERVAL OF THE MEAN, INDEPENDENT-, AND PAIRED-SAMPLES T-TESTS.
Illustrations using R B. Jones Dept. of Political Science UC-Davis.
Chapter 8 Minitab Recipe Cards. Confidence intervals for the population mean Choose Basic Statistics from the Stat menu and 1- Sample t from the sub-menu.
Chapter 10 The t Test for Two Independent Samples
- We have samples for each of two conditions. We provide an answer for “Are the two sample means significantly different from each other, or could both.
6.1 - One Sample One Sample  Mean μ, Variance σ 2, Proportion π Two Samples Two Samples  Means, Variances, Proportions μ 1 vs. μ 2.
1 Econometrics (NA1031) Lecture 3 Interval Estimation and Hypothesis Testing.
A GEICO Direct magazine had an interesting article concerning the percentage of teenage motor vehicle deaths and the time of day. The following percentages.
Comparing the Means of Two Dependent Populations.
1.  What inferential statistics does best is allow decisions to be made about populations based on the information about samples.  One of the most useful.
Comparing Two Proportions. AP Statistics Chap 13-2 Two Population Proportions The point estimate for the difference is p 1 – p 2 Population proportions.
Class 13 The IQ Experiment
1 Peter Fox Data Analytics – ITWS-4600/ITWS-6600 Week 2b, February 5, 2016 Lab exercises: beginning to work with data: filtering, distributions, populations,
Introduction to Basic Statistical Methods Part 1: Statistics in a Nutshell UWHC Scholarly Forum May 21, 2014 Ismor Fischer, Ph.D. UW Dept of Statistics.
Comparing 2 populations. Placebo go to see a doctor.
Test Part VI Review Mr. Hardin AP STATS 2015.
Topic 21—Comparison of Proportions Example. Test of Significance A test of significance for the difference of two proportions Requirements: – Indep. SRS.
More about tests and intervals CHAPTER 21. Do not state your claim as the null hypothesis, instead make what you’re trying to prove the alternative. The.
AP Statistics Friday, 01 April 2016 OBJECTIVE TSW review for the test covering two- sample inference. TEST: Two-Sample Inference is on Monday, 04 April.
Example 1 We wanted to know if the American League or National League had better pitching – many people believe the NL has stronger pitching (which means.
Stat 251 (2009, Summer) Final Lab TA: Yu, Chi Wai.
Hypothesis Theory PhD course.
Evaluation challenges - Reporting
Summary of Tests Confidence Limits
CHAPTER 12 Inference for Proportions
CHAPTER 12 Inference for Proportions
Confidence Interval.
Statistical Inference for the Mean: t-test
Presentation transcript:

1 Some R Basics EPP 245/298 Statistical Analysis of Laboratory Data

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 2 Getting Data into R Many times the most direct method is to edit the data in Excel, Export as a txt file, then import to R using read.delim We will do this two ways for the energy data from Dalgaard Frequently, the data from studies I am involved in arrives in Excel

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 3 > eg <- read.delim("energy1.txt") > eg Obese Lean NA NA NA NA 8.11

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 4 > class(eg) [1] "data.frame" > t.test(eg$Obese,eg$Lean) Welch Two Sample t-test data: eg$Obese and eg$Lean t = , df = , p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: sample estimates: mean of x mean of y > mean(eg$Obese)-mean(eg$Lean) [1] NA > mean(eg$Obese[1:9])-mean(eg$Lean) [1] >

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 5 > class(eg) [1] "data.frame" > t.test(eg$Obese,eg$Lean) Welch Two Sample t-test data: eg$Obese and eg$Lean t = , df = , p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: sample estimates: mean of x mean of y > mean(eg$Obese)-mean(eg$Lean) [1] NA > mean(eg$Obese[1:9])-mean(eg$Lean) [1] >

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 6 > eg2 <- read.delim("energy2.txt") > eg2 expend stature Obese Obese Obese Obese Obese Obese Obese Obese Obese Lean Lean Lean Lean Lean Lean Lean Lean Lean Lean Lean Lean Lean

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 7 > class(eg2) [1] "data.frame" > t.test(eg2$expend ~ eg2$stature) Welch Two Sample t-test data: eg2$expend by eg2$stature t = , df = , p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: sample estimates: mean in group Lean mean in group Obese > mean(eg2[eg2[,2]=="Lean",1])-mean(eg2[eg2[,2]=="Obese",1]) [1]

October 20, 2004EPP 245 Statistical Analysis of Laboratory Data 8 > mean(eg2[eg2[,2]=="Lean",1])-mean(eg2[eg2[,2]=="Obese",1]) [1] > tapply(eg2[,1],eg2[,2],mean) Lean Obese > tmp <-tapply(eg2[,1],eg2[,2],mean) > tmp Lean Obese > class(tmp) [1] "array" > dim(tmp) [1] 2 > tmp[1]-tmp[2] Lean