Line of best fit

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Line of best fit

Paul Jeffries-2
How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 
 
Thanks,
Paul
 
Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802
Reply | Threaded
Open this post in threaded view
|

Re: Line of best fit

ViAnn Beadle

Linear fit or something else?

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Paul Jeffries
Sent: Tuesday, September 15, 2009 3:59 PM
To: [hidden email]
Subject: Line of best fit

 

How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 

 

Thanks,

Paul

 

Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802

Reply | Threaded
Open this post in threaded view
|

Re: Line of best fit

ViAnn Beadle

Questions like this come up all the time so I’m going to go into some depth here  to talk about chart generation within SPSS, so bear with me.

 

There are three procedures in SPSS which generate general purpose charts:

 

GRAPH—User interfaces available from Graph>Legacy Dialogs>

IGRAPH—User interfaces available from Graph>Legacy Dialogs>Interactive

GGRAPH—User interface available from Graph>Chart Builder

 

All three are available for upward compatibility reasons with Graph being introduced in SPSS/PC; IGRAPH in Release 8 of SPSS-X; and GGRAPH in release 14 of SPSS-X. Although there is considerable overlap in functionality, linear fit lines are available from each of these command.

The following examples use the sample dataset Employee Data.sav.

 

GRAPH:

 

Fit lines are available via editing through the chart editor (see help for details). A chart template containing the fit line can be saved and then applied via GRAPH syntax:

 

GRAPH

  /SCATTERPLOT(BIVAR)=salbegin WITH salary

  /MISSING=LISTWISE

  /TEMPLATE='C:\Users\Vi\Desktop\simplefitline.sgt'.

 

The template is an XML file with the following contents:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<template SPSS-Version="1.4" date="2009-09-15" description="" selectPath="78 " xmlns="http://xml.spss.com/spss/visualization" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xml.spss.com/spss/visualization http://xml.spss.com/spss/visualization/vizml-template-3.1.xsd">

                <addFitLine target="pair" type="linear"/>

</template>

 

 

IGRAPH

 

A variety of fit lines are available via syntax and provided from the User Interface for scatterplots. The FITLINE subcommand produces a linear fit line.

 

IGRAPH

  /VIEWNAME='Scatterplot'

  /X1=VAR(salbegin) TYPE=SCALE

  /Y=VAR(salary) TYPE=SCALE

  /COORDINATE=VERTICAL

  /FITLINE METHOD=REGRESSION LINEAR LINE=TOTAL SPIKE=OFF

  /YLENGTH=5.2

  /X1LENGTH=6.5

  /CHARTLOOK='NONE'

  /SCATTER COINCIDENT=NONE.

 

 

 

GGRAPH

 

GGRAPH relies upon a higher level language called GPL  which generates vizML. It provides considerably more control over the contents of a chart. If you’re willing to dig into the GPL reference manual, you will be able to generate a large variety of charts which are not available from GRAPH and IGRAPH. With functional richness comes syntactical complexity. In general, GPL doesn’t provide a lot of formatting which is available via traditional chart  templates and the new Graphboard Template Chooser (17 and up).

 

The Chart Builder UI doesn’t provide a fit line but a simple addition to the GPL generated from Chart Builder will do the trick. The ELEMENT:line statement  produces the linear fit line by using the smooth.linear function and is added by hand to the command pasted from the Chart Builder.

 

GGRAPH

  /GRAPHDATASET NAME="graphdataset" VARIABLES=salbegin salary MISSING=LISTWISE REPORTMISSING=NO

  /GRAPHSPEC SOURCE=INLINE.

BEGIN GPL

  SOURCE: s=userSource(id("graphdataset"))

  DATA: salbegin=col(source(s), name("salbegin"))

  DATA: salary=col(source(s), name("salary"))

  GUIDE: axis(dim(1), label("Beginning Salary"))

  GUIDE: axis(dim(2), label("Current Salary"))

  ELEMENT: point(position(salbegin*salary))

  ELEMENT: line(position(smooth.linear(salbegin*salary)))

END GPL.

 

 

I’m not sure if this clears anything up but you can always look for it the SPSSX-L archive.

 

From: Paul Jeffries [mailto:[hidden email]]
Sent: Tuesday, September 15, 2009 6:51 PM
To: ViAnn Beadle
Subject: RE: Line of best fit

 

Yes, linear fit.

 

 

Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802


From: ViAnn Beadle [[hidden email]]
Sent: Tuesday, September 15, 2009 6:29 PM
To: Paul Jeffries; [hidden email]
Subject: RE: Line of best fit

Linear fit or something else?

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Paul Jeffries
Sent: Tuesday, September 15, 2009 3:59 PM
To: [hidden email]
Subject: Line of best fit

 

How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 

 

Thanks,

Paul

 

Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802

Reply | Threaded
Open this post in threaded view
|

Re: Line of best fit

John F Hall
In reply to this post by Paul Jeffries-2

Not sure if this will work as the list won't accept attachments.
 
Here's what I sent ViAnne and Paul.  All offers of animation will be gratefully accepted.
 

 

From:   John Hall

To:       ViAnn Beadle, Paul Jeffries

Cc:       Anyone else interested in the teaching side of things

 

Graphic teaching aids for regression and correlation

 

I've been using SPSS since 1971, but was totally new to this sort of thing in 2005 when updating teaching materials.  I tried to reproduce my classroom demo on regression and correlation. 

My students tended to be from sociology and related areas, and generally had little or no previous experience of computing or statistics.

 

SPSS was never intended to do this next bit: it probably needs a professional animator.  Open Umiversity in UK has some good animations for stats.  I'm a lot more fluent now in Windows and Word and also have a scanner to produce jpg or pdf files, but here's what I attempted at the time. 

 

Anyway I started off in Word:

 

Original handmade scatterplot

 

            |                                                                       x          x          x          x

            |                                                                  x        x           x

            |                                                           x  x                   x          x

            |                            x       x                                x         

Y         |                 x                            x          x  x

            |                                   x  x  x               x          x

            |           x        x x          x

            |                       x

            |                       x  x

            |           x         

            |________________________________________________________

 

                                                            X

 

Draw vertical line through mean x and horizontal line through mean y

 

            |                                              |                       

            |                                              |                   x        x           x

            |                                              |            x  x                   x          x

            |                            x       x       |             x         

Y         |                 x                           |x           x  x

Mean y| - - - - - - - x - - - - - - - - -۞x - - - - - - - - - - - - - - - - - - - - - - - - - - -

            |           x        x x         |x

            |                       x                     |

            |                       x  x                  |

            |           x                                 |           

            |________________________________________________________

                                                mean x

                                                            X

 

 

..but then I got stuck and tried it in some long-forgotten graphics software package ?? Fireworks ??

Plot lines again

 

<IMG height=261 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image002.jpg" width=348 v:shapes="_x0000_i1025">

Imagine the whole scattergram is a wooden board and the horizontal blue line is a rigid pole with a hole in it and a nail hammered through it into the board at the intersection of means so that it is free to rotate.  Hold the pole steady and attach elastic bands vertically from each data point to the pole.

 

<IMG height=241 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image004.jpg" width=364 v:shapes="_x0000_i1026">

What will happen if I let go of the pole?  Yup, even social work students get this one! 

 

<IMG height=252 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image006.jpg" width=380 v:shapes="_x0000_i1027">

Students easily understood  that the pole stops rotating when all the tensions balance out  (green line) although I'm not sure if the mathematics of elastic is exactly the same for minimising sums of squares.  After that it's easy to explain that the pole actuall represents the regression line of y on x.

 

Now  do the same with the red line and attach elastic bands horizontally from each data point.

 

<IMG height=273 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image008.jpg" width=364 v:shapes="_x0000_i1028">

What happens when I let go of the pole?  Yup, right again!

 

<IMG height=261 src="file://C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image010.jpg" width=348 v:shapes="_x0000_i1029">

So this (pink line) must be the regression line of x on y then?

 

Somewhere in here I used the diagrams to explain why you have to square the distances from each data point to the mean before adding them together, otherwise the negative ones cancel out the positive ones, before calculating variance and standard deviations.  Going step by step through the process, one data point at a time, helped to build up an equation (very gently).

 

Haven't got a diagram for the next bit, unless I dig my old overhead projector transparencies out, but, if you overlay two diagrams with the green and purple lines, you can explain correlation in terms of the cosine of the angle between the two regression lines.  Cosine 90° is 0, cosine 0° is 1, et voilà!

 

I never used artificial data in any of my classes. All examples were drawn from professional quality surveys (even small data sets sampled cases from full scale surveys) or from official published sources (eg health, crime and similar statistics).

 

 

16 Sep 2009

----- Original Message -----
Sent: Tuesday, September 15, 2009 11:58 PM
Subject: Line of best fit

How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 
 
Thanks,
Paul
 
Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802
Reply | Threaded
Open this post in threaded view
|

Re: Line of best fit

ViAnn Beadle

SPSS will generate the various states but not the animation. For that I would recommend using something like Flash to build it and display it in the browser of choice. Similarly, the tutor/tutee could step through an overlaid PowerPoint.  However, I seem to recall seeing some java applets that do pretty much the same thing.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Wednesday, September 16, 2009 4:06 AM
To: [hidden email]
Subject: Re: Line of best fit

 

Not sure if this will work as the list won't accept attachments.

 

Here's what I sent ViAnne and Paul.  All offers of animation will be gratefully accepted.

 


 

From:   John Hall

To:       ViAnn Beadle, Paul Jeffries

Cc:       Anyone else interested in the teaching side of things

 

Graphic teaching aids for regression and correlation

 

I've been using SPSS since 1971, but was totally new to this sort of thing in 2005 when updating teaching materials.  I tried to reproduce my classroom demo on regression and correlation. 

My students tended to be from sociology and related areas, and generally had little or no previous experience of computing or statistics.

 

SPSS was never intended to do this next bit: it probably needs a professional animator.  Open Umiversity in UK has some good animations for stats.  I'm a lot more fluent now in Windows and Word and also have a scanner to produce jpg or pdf files, but here's what I attempted at the time. 

 

Anyway I started off in Word:

 

Original handmade scatterplot

 

            |                                                                       x          x          x          x

            |                                                                  x        x          x

            |                                                           x  x                  x          x

            |                            x       x                                x         

Y         |                 x                            x          x  x

            |                                   x  x  x              x          x

            |           x        x            x          x

            |                       x

            |                       x  x

            |           x         

            |________________________________________________________

 

                                                            X

 

Draw vertical line through mean x and horizontal line through mean y

 

            |                                              |                       

            |                                              |                   x        x          x

            |                                              |            x  x                  x          x

            |                            x       x       |                        x         

Y         |                 x                           |x          x  x

Mean y| - - - - - - - x - - - - - - - - -۞x - - - - - - - - - - - - - - - - - - - - - - - - - - -

            |           x        x            x         |x

            |                       x                     |

            |                       x  x                 |

            |           x                                 |           

            |________________________________________________________

                                                mean x

                                                            X

 

 

..but then I got stuck and tried it in some long-forgotten graphics software package ?? Fireworks ??

Plot lines again

 

<img width=348 height=261 id="_x0000_i1026" src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image002.jpg">

Imagine the whole scattergram is a wooden board and the horizontal blue line is a rigid pole with a hole in it and a nail hammered through it into the board at the intersection of means so that it is free to rotate.  Hold the pole steady and attach elastic bands vertically from each data point to the pole.

 

<img width=364 height=241 id="_x0000_i1027" src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image004.jpg">

What will happen if I let go of the pole?  Yup, even social work students get this one! 

 

<img width=380 height=252 id="_x0000_i1028" src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image006.jpg">

Students easily understood  that the pole stops rotating when all the tensions balance out  (green line) although I'm not sure if the mathematics of elastic is exactly the same for minimising sums of squares.  After that it's easy to explain that the pole actuall represents the regression line of y on x.

 

Now  do the same with the red line and attach elastic bands horizontally from each data point.

 

<img width=364 height=273 id="_x0000_i1029" src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image008.jpg">

What happens when I let go of the pole?  Yup, right again!

 

<img width=348 height=261 id="_x0000_i1030" src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image010.jpg">

So this (pink line) must be the regression line of x on y then?

 

Somewhere in here I used the diagrams to explain why you have to square the distances from each data point to the mean before adding them together, otherwise the negative ones cancel out the positive ones, before calculating variance and standard deviations.  Going step by step through the process, one data point at a time, helped to build up an equation (very gently).

 

Haven't got a diagram for the next bit, unless I dig my old overhead projector transparencies out, but, if you overlay two diagrams with the green and purple lines, you can explain correlation in terms of the cosine of the angle between the two regression lines.  Cosine 90° is 0, cosine 0° is 1, et voilà!

 

I never used artificial data in any of my classes. All examples were drawn from professional quality surveys (even small data sets sampled cases from full scale surveys) or from official published sources (eg health, crime and similar statistics).

 

 

16 Sep 2009

----- Original Message -----

Sent: Tuesday, September 15, 2009 11:58 PM

Subject: Line of best fit

 

How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 

 

Thanks,

Paul

 

Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802

Reply | Threaded
Open this post in threaded view
|

Re: Line of best fit

John F Hall

Miaow!  It's only a 2003 HP Pavilion with Pentium 4 chip, 140 gb HD and enhanced 1 mb RAM.  Out in rural France it's copper wires and max 1.2 mb broadband.  No multimillion $$$ behind me, I'm afraid.  Java scripts can be enabled, but I get no prompt as I do with mail from the Social Research Association (which comes through bright and clear)
 
I'm reminded of a brilliant rear cover on the University of London Computing Centre magazine in the 1970s.  It was a 3 x 3 matrix of 9 cartoons representing various designs for a swing, including all sorts of Heath Robinson contraptions designed by everyone from the systems analyst to the whoever in the first 8 pix, but the last one was "What the customer wanted": it was a picture of an old car tyre on the end of a rope attached to a branch.
 
Why do I sometimes feel like that about SPSS?
----- Original Message -----
Sent: Thursday, September 17, 2009 7:41 PM
Subject: RE: Line of best fit

These are java applets. Perhaps your browser settings are blocking applets or is so old it doesn’t know anything about java.

 

From: John F Hall [mailto:[hidden email]]
Sent: Thursday, September 17, 2009 11:11 AM
To: ViAnn Beadle
Subject: Re: Line of best fit

 

Thanks for the links: I can read the text, but the pix are blocked X in the square, even after I click to unblock.  Any suggestions?

----- Original Message -----

Sent: Thursday, September 17, 2009 5:21 PM

Subject: RE: Line of best fit

 

Here are some little applets I found on line to explain regression:

 

http://www.stat.sc.edu/~west/javahtml/Regression.html

 

http://standards.nctm.org/document/eexamples/chap7/7.4/index.htm

 

http://www.stat.wvu.edu/SRS/Modules/Applets/Regression/regression.html

 

Powerpoints are not very interactive. You simply set up a series of overlays that are added to the slide and can then play them through, backwards or forwards.

 

 

 

From: John F Hall [mailto:[hidden email]]
Sent: Wednesday, September 16, 2009 2:20 PM
To: ViAnn Beadle
Subject: Re: Line of best fit

 

Yes, I have PowerPoint, but have only used it once for my presentation to European SPSS users in York in 2006.  I'd never used it before, so it  could do with some tidying up, but it was useful to have the five slide shows when making my points about changes to SPSS since 1972, about uses of SPSS in major surveys and in the Pallant book, and about the clear superiority of syntax.  Check the shows out on http://independent.academia.edu/JohnFHall/Talks.  The first one is fun.

 

I didn't teach logic, I emphasised the logic of survey analysis.  To some degree SPSS was incidental, but it was the only software around at the time with a decent and widely available manual and English language type instructions.  I was partly responsible for its rapid spread in the UK academic and public sectors.

 

 ----- Original Message -----

Sent: Wednesday, September 16, 2009 9:21 PM

Subject: RE: Line of best fit

 

Yes I did get your Word document—perhaps Paul Jeffries blocks email for all those he doesn’t know (I know that some subscribers to the list do that to avoid annoying requests for help from students and lurkers.

 

Flash does require a flash coding application (from Adobe) and that isn’t cheap. The Java applets I mentioned have already been created by others and are free other than the price of internet connectivity to get to them. If you have Word, wouldn’t you have PowerPoint?

 

I would think if you’re trying to teach your students logic you wouldn’t even bother with syntax.

 

From: John F Hall [mailto:[hidden email]]
Sent: Wednesday, September 16, 2009 8:27 AM
To: ViAnn Beadle
Subject: Re: Line of best fit

 

ViAnn

 

Thanks for this.  Did the Word attachment get through to you OK with my efforts at charts?  For some reason the charts have just reappeared in this reply.  The one to Paul Jeffries bounced (twice).  For my students, I was more interested in the logic than the mathematics.  I had to teach myself the underlying inferential statistics in order to explain the equations and theory to them.

 

I'm retired on a fractional pension and have no resources other than my own time and determination, plus my free SPSS licence (version 15 for Windows) as an academic author.  I'll have a look at PowerPoint as I used that for my Old Dog, Old Tricks paper, but animation with Flash or Java applets would be a whole new world.

 

This is a back-burner job for me as I still have a stack of basic SPSS tutorials to update, using syntax rather than drop-down menus, for FREQUENCIES, CROSSTABS, RECODE, COUNT, COMPUTE etc. 

 

I'm in the middle of several tutorials dealing with simple attitude scores using COUNT before moving up to COMPUTE.  If you're interested, currently available materials are listed on http://independent.academia.edu/JohnFHall/attachment/345163/full/Guide-to-learning-materials-and-SPSS

 

John

----- Original Message -----

Sent: Wednesday, September 16, 2009 3:03 PM

Subject: RE: Line of best fit

 

SPSS will generate the various states but not the animation. For that I would recommend using something like Flash to build it and display it in the browser of choice. Similarly, the tutor/tutee could step through an overlaid PowerPoint.  However, I seem to recall seeing some java applets that do pretty much the same thing.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of John F Hall
Sent: Wednesday, September 16, 2009 4:06 AM
To: [hidden email]
Subject: Re: Line of best fit

 

Not sure if this will work as the list won't accept attachments.

 

Here's what I sent ViAnne and Paul.  All offers of animation will be gratefully accepted.

 


 

From:   John Hall

To:       ViAnn Beadle, Paul Jeffries

Cc:       Anyone else interested in the teaching side of things

 

Graphic teaching aids for regression and correlation

 

I've been using SPSS since 1971, but was totally new to this sort of thing in 2005 when updating teaching materials.  I tried to reproduce my classroom demo on regression and correlation. 

My students tended to be from sociology and related areas, and generally had little or no previous experience of computing or statistics.

 

SPSS was never intended to do this next bit: it probably needs a professional animator.  Open University in UK has some good animations for stats.  I'm a lot more fluent now in Windows and Word and also have a scanner to produce jpg or pdf files, but here's what I attempted at the time. 

 

Anyway I started off in Word:

 

Original handmade scatterplot

 

            |                                                                       x          x          x          x

            |                                                                  x        x          x

            |                                                           x  x                  x          x

            |                            x       x                                x         

Y         |                 x                            x          x  x

            |                                   x  x  x              x          x

            |           x        x            x          x

            |                       x

            |                       x  x

            |           x         

            |________________________________________________________

 

                                                            X

 

Draw vertical line through mean x and horizontal line through mean y

 

            |                                              |                       

            |                                              |                   x        x          x

            |                                              |            x  x                  x          x

            |                            x       x       |                        x         

Y         |                 x                           |x          x  x

Mean y| - - - - - - - x - - - - - - - - -۞x - - - - - - - - - - - - - - - - - - - - - - - - - - -

            |           x        x            x         |x

            |                       x                     |

            |                       x  x                 |

            |           x                                 |           

            |________________________________________________________

                                                mean x

                                                            X

 

 

..but then I got stuck and tried it in some long-forgotten graphics software package ?? Fireworks ??

Plot lines again

 

<IMG id=_x0000_i1026 height=261 src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image002.jpg" width=348 border=0>

Imagine the whole scattergram is a wooden board and the horizontal blue line is a rigid pole with a hole in it and a nail hammered through it into the board at the intersection of means so that it is free to rotate.  Hold the pole steady and attach elastic bands vertically from each data point to the pole.

 

<IMG id=_x0000_i1027 height=241 src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image004.jpg" width=364 border=0>

What will happen if I let go of the pole?  Yup, even social work students get this one! 

 

<IMG id=_x0000_i1028 height=252 src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image006.jpg" width=380 border=0>

Students easily understood  that the pole stops rotating when all the tensions balance out  (green line) although I'm not sure if the mathematics of elastic is exactly the same for minimising sums of squares.  After that it's easy to explain that the pole represents the regression line of y on x.

 

Now  do the same with the red line and attach elastic bands horizontally from each data point.

 

<IMG id=_x0000_i1029 height=273 src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image008.jpg" width=364 border=0>

What happens when I let go of the pole?  Yup, right again!

 

<IMG id=_x0000_i1030 height=261 src="file:///C:\DOCUME~1\Owner\LOCALS~1\Temp\msohtml1\01\clip_image010.jpg" width=348 border=0>

So this (pink line) must be the regression line of x on y then?

 

Somewhere in here I used the diagrams to explain why you have to square the distances from each data point to the mean before adding them together, otherwise the negative ones cancel out the positive ones, before calculating variance and standard deviations.  Going step by step through the process, one data point at a time, helped to build up an equation (very gently).

 

Haven't got a diagram for the next bit, unless I dig my old overhead projector transparencies out, but, if you overlay two diagrams with the green and purple lines, you can explain correlation in terms of the cosine of the angle between the two regression lines.  Cosine 90° is 0, cosine 0° is 1, et voilà!

 

I never used artificial data in any of my classes. All examples were drawn from professional quality surveys (even small data sets sampled cases from full scale surveys) or from official published sources (eg health, crime and similar statistics).

 

 

16 Sep 2009

----- Original Message -----

Sent: Tuesday, September 15, 2009 11:58 PM

Subject: Line of best fit

 

How can I add a line of best fit onto a scatter diagram.  I am using SPSS 17. 

 

Thanks,

Paul

 

Paul W. Jeffries
Department of Psychology
Washington & Jefferson College
60 South Lincoln Street
Washington, PA 15301
Email:  [hidden email]
Ph.:  724 503 1001 x3363
Fx.:   724 228 3802