Chapter 2 Analysis using R. Few Tips for R Commands included here CANNOT ALWAYS be copied and pasted directly without alteration. –One major reason is.

Slides:



Advertisements
Similar presentations
Sta220 - Statistics Mr. Smith Room 310 Class #14.
Advertisements

Measures of Variation Sample range Sample variance Sample standard deviation Sample interquartile range.
Describing Quantitative Data with Numbers Part 2
WINKS SDA Statistical Data Analysis (Windows Kwikstat) Getting Started Guide.
Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc. Chap 3-1 Business Statistics: A Decision-Making Approach 7 th Edition Chapter.
Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc. Chap 3-1 Business Statistics: A Decision-Making Approach 7 th Edition Chapter.
Chapter 3 Describing Data Using Numerical Measures
Histograms & Summary Data.  Summarizing large of amounts of data in two ways: Histograms: graphs give a pictorial representation of the data Numerical.
A Simple Guide to Using SPSS© for Windows
Measures of Central Tendency MARE 250 Dr. Jason Turner.
Chapter 19 Data Analysis Overview
Chapter 2 Simple Comparative Experiments
Fall 2006 – Fundamentals of Business Statistics 1 Chapter 3 Describing Data Using Numerical Measures.
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 18-1 Chapter 18 Data Analysis Overview Statistics for Managers using Microsoft Excel.
1 Introduction to biostatistics Lecture plan 1. Basics 2. Variable types 3. Descriptive statistics: Categorical data Categorical data Numerical data Numerical.
Stats & Excel Crash Course Jim & Sam April 8, 2014.
Describing distributions with numbers
Let’s Review for… AP Statistics!!! Chapter 1 Review Frank Cerros Xinlei Du Claire Dubois Ryan Hoshi.
Quantitative Research in Education Sohee Kang Ph.D., lecturer Math and Statistics Learning Centre.
1.1 Displaying Distributions with Graphs
Welcome to Math 6 Statistics: Use Graphs to Show Data Histograms.
The paired sample experiment The paired t test. Frequently one is interested in comparing the effects of two treatments (drugs, etc…) on a response variable.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 21/09/2015 7:46 PM 1 Two-sample comparisons Underlying principles.
ESTIMATES AND SAMPLE SIZES
Statistical Analysis. Statistics u Description –Describes the data –Mean –Median –Mode u Inferential –Allows prediction from the sample to the population.
EQT 373 Chapter 3 Simple Linear Regression. EQT 373 Learning Objectives In this chapter, you learn: How to use regression analysis to predict the value.
STAT 280: Elementary Applied Statistics Describing Data Using Numerical Measures.
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 3-1 Business Statistics: A Decision-Making Approach 6 th Edition Chapter.
2 Categorical Variables (frequencies) Testing mean differences of a continuous variable between groups (categorical variable) 2 Continuous Variables 2.
Psyc 235: Introduction to Statistics Lecture Format New Content/Conceptual Info Questions & Work through problems.
Section 1 Topic 31 Summarising metric data: Median, IQR, and boxplots.
Lecture 3 Describing Data Using Numerical Measures.
Lesson Describing Distributions with Numbers adapted from Mr. Molesky’s Statmonkey website.
Chapter 2: Descriptive Statistics Adding MegaStat in Microsoft Excel Measures of Central Tendency Mode: The most.
Measures of Dispersion How far the data is spread out.
Exploratory Data Analysis Observations of a single variable.
T T03-01 Calculate Descriptive Statistics Purpose Allows the analyst to analyze quantitative data by summarizing it in sorted format, scattergram.
Continued… Obj: draw Box-and-whisker plots representing a set of data Do now: use your calculator to find the mean for 85, 18, 87, 100, 27, 34, 93, 52,
Chap 3-1 A Course In Business Statistics, 4th © 2006 Prentice-Hall, Inc. A Course In Business Statistics 4 th Edition Chapter 3 Describing Data Using Numerical.
Measures of Variability. Why are measures of variability important? Why not just stick with the mean?  Ratings of attractiveness (out of 10) – Mean =
ANOVA: Analysis of Variance. The basic ANOVA situation Two variables: 1 Nominal, 1 Quantitative Main Question: Do the (means of) the quantitative variables.
Exploring Data 1.2 Describing Distributions with Numbers YMS3e AP Stats at LSHS Mr. Molesky 1.2 Describing Distributions with Numbers YMS3e AP Stats at.
Descriptive statistics Petter Mostad Goal: Reduce data amount, keep ”information” Two uses: Data exploration: What you do for yourself when.
To be given to you next time: Short Project, What do students drive? AP Problems.
Describing Quantitative Data with Numbers Section 1.3.
Copy Data to Minitab Statistical Tests Open Excel File > Highlight All Data & Column Headings > Copy Launch Minitab: Start > Programs > Minitab > Minitab.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Describing Distributions Numerically.
Numerical Measures. Measures of Central Tendency (Location) Measures of Non Central Location Measure of Variability (Dispersion, Spread) Measures of Shape.
Chap 18-1 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 18-1 Chapter 18 A Roadmap for Analyzing Data Basic Business Statistics.
Mr. Magdi Morsi Statistician Department of Research and Studies, MOH
1.3 Describing Quantitative Data with Numbers Pages Objectives SWBAT: 1)Calculate measures of center (mean, median). 2)Calculate and interpret measures.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall2(2)-1 Chapter 2: Displaying and Summarizing Data Part 2: Descriptive Statistics.
Numerical descriptions of distributions
Eco 6380 Predictive Analytics For Economists Spring 2016 Professor Tom Fomby Department of Economics SMU.
1 Design and Analysis of Experiments (2) Basic Statistics Kyung-Ho Park.
Lecture 7: Bivariate Statistics. 2 Properties of Standard Deviation Variance is just the square of the S.D. If a constant is added to all scores, it has.
The Normal Approximation for Data. History The normal curve was discovered by Abraham de Moivre around Around 1870, the Belgian mathematician Adolph.
Descriptive Statistics using R. Summary Commands An essential starting point with any set of data is to get an overview of what you are dealing with You.
STATISTICS Chapter 2 and and 2.2: Review of Basic Statistics Topics covered today:  Mean, Median, Mode  5 number summary and box plot  Interquartile.
Statistical methods for health sciences Descriptive statistics Hypotheses tests Analysis of variance Regression analysis Live event analysis Multivariate.
Chapter 18 Data Analysis Overview Yandell – Econ 216 Chap 18-1.
Stat 251 (2009, Summer) Final Lab TA: Yu, Chi Wai.
Numerical descriptions of distributions
Statistical Data Analysis - Lecture 05 12/03/03
Description of Data (Summary and Variability measures)
Edexcel: Large Data Set Activities
1.2 Describing Distributions with Numbers
Mean As A Balancing Point
Good research questions
Mean As A Balancing Point
Presentation transcript:

Chapter 2 Analysis using R

Few Tips for R Commands included here CANNOT ALWAYS be copied and pasted directly without alteration. –One major reason is the type of quotations… –R only accepts double-straight vertical quotations( '' '' ), not the standard “word” type of quotations ( “ ” )‏ Also, R is very case sensitive

Example Introduction to the data (pg 21)‏ –“Shortly after…each of a group of 44 students [in meters]…another group of 69 students…width [in feet]” –Will there be a significant difference?

Initiate the data To initiate the data that we will use, activate from HSAUR package: R> data(“roomwidth”, package = “HSAUR”)‏

Conversion Since some of the units are in meters, and some are in feet, we need to convert R> convert <- ifelse(roomwidth$unit == “feet”, 1, 3.28)‏ –Convert is the variable that we are creating now. –In it, we will store two possible values through the use of an ifelse statement. How to read: “If the column ‘unit’ found in data ‘roomwidth’ (which was previously initiated) reads as “feet”, then convert = 1. However [else], if ‘unit’ does NOT equal feet, then convert = = conversion factor, meters  feet.

Summary Statistics Let’s say that we want to bring up general statistics about the data… –Min, quartiles, max, mean, median, standard deviation… Use summary or sd command. tapply(roomwidth$width * convert, roomwidth$unit, summary)‏ –Reads: “Apply the following function to each cell of our data: take the width column, found in data roomwidth, and multiple it by convert (a vector with two possible values depending on the value of width). Then, depending on the column ‘unit” found in data roomwidth, display the summary statistics about it.”

Output (R)‏

SD Statistic Since the standard deviation is not included in the displayed statistics for some reason, a unique comment must be added. The command reads the same as before, except the “sd” function is applied. tapply(roomwidth$width * convert, roomwidth$unit, sd)‏

Graphical Analysis (Input)‏ > data("roomwidth", package = "HSAUR")‏ > convert <- ifelse(roomwidth$unit == "feet", 1, 3.28)‏ > tapply(roomwidth$width * convert, roomwidth$unit, summary)‏ $feet Min. 1st Qu. Median Mean 3rd Qu. Max $metres Min. 1st Qu. Median Mean 3rd Qu. Max > tapply(roomwidth$width * convert, roomwidth$unit, sd)‏ feet metres > layout(matrix(c(1,2,1,3), nrow=2, ncol=2, byrow=FALSE))‏ > boxplot(I(width * convert) ~ unit, data = roomwidth, ylab = "Estimated width (feet)", varwidth = TRUE, names = c(“Estimates in feet", "Estimates in meteres (converted to feet)"))‏ > feet <- roomwidth$unit == "feet" > qqnorm(roomwidth$width[feet], ylab = "Estimated width (feet)")‏ > qqline(roomwidth$width[feet])‏ > qqnorm(roomwidth$width[!feet], ylab = "Estimated width (metres)")‏ > qqline(roomwidth$width[!feet])‏

Output

Graphical Analysis - Layout Input sets up the layout of the box plot and graphs Input creates top boxplot on previous screen –boxplot(I(width * convert) ~ unit, data = roomwidth, ylab = "Estimated width (feet)", varwidth = TRUE, names = c(“Estimates in feet", "Estimates in metres (converted to feet)"))‏ Lables –ylab –varwidth Histograms –>hist()‏ > layout(matrix(c(1,2,1,3), nrow=2, ncol=2, byrow=FALSE))‏

Two Sample t-test using R We are performing a two sample t-test assuming equal variances

Wilcoxon Mann-Whitney Rank Sum Test Using R Notice additional command at end of function to display confidence interval

Example One Sample t-test Example of paired t-test using difference in two mooring methods in wave energy experiment (p 22)‏

Example Correlation Test Using R Choose two factors that you want to test for correlation ex. mortality + hardness in water data