|
Hi,
I read a message this morning which in principle refers also to my problem (but the answer doesn`t help me because I don`t use Python). I have lots of potential, but not consecutive predictors (t2pain, t2pfi, t2vital etc) and I want to create scatterplots of each of these predictors vs the dependent variable e.g. GRAPH /SCATTERPLOT(BIVAR)=t2pain WITH logt2max /MISSING=LISTWISE . Is there a possibility to avoid to repeat this step 29 times (for the reminder 29 variables)? and to present the scatterplots of groups (demograph, economic...) of predictors in one table (like the first column in the matrix scatterplot)? Please note, I have only very limited experience with macros. Many thanks in advance for your help, Doris |
|
Hi Doris,
The program may look like this one: GET FILE='C:\Program Files\SPSS\Cars.sav'. Define myscatte () !let !vars = "engine horse weight" !do !i !in ( !vars ). GRAPH /SCATTERPLOT(BIVAR)=!i WITH accel /MISSING=LISTWISE . !doend !enddefine. myscatte . Just replace the names of variables (here engine horse weight, and accel). Regarding the second question, I think you can produce only by editing the images in a graphic editor or perhaps in Word. HTH Jan. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Doris Gerstner Sent: Tuesday, May 22, 2007 12:58 PM To: [hidden email] Subject: repeated scatterplots Hi, I read a message this morning which in principle refers also to my problem (but the answer doesn`t help me because I don`t use Python). I have lots of potential, but not consecutive predictors (t2pain, t2pfi, t2vital etc) and I want to create scatterplots of each of these predictors vs the dependent variable e.g. GRAPH /SCATTERPLOT(BIVAR)=t2pain WITH logt2max /MISSING=LISTWISE . Is there a possibility to avoid to repeat this step 29 times (for the reminder 29 variables)? and to present the scatterplots of groups (demograph, economic...) of predictors in one table (like the first column in the matrix scatterplot)? Please note, I have only very limited experience with macros. Many thanks in advance for your help, Doris |
|
In reply to this post by Doris-18
Basic idea
*You variable name. DEFINE !VANAMES () t2pain t2pfi t2vital.. all 29 !ENDDEFINE. DEFINE !LABPRO (!POSITIONAL !TOKENS(29)) !LET !vin = !1. !DO !vi !IN (!vin). GRAPH /SCATTERPLOT(BIVAR)=!vi WITH logt2max /MISSING=LISTWISE . !DOEND !ENDDEFINE. !LABPRO !VANAMES. HtH Mike -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Doris Gerstner Sent: 22 May 2007 11:58 To: [hidden email] Subject: repeated scatterplots Hi, I read a message this morning which in principle refers also to my problem (but the answer doesn`t help me because I don`t use Python). I have lots of potential, but not consecutive predictors (t2pain, t2pfi, t2vital etc) and I want to create scatterplots of each of these predictors vs the dependent variable e.g. GRAPH /SCATTERPLOT(BIVAR)=t2pain WITH logt2max /MISSING=LISTWISE . Is there a possibility to avoid to repeat this step 29 times (for the reminder 29 variables)? and to present the scatterplots of groups (demograph, economic...) of predictors in one table (like the first column in the matrix scatterplot)? Please note, I have only very limited experience with macros. Many thanks in advance for your help, Doris ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ |
|
In reply to this post by Spousta Jan
To get the paneling effect, add something like this to your graph command
/panel rowvar = mygroupingvar If you have a lot of groups, you will probably want to increase the vertical size of the plot, which you can do by just dragging the border in the Viewer. HTH, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Spousta Jan Sent: Tuesday, May 22, 2007 6:38 AM To: [hidden email] Subject: Re: [SPSSX-L] repeated scatterplots Hi Doris, The program may look like this one: GET FILE='C:\Program Files\SPSS\Cars.sav'. Define myscatte () !let !vars = "engine horse weight" !do !i !in ( !vars ). GRAPH /SCATTERPLOT(BIVAR)=!i WITH accel /MISSING=LISTWISE . !doend !enddefine. myscatte . Just replace the names of variables (here engine horse weight, and accel). Regarding the second question, I think you can produce only by editing the images in a graphic editor or perhaps in Word. HTH Jan. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Doris Gerstner Sent: Tuesday, May 22, 2007 12:58 PM To: [hidden email] Subject: repeated scatterplots Hi, I read a message this morning which in principle refers also to my problem (but the answer doesn`t help me because I don`t use Python). I have lots of potential, but not consecutive predictors (t2pain, t2pfi, t2vital etc) and I want to create scatterplots of each of these predictors vs the dependent variable e.g. GRAPH /SCATTERPLOT(BIVAR)=t2pain WITH logt2max /MISSING=LISTWISE . Is there a possibility to avoid to repeat this step 29 times (for the reminder 29 variables)? and to present the scatterplots of groups (demograph, economic...) of predictors in one table (like the first column in the matrix scatterplot)? Please note, I have only very limited experience with macros. Many thanks in advance for your help, Doris |
| Free forum by Nabble | Edit this page |
