1 / 37

# Bivariate Data Analysis - PowerPoint PPT Presentation

Bivariate Data Analysis. Bivariate Data analysis 4. If the relationship is linear the residuals plotted against the original x - values would be scattered randomly above and below the line.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Bivariate Data Analysis' - linh

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Bivariate Data Analysis

Bivariate Data analysis 4

If the relationship is linear the residuals plotted against the original x - values would be scattered randomly above and below the line.

A scatter plot of residuals versus the the original x-values should be boring and have no interesting features, like direction or shape. It should stretch horizontally with about the same amount of scatter throughout. It should show no curves or outliers

r = the original 0.87 indicates a strong linear relationship between x and y

When examining residuals to check whether a linear model is appropriate, it is usually best to plot them. The variation in the residuals is the key to assessing how well the model fits.

The pattern of residuals looks more like a parabola. This should indicate that the data were not really linear, but were more likely to be quadratic.

Discuss this data. should indicate that the data were not really linear, but were more likely to be quadratic.

Outlier? should indicate that the data were not really linear, but were more likely to be quadratic.

Discuss this situation.

Discuss the plot of the residuals should indicate that the data were not really linear, but were more likely to be quadratic.

Discuss this scatter plot should indicate that the data were not really linear, but were more likely to be quadratic.

Linear? should indicate that the data were not really linear, but were more likely to be quadratic.

Residuals should indicate that the data were not really linear, but were more likely to be quadratic.

Useful website should indicate that the data were not really linear, but were more likely to be quadratic.

• http://stat-www.berkeley.edu/~stark/Java/Correlation.htm plots residuals, regression lines etc

Many of our tools for displaying and summarizing data work only when the data meet certain conditions.

We cannot use a linear model unless the relationship between two variables is linear.

Often re-expression can save the day, straightening bent relationships so that we can fit and use a simple linear model.

When a scatterplot shows a CURVED form that consistently increases or decreases, we can often straighten the form of the plot be re-expressing one or both of the variables.

The correlation is 0.979. That sounds pretty high, but the scatter plot shows something is not quite right.

Re-expressing f/stop speed by squaring straightens the plot. scatter plot shows something is not quite right.

This plot looks scatter plot shows something is not quite right.‘straight’. The correlation is now 0.998, but the increase in correlation is not important. (The original value of 0.979 is already large.) What is important is the form of the plot is now straight, so the correlation is now an appropriate measure of association.

Goals of re-expression scatter plot shows something is not quite right.

• Make the distribution (as seen in its histogram, for example) more symmetric.

• Make the form of the scatter plot more nearly linear.

• Make the scatter in a scatter plot spread out evenly rather than following a fan shape.

Some hints scatter plot shows something is not quite right.

• Try y2 for unimodal skewed to the left.

• Try square root of y for counted data.

• Try logs for measurements that can’t be negative and especially when they grow by percentage increases.

• Try -1/y or -1/(square root of y).

• Logs straighten exponential trends and pull in a long right trail.

• Logs straighten power curves.

Try scatter plot shows something is not quite right.y versus x2

Try scatter plot shows something is not quite right.y versus x2

Try log or 1/ scatter plot shows something is not quite right.x

Try log or 1/ scatter plot shows something is not quite right.x

Don scatter plot shows something is not quite right.’t stray too far from the powers suggested. Taking a high power may artificially inflate R2, but it won’t give a useful or meaningful model. It is better to stick with powers between 2 and -2. Even in that range you should prefer the simpler powers in the ladder to those in the cracks. A square root is easier to understand than the 0.413 power.

Comparing histograms and scatter graphs scatter plot shows something is not quite right.

The data in the scatter plot below shows the progression of the fastest times for the men’s marathon since the Second World War. We may want to use this data to predict the fastest time at 1 January 2010 (i.e. 64 years after 1 January 1946).

Page 53

Possible solutions the fastest times for the men

• a quadratic (y = ax2 + bx + c)

• an exponential function (y = aebx)

• a power function (y = axb)

• 2 separate straight lines –

one for say 0 – 23 years and

one for say 23 – 60 years

• a line for only the later years, say 23 – 60 years

Quadratic the fastest times for the men

• Curve seems to fit

• R2 = 0.9592 is very high

• Inappropriate to quote r as it is not linear

• time starts increasing (not sensible)

Page 54

Exponential the fastest times for the men

• Doesn’t fit the data points particularly well

Power the fastest times for the menFunction

• reasonable fit,

• R2 is high

• R2 = 0.9401

Line for only the later years (1969-2003) the fastest times for the men

• Line (1969-2003) – reasonable fit,

• R2 is high

• Note: We only use the later years line for the prediction and ignore the earlier years

The data in the scatter plot below comes from a random sample of 60 models of new cars taken from all models on the market in New Zealand in May 2000. We want to use the engine size to predict the weight of a car.

• Seems to be linear for engine sizes less than 2500cc.

• Very weak or no linear relationship for engine sizes over 2500cc.

• Solution: Fit a line for engine sizes less than 2500cc.

Page 55