Correlation and Regression



Similar documents
MULTIPLE REGRESSION EXAMPLE

MTH 140 Statistics Videos

Relationships Between Two Variables: Scatterplots and Correlation

Exercise 1.12 (Pg )

IAPRI Quantitative Analysis Capacity Building Series. Multiple regression analysis & interpreting results

Chapter 23. Inferences for Regression

Stata Walkthrough 4: Regression, Prediction, and Forecasting

August 2012 EXAMINATIONS Solution Part I

Please follow the directions once you locate the Stata software in your computer. Room 114 (Business Lab) has computers with Stata software

MODEL I: DRINK REGRESSED ON GPA & MALE, WITHOUT CENTERING

Chapter 10. Key Ideas Correlation, Correlation Coefficient (r),

Simple linear regression

Nonlinear Regression Functions. SW Ch 8 1/54/

Summarizing and Displaying Categorical Data

Interaction effects between continuous variables (Optional)

Section 14 Simple Linear Regression: Introduction to Least Squares Regression

Univariate Regression

Lecture 11: Chapter 5, Section 3 Relationships between Two Quantitative Variables; Correlation

ECON 142 SKETCH OF SOLUTIONS FOR APPLIED EXERCISE #2

2. Simple Linear Regression

Statistics 104 Final Project A Culture of Debt: A Study of Credit Card Spending in America TF: Kevin Rader Anonymous Students: LD, MH, IW, MY

The importance of graphing the data: Anscombe s regression examples

South Carolina College- and Career-Ready (SCCCR) Probability and Statistics

DATA INTERPRETATION AND STATISTICS

Diagrams and Graphs of Statistical Data

The leverage statistic, h, also called the hat-value, is available to identify cases which influence the regression model more than others.

AP STATISTICS REVIEW (YMS Chapters 1-8)

Linear Regression Models with Logarithmic Transformations

Data Analysis Methodology 1

Lecture 15. Endogeneity & Instrumental Variable Estimation

Fairfield Public Schools

Linear Regression. Chapter 5. Prediction via Regression Line Number of new birds and Percent returning. Least Squares

Addressing Alternative. Multiple Regression Spring 2012

2013 MBA Jump Start Program. Statistics Module Part 3

STAT 350 Practice Final Exam Solution (Spring 2015)

Marginal Effects for Continuous Variables Richard Williams, University of Notre Dame, Last revised February 21, 2015

How To Write A Data Analysis

Chapter 13 Introduction to Linear Regression and Correlation Analysis

Linear Regression. use waist

X X X a) perfect linear correlation b) no correlation c) positive correlation (r = 1) (r = 0) (0 < r < 1)

Department of Economics Session 2012/2013. EC352 Econometric Methods. Solutions to Exercises from Week (0.052)

Example: Boats and Manatees

Chapter 7: Simple linear regression Learning Objectives

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

Failure to take the sampling scheme into account can lead to inaccurate point estimates and/or flawed estimates of the standard errors.

Regression Analysis: A Complete Example

Nonlinear relationships Richard Williams, University of Notre Dame, Last revised February 20, 2015

Measurement with Ratios

2. Here is a small part of a data set that describes the fuel economy (in miles per gallon) of 2006 model motor vehicles.

Descriptive Statistics

Descriptive statistics Statistical inference statistical inference, statistical induction and inferential statistics

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

DESCRIPTIVE STATISTICS. The purpose of statistics is to condense raw data to make it easier to answer specific questions; test hypotheses.

Introduction to Regression and Data Analysis

Homework 8 Solutions

Session 7 Bivariate Data and Analysis

Scatter Plots with Error Bars

Additional sources Compilation of sources:

Module 5: Multiple Regression Analysis

Correlation key concepts:

Curriculum Map Statistics and Probability Honors (348) Saugus High School Saugus Public Schools

Simple Linear Regression

Basic Statistics and Data Analysis for Health Researchers from Foreign Countries

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Handling missing data in Stata a whirlwind tour

1) Write the following as an algebraic expression using x as the variable: Triple a number subtracted from the number

UNIT 1: COLLECTING DATA

Introduction to Quantitative Methods

Manhattan Center for Science and Math High School Mathematics Department Curriculum

Outline. Topic 4 - Analysis of Variance Approach to Regression. Partitioning Sums of Squares. Total Sum of Squares. Partitioning sums of squares

Describing Relationships between Two Variables

a) Find the five point summary for the home runs of the National League teams. b) What is the mean number of home runs by the American League teams?

Visualizing Data. Contents. 1 Visualizing Data. Anthony Tanbakuchi Department of Mathematics Pima Community College. Introductory Statistics Lectures

Vertical Alignment Colorado Academic Standards 6 th - 7 th - 8 th

Forecasting in STATA: Tools and Tricks

Correlation and Simple Linear Regression

Common Core Unit Summary Grades 6 to 8

Data Mining Techniques Chapter 5: The Lure of Statistics: Data Mining Using Familiar Tools

Unit 31 A Hypothesis Test about Correlation and Slope in a Simple Linear Regression

Geostatistics Exploratory Analysis

Chapter 1: Looking at Data Section 1.1: Displaying Distributions with Graphs

Simple Linear Regression, Scatterplots, and Bivariate Correlation

Lecture 2: Descriptive Statistics and Exploratory Data Analysis


Module 3: Correlation and Covariance

Algebra 1 Course Information

Chapter 5 Analysis of variance SPSS Analysis of variance

DETERMINANTS OF CAPITAL ADEQUACY RATIO IN SELECTED BOSNIAN BANKS

Problem of the Month Through the Grapevine

Lab 5 Linear Regression with Within-subject Correlation. Goals: Data: Use the pig data which is in wide format:

Multiple Regression: What Is It?

Straightening Data in a Scatterplot Selecting a Good Re-Expression Model

The average hotel manager recognizes the criticality of forecasting. However, most

Statistics 151 Practice Midterm 1 Mike Kowalski

Getting Correct Results from PROC REG

STATS8: Introduction to Biostatistics. Data Exploration. Babak Shahbaba Department of Statistics, UCI

International Statistical Institute, 56th Session, 2007: Phil Everson

1. The parameters to be estimated in the simple linear regression model Y=α+βx+ε ε~n(0,σ) are: a) α, β, σ b) α, β, ε c) a, b, s d) ε, 0, σ

Transcription:

Correlation and Regression Scatterplots Correlation Explanatory and response variables Simple linear regression General Principles of Data Analysis First plot the data, then add numerical summaries Look for overall patterns and deviations from those patterns When overall pattern is regular, use a compact mathematical model to describe it 1

General Principles of Data Analysis Plot your data To understand the data, always start with a series of graphs Interpret what you see Look for overall pattern and deviations from that pattern Numerical summary? Choose an appropriate measure to describe the pattern and deviation Mathematical model? If the pattern is regular, summarize the data in a compact mathematical model Univariate Data Analysis Plot your data For continuous variable, use stemplot, histogram For categorical variable, use bar chart, dot plot Interpret what you see Describe distribution in terms of shape, center, spread, outliers Numerical summary? Select measure of central tendency and spread: mean, standard deviation, five-number summary Mathematical model? If appropriate, use Normal distribution as model for overall pattern 2

Bivariate Data Analysis Plot your data For two quantitative variables, use a scatterplot Interpret what you see Describe the direction, form, and strength of the relationship Numerical summary? If pattern is roughly linear, summarize with correlation, means, and standard deviations Mathematical model? Regression gives a compact model of overall pattern, if relationship is roughly linear Explanatory and Response Variables Response variable measures outcome of a study Explanatory variable explains or influences change in response variable Response variables often called dependent variables, explanatory independent Independent and dependent have other meanings in statistics, so prefer to avoid But remember that calling one variable explanatory and other response doesn t necessarily imply cause 3

Scatterplot Scatterplot shows relationship between two quantitative variables measured on same cases By convention, explanatory variable on horizontal axis, response on vertical axis Each case appears as point fixed by values of both variables Wine Consumption and Heart Attacks Some evidence that drinking moderate amounts of wine my help prevent heart attacks We have the following data from 19 countries Yearly wine consumption (liters of alcohol from wine, per person) Yearly deaths (per 100,000 people) from heart disease In Stata, use -twoway scatter- Interpret a scatterplot Overall pattern and striking deviations Form, direction, and strength Look for values that fall outside overall pattern of relationship (outlier) 4

Heart Disease Deaths (per 100,000 people) 50 100 150 200 250 300 0 2 4 6 8 10 Alcohol with Wine (liters per person per year) Measuring Linear Association: Correlation Correlation measures direction and strength of linear relationship between two quantitative variables Usually written as r In Stata, use -correlate- or -pwcorr- Find and interpret correlation for wine and heart disease example 5

Using and Interpreting Correlation Ranges from -1 to 1; values closer to 1 indicate stronger linear relationship Positive values indicate positive association Does not distinguish between explanatory and response variables Requires that both variables be quantitative It has no unit of measurement because it uses standardized values, it is scale free Measures strength only of linear relationships Like mean and standard deviation, strongly affected by outlying observations Least-Squares Regression Line Correlation measures direction and strength of linear relationships A regression line summarizes relationship between explanatory, x, and response variable, y We can use regression line to predict value of y for a given value of x These predictions have error, called residuals The least-squares regression line of y is the line that minimizes residuals 6

Heart disease death rate (per 100,000) 50 100 150 200 250 300 A good line for prediction makes these distances small Vertical distances from least-squares line are residuals 0 2 4 6 8 10 Alcohol with Wine (liters per person per year) In Stata, obtain this graph with twoway (lfit heartdis alcohol) (scatter heartdis alcohol) Regression in Stata regress regress heartdis heartdis alcohol alcohol Source Source SS SS df df MS MS Number Number of of obs obs 19 19 -------------+------------------------------ -------------+------------------------------ F( F( 1, 1, 17) 17) 41.69 41.69 Model Model 59813.5718 59813.5718 1 1 59813.5718 59813.5718 Prob Prob > > F F 0.0000 0.0000 Residual Residual 24391.3756 24391.3756 17 17 1434.7868 1434.7868 R-squared R-squared 0.7103 0.7103 -------------+------------------------------ -------------+------------------------------ Adj Adj R-squared R-squared 0.6933 0.6933 Total Total 84204.9474 84204.9474 18 18 4678.05263 4678.05263 Root Root MSE MSE 37.879 37.879 slope, b ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ heartdis heartdis Coef. Coef. Std. Std. Err. Err. t t P>t P>t [95% [95% Conf. Conf. Interval] Interval] -------------+---------------------------------------------------------------- -------------+---------------------------------------------------------------- alcohol alcohol -22.96877-22.96877 3.55739 3.55739-6.46-6.46 0.000 0.000-30.4742-30.4742-15.46333-15.46333 _cons _cons 260.5634 260.5634 13.83536 13.83536 18.83 18.83 0.000 0.000 231.3733 231.3733 289.7534 289.7534 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ y-intercept, a y ^ a + bx Estimated heart disease death rate 260.56 + (-22.97)(Per capita alcohol consumption) 7

Using and Interpreting Regression Distinction between explanatory and response variables is essential in regression Regression of y on x regression of x on y There is a close connection between correlation and slope of least-squares line b r(s y / s x ) Change of 1 sd in x corresponds to a change of r standard deviations in y Square of correlation, r 2, is fraction of variation in values of y explained by x (PRE) Conditions for Inference Observations are independent True relationship is linear Standard deviation of response about the true line is same everywhere Response varies normally about true regression line Analysis of residuals is key to diagnosing violations of these conditions 8

Residuals-versus-Fitted Plot Residuals -50 0 50 50 100 150 200 250 Fitted values In Stata, obtain this plot after regress with rvfplot, yline(0) Residuals-versus-Predictor Plot Residuals -50 0 50 0 2 4 6 8 10 Alcohol with Wine (liters per person per year) In Stata, obtain this plot after regress with rvpplot alcohol, yline(0) 9

95% Confidence Interval for Least-Squares Line Heart disease deaths per 100,000 people 0 100 200 300 0 2 4 6 8 10 Alcohol with Wine (liters per person per year) Obtain this graph with twoway (lfitci heartdis alcohol) (scatter heartdis alcohol) 10