Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stat 112 Notes 4 Today: Review of p-values for one-sided tests

Similar presentations


Presentation on theme: "Stat 112 Notes 4 Today: Review of p-values for one-sided tests"— Presentation transcript:

1 Stat 112 Notes 4 Today: Review of p-values for one-sided tests
Chapter (Assessing the fit of the regression line). Chapter (Prediction Intervals) Chapter 3.7 (Some Cautions in Interpreting Regression Results) Homework 1 due on Thursday For Thursday’s office hours, for this week only, I will hold them from 1-2 instead of after class (I have my usual office hours today after class).

2 p-values for one-sided tests example: Poverty Rates and Doctors

3 Example: One Sided Test

4 Example Continued: One and Two Sided Tests

5 Teachers’ Salaries and Dating
In U.S. culture, it is usually considered impolite to ask how much money a person makes. However, suppose that you are single and are interested in dating a particular person. Of course, salary isn’t the most important factor when considering whom to date but it certainly is nice to know (especially if it is high!) In this case, the person you are interested in happens to be a high school teacher, so you know a high salary isn’t an issue. Still you would like to know how much she or he makes, so you take an informal survey of 11 high school teachers that you know.

6

7

8 You happen to know that the person you are interested in has been teaching for 8 years.
How can you use this information to better predict your potential date’s salary? Regression Analysis to the Rescue! You go back to each of the original 11 teachers you surveyed and ask them for their years of experience. Simple Linear Regression Model: E(Y|X)= , the distribution of Y given X is normal with mean and standard deviation

9

10 Predicted salary of your potential date who has been a teacher for 8 years = Estimated Mean salary for teachers of 8 years = *8 = $54,100 How far off will your estimate typically be? Root mean square error = Estimated standard deviation of Y|X = $4, Notice that the typical error of your estimate of teacher salary using experience, $4,610.93, is less than that of using only information on mean teacher salary, $6, Regression analysis enables you to better predict your potential date’s salary.

11 R Squared How much better predictions of your potential date’s salary does the simple linear regression model provide than just using the mean teacher’s salary? This is the question that R squared addresses. R squared: Number between 0 and 1 that measures how much of the variability in the response the regression model explains. R squared close to 0 means that using regression for predicting Y|X isn’t much better than mean of Y, R squared close to 1 means that regression is much better than the mean of Y for predicting Y|X.

12 R Squared Formula Total sum of squares = = the sum of squared prediction errors for using sample mean of Y to predict Y Residual sum of squares = , where is the prediction of Yi from the least squares line.

13 What’s a good R squared? A good R2 depends on the context. In precise laboratory work, R2 values under 90% might be too low, but in social science contexts, when a single variable rarely explains great deal of variation in response, R2 values of 50% may be considered remarkably good. The best measure of whether the regression model is providing predictions of Y|X that are accurate enough to be useful is the root mean square error, which tells us the typical error in using the regression to predict Y from X.

14 Connection between Correlation and R Squared

15 More Information About Your Potential Date’s Salary: Prediction Intervals
From the regression model, you predict that your potential date’s salary is $54,100 and the typical error you expect to make in your prediction is $4,611. Suppose you want to know an interval that will most of the time (say 95% of the time) contain your date’s salary? We can find such a prediction interval by using the fact that under the simple linear regression model, the distribution of Y|X is normal, here the subpopulation of teachers with 8 years of experience has a normal distribution with estimated mean $54,100 and estimated standard deviation $4,611.

16 Prediction Interval A 95% prediction interval has the property that if we repeatedly take samples from a population with the simple regression model where are fixed at their current values and then sample with ,the prediction interval will contain % of the time.

17 Prediction Interval for Your Date’s Salary
Suppose your date has 8 years of experience.

18

19 Prediction Intervals in JMP
After using Fit Line, click the red triangle next to Linear Fit and click Confid Curves Indiv. Use the crosshair tool (under Tools) to find the exact prediction interval for a particular x value.

20 Approximate Prediction Intervals

21 Forecasting Outside the Range of the Explanatory Variable (Extrapolation)
When constructing estimates of or predicting individual values of a Y based on , caution must be used if is outside the range of the observed x’s. The data does not provide information about whether the simple linear regression model continues to hold outside of the range of the observed x’s. Prediction intervals only account for (1) variability in Y given X; (2) uncertainty in the estimates of the slope and intercept given that the simple linear regression model is true. When is outside the range of the observed x’s, the prediction interval might not be accurate.

22 Olympic Long Jump: Length of gold medal jump (Y) vs. Year (X)

23 Predictions from Long Jump Simple Linear Regression Model
Predicted Olympic gold medal winning long jumps: 2012 (London): *2012 = feet 2032: *2032 = feet 3000: *3000 = feet 95% Prediction Interval for Year 3000: Prediction interval is not reasonable! Predicting winning distance for year 3000 is an extrapolation

24 Association vs. Causality
A high in a simple linear regression of Y on X means that X has a strong linear relationship with Y, in other words changes in X are strongly associated with changes in the mean of Y. It does not imply that changes in X causes changes in Y. Alternative explanations for high : Reverse is true. Y causes X. There may be a lurking (confounding) variable related to both x and y which is the common cause of x and y

25

26 Review R squared measures how much better the regression model predicts Y than just using the mean of Y. 95% prediction interval: interval that contains new observation’s Y given the new observation’s X with 95% probability. Approximately 95% of observations are within 2 RMSEs of their predicted value given their X Cautions in Interpreting Regression: Prediction intervals for X values outside the range of the observed X variables may not be accurate. Regression measures the association between X and the mean of Y and does not necessarily measure the causal effect of X on Y. Next Class Sections 3.5.2, 3.6


Download ppt "Stat 112 Notes 4 Today: Review of p-values for one-sided tests"

Similar presentations


Ads by Google