Regression in colors

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

Regression in colors

Hector Maletta

A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?

 

Thanks for your help

 

Hector

Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Jon K Peck
Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Hector Maletta <[hidden email]>
To:        [hidden email]
Date:        06/16/2011 09:24 AM
Subject:        [SPSSX-L] Regression in colors
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?
 
Thanks for your help
 
Hector
Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Kornbrot, Diana
Re: Regression in colors What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <peck@...> wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
peck@...
new phone: 720-342-5621




From:       Hector Maletta <hmaletta@...>
To:       SPSSX-L@...
Date:       06/16/2011 09:24 AM
Subject:       [SPSSX-L] Regression in colors
Sent by:       "SPSSX(r) Discussion" <SPSSX-L@...>




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?

Thanks for your help


Hector





Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    http://web.me.com/kornbrot/KornbrotHome.html
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0)
796 890 2102
   fax:      +44 (0) 870 706 4997





Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Jon K Peck
I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
  /PARTIALPLOT ALL. will do all partial plots, and
 /PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Kornbrot, Diana" <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS, "[hidden email]" <[hidden email]>
Date:        06/16/2011 01:24 PM
Subject:        Re: Regression in colors




What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <
peck@...> wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM

peck@...
new phone: 720-342-5621




From:      
Hector Maletta <hmaletta@...>
To:      
SPSSX-L@...
Date:      
06/16/2011 09:24 AM
Subject:      
[SPSSX-L] Regression in colors
Sent by:      
"SPSSX(r) Discussion" <SPSSX-L@...>




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    
http://web.me.com/kornbrot/KornbrotHome.html
Work

School of Psychology
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
  fax:     +44 (0) 170 728 5073
Home
19 Elmhurst Avenue
London N2 0LT, UK
   voice:   +44 (0) 208 883  3657
   mobile: +44 (0) 796 890 2102
  fax:      +44 (0) 870 706 4997





Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

ViAnn Beadle
In reply to this post by Hector Maletta

Have him save the predictors from regression and use any one of the various graphing procedures. GRAPH, IGRAPH, XGRAPH, and GGRAPH all provide grouping via a categorical variable.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Hector Maletta
Sent: Thursday, June 16, 2011 9:20 AM
To: [hidden email]
Subject: Regression in colors

 

A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?

 

Thanks for your help

 

Hector

Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Hector Maletta
In reply to this post by Jon K Peck

Thanks, Jon. I knew about that. What I meant is to have it in one step, as a standard outcome of REGRESSION. Since this procedure does produce a scatterplot with text labels for each point according to values of a specified variable, it may well have colors or markers according to the values of the external variable. In fact, the text labels in a regression output is seldom useful: a scatterplot with text attached to every point is usually a mess unless the points are really few and quite apart from each other, in which case REGRESSION would be seldom be advisable (too few points, not close to each other).

 

Hector

 

De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de Jon K Peck
Enviado el:
Thursday, June 16, 2011 16:00
Para: [hidden email]
Asunto: Re: Regression in colors

 

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Hector Maletta <[hidden email]>
To:        [hidden email]
Date:        06/16/2011 09:24 AM
Subject:        [SPSSX-L] Regression in colors
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?
 
Thanks for your help
 
Hector


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1382 / Virus Database: 1513/3707 - Release Date: 06/16/11

Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Jon K Peck
Those point labels are really most useful when the points are isolated, because you generally want to know who the outliers are.  But since the labelling variable is often a case id, just coloring automatically by the id variable would probably not be wise.  You can turn off all the labels with one gesture and then turn them on selectively in the Chart Editor.  That works for outliers, but it isn't much help for the example in question.

The trouble with this is feature creep.  As soon as you start enhancing the chart, a million other improvement come up, so soon you wind up with an entire graphics interface inside Regression - and why just regression?

So we thought it best to pass responsibility for more elaborate charting to the procedures that are actually dedicated to graphics such as the Chart Builder or GraphBoard Template Chooser.  If someone wanted to automate a particular style of charting just for regression, though, it would be easy to do with a macro or programmability extension command.  And that could have its own custom dialog box with just the features one wanted there.  When I teach a course on this, I do an example of an alternative interface to Summarize that, in fact, includes charts.

Regards,

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Hector Maletta" <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS, <[hidden email]>
Date:        06/16/2011 02:57 PM
Subject:        RE: Regression in colors




Thanks, Jon. I knew about that. What I meant is to have it in one step, as a standard outcome of REGRESSION. Since this procedure does produce a scatterplot with text labels for each point according to values of a specified variable, it may well have colors or markers according to the values of the external variable. In fact, the text labels in a regression output is seldom useful: a scatterplot with text attached to every point is usually a mess unless the points are really few and quite apart from each other, in which case REGRESSION would be seldom be advisable (too few points, not close to each other).
 
Hector
 
De: SPSSX(r) Discussion [[hidden email]] En nombre de Jon K Peck
Enviado el:
Thursday, June 16, 2011 16:00
Para:
[hidden email]
Asunto:
Re: Regression in colors

 
Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621





From:        
Hector Maletta <[hidden email]>
To:        
[hidden email]
Date:        
06/16/2011 09:24 AM
Subject:        
[SPSSX-L] Regression in colors
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>






A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?

 
Thanks for your help

 
Hector


No virus found in this message.
Checked by AVG -
www.avg.com
Version: 10.0.1382 / Virus Database: 1513/3707 - Release Date: 06/16/11

Reply | Threaded
Open this post in threaded view
|

Automatic reply: Regression in colors

Sarraf, Shimon Aaron

I will be out of the office until Monday, June 27. If you need immediate assistance, please call 812-856-5824. I will respond to your e-mail as soon as possible.

 

Thank you,

Shimon Sarraf

Center for Postsecondary Research

Indiana University Bloomington

 

Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Kornbrot, Diana
In reply to this post by Jon K Peck
Re: Regression in colors Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list
  1. if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
  2. can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]
Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <peck@...> wrote:

I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
  /PARTIALPLOT ALL. will do all partial plots, and
 /PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM
peck@...
new phone: 720-342-5621




From:       "Kornbrot, Diana" <d.e.kornbrot@...>
To:       Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:       06/16/2011 01:24 PM
Subject:       Re: Regression in colors




What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <peck@...
<peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
peck@...
<peck@...>
new phone: 720-342-5621




From:       
Hector Maletta <hmaletta@... <hmaletta@...> >
To:       SPSSX-L@... <SPSSX-L@...>
Date:       06/16/2011 09:24 AM

Subject:       [SPSSX-L] Regression in colors
Sent by:       "SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email:  d.e.kornbrot@... <d.e.kornbrot@...>   
web:    http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0) 796 890 2102
   fax:      +44 (0) 870 706 4997









Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    http://web.me.com/kornbrot/KornbrotHome.html
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0)
796 890 2102
   fax:      +44 (0) 870 706 4997





Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Jon K Peck
Partial plots are supported in the Regression Plots subdialog.  There is a checkbox for doing all partial plots - Produce all partial plots.  Specifying a subset  of these would require syntax, although one could just paste and change ALL to the variables desired.

As for interactions, regression does not address these specifically, but GLM (or General Linear Model>Univariate) does.  That includes a number of useful plots involving interactions, though not exactly what you are looking for.

Maybe it would be useful to produce an extension command (with dialog box) that did a set of plots of one variable vs each of a specified set with optional coloring by a group.  This can, of course, be constructed with the Chart Editor, but that takes several steps, so packaging a set of these  would simplify the process.

I would be interested in hearing more about exactly what plotting logic would be appropriate.  While it would be difficult to get this into the standard releases, and even then it would be subject to the long release cycle, it would be easy to do an extension command.

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Kornbrot, Diana" <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS
Cc:        "[hidden email]" <[hidden email]>
Date:        06/17/2011 04:58 AM
Subject:        Re: Regression in colors




Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list

1.        if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
2.        can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]
Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <
peck@...> wrote:

I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
 /PARTIALPLOT ALL. will do all partial plots, and
/PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM

peck@...
new phone: 720-342-5621




From:      
"Kornbrot, Diana" <d.e.kornbrot@...>
To:      
Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:      
06/16/2011 01:24 PM
Subject:      
Re: Regression in colors




What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <
peck@... <peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM

peck@... <peck@...>
new phone: 720-342-5621




From:      
Hector Maletta <hmaletta@... <hmaletta@...> >
To:      
SPSSX-L@... <SPSSX-L@...>
Date:      
06/16/2011 09:24 AM
Subject:      
[SPSSX-L] Regression in colors
Sent by:      
"SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email:  
d.e.kornbrot@... <d.e.kornbrot@...>  
web:    
http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work

School of Psychology
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
  fax:     +44 (0) 170 728 5073
Home
19 Elmhurst Avenue
London N2 0LT, UK
   voice:   +44 (0) 208 883  3657
   mobile: +44 (0) 796 890 2102
  fax:      +44 (0) 870 706 4997









Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    
http://web.me.com/kornbrot/KornbrotHome.html
Work

School of Psychology
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
  fax:     +44 (0) 170 728 5073
Home
19 Elmhurst Avenue
London N2 0LT, UK
   voice:   +44 (0) 208 883  3657
   mobile: +44 (0) 796 890 2102
  fax:      +44 (0) 870 706 4997





Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Art Kendall
In reply to this post by Kornbrot, Diana
improvement on the GUI are certainly worthwhile.  However, I believe that it is a disservice to not teach students that the GUI is is great way to write a _draft_ of the analysis process.  Analysis is almost always iterative in the sense of continuously improving the output as communication.  Also using the syntax has many advantages: one does not have to rely on short term memory to know what one did when refining/polishing/fixing an analysis.  Having students "reference" (review) each others syntax, helps them establish the habit of having their work cross checked. Syntax helps with the fact that one will inevitably be interrupted while setting up an analysis.  Showing syntax facilitates getting help from  other students, instructors, help desks, and lists like this one.  Using syntax instills the habit of being sure that there is an "audit trail".  Now that many disciplines' ethics codes and grant-giving agencies require sharing data and metadata syntax is often needed.  etc. etc.

Art Kendall
Social Research Consultants


On 6/17/2011 6:57 AM, Kornbrot, Diana wrote:
Re: Regression in colors Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list
  1. if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
  2. can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]
Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <peck@...> wrote:

I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
  /PARTIALPLOT ALL. will do all partial plots, and
 /PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM
peck@...
new phone: 720-342-5621




From:       "Kornbrot, Diana" <d.e.kornbrot@...>
To:       Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:       06/16/2011 01:24 PM
Subject:       Re: Regression in colors




What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <peck@...
<peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
peck@...
<peck@...>
new phone: 720-342-5621




From:       
Hector Maletta <hmaletta@... <hmaletta@...> >
To:       SPSSX-L@... <SPSSX-L@...>
Date:       06/16/2011 09:24 AM

Subject:       [SPSSX-L] Regression in colors
Sent by:       "SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email:  d.e.kornbrot@... <d.e.kornbrot@...>   
web:    http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0) 796 890 2102
   fax:      +44 (0) 870 706 4997









Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    http://web.me.com/kornbrot/KornbrotHome.html
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0)
796 890 2102
   fax:      +44 (0) 870 706 4997





===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Art Kendall
One reason for having the graphing separate is that the same kinds of plots would be applicable to many kinds of data not just regression.

Art Kendall

On 6/21/2011 10:29 AM, Art Kendall wrote:
improvement on the GUI are certainly worthwhile.  However, I believe that it is a disservice to not teach students that the GUI is is great way to write a _draft_ of the analysis process.  Analysis is almost always iterative in the sense of continuously improving the output as communication.  Also using the syntax has many advantages: one does not have to rely on short term memory to know what one did when refining/polishing/fixing an analysis.  Having students "reference" (review) each others syntax, helps them establish the habit of having their work cross checked. Syntax helps with the fact that one will inevitably be interrupted while setting up an analysis.  Showing syntax facilitates getting help from  other students, instructors, help desks, and lists like this one.  Using syntax instills the habit of being sure that there is an "audit trail".  Now that many disciplines' ethics codes and grant-giving agencies require sharing data and metadata syntax is often needed.  etc. etc.

Art Kendall
Social Research Consultants


On 6/17/2011 6:57 AM, Kornbrot, Diana wrote:
Re: Regression in colors Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list
  1. if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
  2. can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]
Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <peck@...> wrote:

I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
  /PARTIALPLOT ALL. will do all partial plots, and
 /PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM
peck@...
new phone: 720-342-5621




From:       "Kornbrot, Diana" <d.e.kornbrot@...>
To:       Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:       06/16/2011 01:24 PM
Subject:       Re: Regression in colors




What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <peck@...
<peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
peck@...
<peck@...>
new phone: 720-342-5621




From:       
Hector Maletta <hmaletta@... <hmaletta@...> >
To:       SPSSX-L@... <SPSSX-L@...>
Date:       06/16/2011 09:24 AM

Subject:       [SPSSX-L] Regression in colors
Sent by:       "SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >




A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email:  d.e.kornbrot@... <d.e.kornbrot@...>   
web:    http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0) 796 890 2102
   fax:      +44 (0) 870 706 4997









Professor Diana Kornbrot
email: 
d.e.kornbrot@...    
web:    http://web.me.com/kornbrot/KornbrotHome.html
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0)
796 890 2102
   fax:      +44 (0) 870 706 4997





===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

John F Hall
Re: Regression in colors

I agree about syntax, not just for teaching, but for file management and transformation operations and for all basic (and even some complex) analyses.  Using PASTE isn’t the same thing. 

 

When I occasionally offer advice and assistance if an interesting problem appears on the list, I usually ask the sender to let me have, in confidence, a copy of (a subset of) the *.sav file to investigate.  I like to understand the data (and the research question) as well as analyse them.  Some things just can’t be done in syntax (or take 50 times as long).  A recent example is in the thread Recoding for more than one result sent in by Judy Harman, who was trying to generate a set of unique combinations of diagnoses from an original list of dozens of separate diagnoses entered as string variables, and with different numbers of diagnoses for each case .

 

There's no substitute for looking at the original data and checking all transformations and analyses step by step.  Even with syntax it took a while to solve, and some syntax offered by listers didn’t actually work, either because they hadn’t understood the problem or because they hadn’t seen or checked the data.  Incidentally, trying to generate a set of dummy variables for MULT RESPONSE using 10**n I learned that SPSS can’t handle integers greater than 10**16, so I redid it with 2**n (which made for a not easily interpreted set of values) but I also discovered that AUTOCODE (as suggested by one lister) can’t spot typos and can yield misleading values if they are present.

 

If anyone wants to see the final version of the syntax (sent to Judy, not the list) please ask Judy for a copy.

 

 

John F Hall

 

[hidden email]

www.surveyresearch.weebly.com

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
Sent: 21 June 2011 16:59
To: [hidden email]
Subject: Re: Regression in colors

 

One reason for having the graphing separate is that the same kinds of plots would be applicable to many kinds of data not just regression.

Art Kendall

On 6/21/2011 10:29 AM, Art Kendall wrote:

improvement on the GUI are certainly worthwhile.  However, I believe that it is a disservice to not teach students that the GUI is is great way to write a _draft_ of the analysis process.  Analysis is almost always iterative in the sense of continuously improving the output as communication.  Also using the syntax has many advantages: one does not have to rely on short term memory to know what one did when refining/polishing/fixing an analysis.  Having students "reference" (review) each others syntax, helps them establish the habit of having their work cross checked. Syntax helps with the fact that one will inevitably be interrupted while setting up an analysis.  Showing syntax facilitates getting help from  other students, instructors, help desks, and lists like this one.  Using syntax instills the habit of being sure that there is an "audit trail".  Now that many disciplines' ethics codes and grant-giving agencies require sharing data and metadata syntax is often needed.  etc. etc.

Art Kendall
Social Research Consultants


On 6/17/2011 6:57 AM, Kornbrot, Diana wrote:

Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list

  1. if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
  2. can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]

Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <peck@...> wrote:

I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
  /PARTIALPLOT ALL. will do all partial plots, and
 /PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM
peck@...
new phone: 720-342-5621




From:       "Kornbrot, Diana" <d.e.kornbrot@...>
To:       Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:       06/16/2011 01:24 PM
Subject:       Re: Regression in colors





What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <
peck@... <peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM
peck@... <peck@...>
new phone: 720-342-5621




From:       
Hector Maletta <hmaletta@... <hmaletta@...> >
To:       SPSSX-L@... <SPSSX-L@...>
Date:       06/16/2011 09:24 AM
Subject:       [SPSSX-L] Regression in colors
Sent by:       "SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >





A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector




Professor Diana Kornbrot
email:  d.e.kornbrot@... <d.e.kornbrot@...>   
web:    http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0) 796 890 2102
   fax:      +44 (0) 870 706 4997





 


Professor Diana Kornbrot
email:  d.e.kornbrot@...    
web:    http://web.me.com/kornbrot/KornbrotHome.html
Work
School of Psychology
 University of Hertfordshire
 College Lane, Hatfield, Hertfordshire AL10 9AB, UK
 voice:   +44 (0) 170 728 4626
   fax:     +44 (0) 170 728 5073
Home
 
19 Elmhurst Avenue
 London N2 0LT, UK
    voice:   +44 (0) 208 883  3657
    mobile: +44 (0) 796 890 2102
   fax:      +44 (0) 870 706 4997




===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: Regression in colors

Jon K Peck

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        John F Hall <[hidden email]>
To:        [hidden email]
Date:        06/21/2011 10:54 AM
Subject:        Re: [SPSSX-L] Regression in colors
Sent by:        "SPSSX(r) Discussion" <[hidden email]>



[snip]
  Incidentally, trying to generate a set of dummy variables for MULT RESPONSE using 10**n I learned that SPSS can’t handle integers greater than 10**16, so I redid it with 2**n
 
John F Hall

>>>The 10**n issue has nothing really to do with SPSS.  Numbers are represented in Statistics using IEEE double precision floating point, and that gives you only 53 or so bits for a mantissa.  Using powers of 2 gives you the ability to hold up to 53 dichotomies in a one SPSS variable.  In fact, the functions packDummies and extractDummies in the extendedTransforms.py programmability module are designed to let you store large numbers of dummy variables in this more compact representation.  One of these days I intend to package that in a friendlier facility with its own little codebook to make it easy to mange such data.

Regards,
Jon Peck
 
johnfhall@...
www.surveyresearch.weebly.com
 
 
 
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Art Kendall
Sent:
21 June 2011 16:59
To:
[hidden email]
Subject:
Re: Regression in colors

 
One reason for having the graphing separate is that the same kinds of plots would be applicable to many kinds of data not just regression.

Art Kendall

On 6/21/2011 10:29 AM, Art Kendall wrote:

improvement on the GUI are certainly worthwhile.  However, I believe that it is a disservice to not teach students that the GUI is is great way to write a _draft_ of the analysis process.  Analysis is almost always iterative in the sense of continuously improving the output as communication.  Also using the syntax has many advantages: one does not have to rely on short term memory to know what one did when refining/polishing/fixing an analysis.  Having students "reference" (review) each others syntax, helps them establish the habit of having their work cross checked. Syntax helps with the fact that one will inevitably be interrupted while setting up an analysis.  Showing syntax facilitates getting help from  other students, instructors, help desks, and lists like this one.  Using syntax instills the habit of being sure that there is an "audit trail".  Now that many disciplines' ethics codes and grant-giving agencies require sharing data and metadata syntax is often needed.  etc. etc.

Art Kendall
Social Research Consultants


On 6/17/2011 6:57 AM, Kornbrot, Diana wrote:

Thanks Jon
Apologies for venting my frustrations with the DIALOGUE interface to REGRESSION on the list

1.        if it has been easily available in script for yonks, why  not implement in  GUI dialogue? I find the GUI mostly very powerful & much easier for students to learn. Makes the glitches more frustrating
2.        can the script do interactions? E.g. /partial plot a a*b, where b is categorical. If so it would be possible t run REGRESSIONS once without the categorical for statistics and once with to get plots.  There is a nice implementation in survival plots, where one can ask for survival regression plots at overall mean or fro each category [and its in the GUI]
Obviously most people on this list are completely comfortable with scripts. BUT many of us advise people who really are only happy with the GUI dialogues, so suggestions on improving the GUI are worth noting

Best
Diana


On 16/06/2011 20:36, "Jon K Peck" <
peck@...> wrote:
I always enjoy seeing helpful and polite comments from users.

Plotting the dependent variable against the independents has been in the REGRESSION command for generations.
 /PARTIALPLOT ALL. will do all partial plots, and
/PARTIALPLOT a  b c will do listed variables.

But the request in this case was for a plot colored by a variable that was NOT in the regression.  For that the solution proposed is straightforward and appropriate IMO.


Jon Peck
Senior Software Engineer, IBM

peck@...
new phone: 720-342-5621




From:      
"Kornbrot, Diana" <d.e.kornbrot@...>
To:      
Jon K Peck/Chicago/IBM@IBMUS, "SPSSX-L@..." <SPSSX-L@...>
Date:      
06/16/2011 01:24 PM
Subject:      
Re: Regression in colors






What spss user are requesting is that the graphics option be included in REGRESSION
They know how to go all round the houses saving and then using graphics. it is a waste of our valuable time
I have been making this request since the GUI 1st appeared
It is INSANE to have option to plot every kind of residual, but not the main results: the dependet variable as a function of the independent variable
But spss listen to users? You cannot be serious
Best
Diana


On 16/06/2011 20:00, "Jon K Peck" <
peck@... <peck@...> > wrote:

Just save the predicted values to the dataset in the usual way and then use the Chart Builder to create the plot with the desired effects.

Jon Peck
Senior Software Engineer, IBM

peck@... <peck@...>
new phone: 720-342-5621




From:      
Hector Maletta <hmaletta@... <hmaletta@...> >
To:      
SPSSX-L@... <SPSSX-L@...>
Date:      
06/16/2011 09:24 AM
Subject:      
[SPSSX-L] Regression in colors
Sent by:      
"SPSSX(r) Discussion" <SPSSX-L@... <SPSSX-L@...> >






A student of mine is producing a simple linear regression with several predictors, including a scatterplot of actual versus predicted values of the dependent variable. He wants that the plot points are identified by colors corresponding to a categorical variable (not included in the regression) which has four values from 0 to 3. Labeling in the REGRESSION procedure prints values or value labels into the plot. How could one have cases identified in colors or different markers, with no labels or values printed?


Thanks for your help


Hector





Professor Diana Kornbrot
email:  
d.e.kornbrot@... <d.e.kornbrot@...>  
web:    
http://web.me.com/kornbrot/KornbrotHome.html <http://web.me.com/kornbrot/KornbrotHome.html>
Work

School of Psychology
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
  fax:     +44 (0) 170 728 5073
Home
19 Elmhurst Avenue
London N2 0LT, UK
   voice:   +44 (0) 208 883  3657
   mobile: +44 (0) 796 890 2102
  fax:      +44 (0) 870 706 4997





 



Professor Diana Kornbrot
email:  
d.e.kornbrot@...    
web:    
http://web.me.com/kornbrot/KornbrotHome.html
Work

School of Psychology
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
voice:   +44 (0) 170 728 4626
  fax:     +44 (0) 170 728 5073
Home
19 Elmhurst Avenue
London N2 0LT, UK
   voice:   +44 (0) 208 883  3657
   mobile: +44 (0) 796 890 2102
  fax:      +44 (0) 870 706 4997




===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD