saving specific output

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

saving specific output

xenia
hello all,
how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?

Thank you all
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

Jon K Peck
If you are referring to the R2, you can save the table containing that item to a dataset or data file using OMS.  See the OMS Control Panel item under Utilities or look up the OMS syntax.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        xenia <[hidden email]>
To:        [hidden email],
Date:        10/18/2012 10:46 AM
Subject:        [SPSSX-L] saving specific output
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




hello all,
how can I save e.g. the correlation coefficient after a linear regression
i.e. get SPSS to output it in a file, and do that for all the regressions
run, so that in the end I have a file with a column of correlation
coefficients?  I know you can save residuals from a regression in your data
file, but what if I want to save something that is not under the "save
options" in SPSS?

Thank you all



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: saving specific output

parisec
In reply to this post by xenia
In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?

Carol
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
Sent: Thursday, October 18, 2012 9:45 AM
To: [hidden email]
Subject: saving specific output

hello all,
how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?

Thank you all



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: saving specific output

xenia
If you read my post carefully you will see that I don't want to create
a column in my file where its row corresponds to a case, I want to
save to an EXTERNAL file all the r squares I get from each regression,
each row in the file will  correspond to a regression. And no, all
results values that are output from a regression are not linked to a
specific case/s, they are computed from all of them. The entries in my
file are used to run regressions, each regression produces the r
squared and I want to save the r squared in a file for each regression
I run, it is as simple as that. People may want to save something that
"lines up" with cases e.g.  a column of residuals, or they may want to
save a final result, one value, e.g. an odds ratio or a confidence
interval automatically, it depends what they want it for.

On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:

> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>
> Carol
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
> Sent: Thursday, October 18, 2012 9:45 AM
> To: [hidden email]
> Subject: saving specific output
>
> hello all,
> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>
> Thank you all
>
>
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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: saving specific output

Maguin, Eugene
I'm not quite sure but I think you will find this useful.

OMS ...
Regression ...
OMSEND.

Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of -
Sent: Thursday, October 18, 2012 1:59 PM
To: [hidden email]
Subject: Re: saving specific output

If you read my post carefully you will see that I don't want to create a column in my file where its row corresponds to a case, I want to save to an EXTERNAL file all the r squares I get from each regression, each row in the file will  correspond to a regression. And no, all results values that are output from a regression are not linked to a specific case/s, they are computed from all of them. The entries in my file are used to run regressions, each regression produces the r squared and I want to save the r squared in a file for each regression I run, it is as simple as that. People may want to save something that "lines up" with cases e.g.  a column of residuals, or they may want to save a final result, one value, e.g. an odds ratio or a confidence interval automatically, it depends what they want it for.

On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:

> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>
> Carol
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
> Of xenia
> Sent: Thursday, October 18, 2012 9:45 AM
> To: [hidden email]
> Subject: saving specific output
>
> hello all,
> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>
> Thank you all
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-t
> p5715729.html Sent from the SPSSX Discussion mailing list archive at
> Nabble.com.
>
> =====================
> 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

=====================
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: saving specific output

parisec
In reply to this post by xenia
ahh, sorry!  i misunuderstood. Since there was a reference to /save, i was thinking you wanted to include these in the same file.

-----Original Message-----
From: - [mailto:[hidden email]]
Sent: Thursday, October 18, 2012 10:59 AM
To: Parise, Carol A.
Cc: [hidden email]
Subject: Re: saving specific output

If you read my post carefully you will see that I don't want to create a column in my file where its row corresponds to a case, I want to save to an EXTERNAL file all the r squares I get from each regression, each row in the file will  correspond to a regression. And no, all results values that are output from a regression are not linked to a specific case/s, they are computed from all of them. The entries in my file are used to run regressions, each regression produces the r squared and I want to save the r squared in a file for each regression I run, it is as simple as that. People may want to save something that "lines up" with cases e.g.  a column of residuals, or they may want to save a final result, one value, e.g. an odds ratio or a confidence interval automatically, it depends what they want it for.

On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:

> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>
> Carol
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
> Of xenia
> Sent: Thursday, October 18, 2012 9:45 AM
> To: [hidden email]
> Subject: saving specific output
>
> hello all,
> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>
> Thank you all
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-t
> p5715729.html Sent from the SPSSX Discussion mailing list archive at
> Nabble.com.
>
> =====================
> 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: saving specific output

xenia
There is no reference to "/ save" anywhere in my message, I wrote "how
can I save" etc etc, this is  "I" not "/"

On 18 October 2012 19:40, Parise, Carol A. <[hidden email]> wrote:

> ahh, sorry!  i misunuderstood. Since there was a reference to /save, i was thinking you wanted to include these in the same file.
>
> -----Original Message-----
> From: - [mailto:[hidden email]]
> Sent: Thursday, October 18, 2012 10:59 AM
> To: Parise, Carol A.
> Cc: [hidden email]
> Subject: Re: saving specific output
>
> If you read my post carefully you will see that I don't want to create a column in my file where its row corresponds to a case, I want to save to an EXTERNAL file all the r squares I get from each regression, each row in the file will  correspond to a regression. And no, all results values that are output from a regression are not linked to a specific case/s, they are computed from all of them. The entries in my file are used to run regressions, each regression produces the r squared and I want to save the r squared in a file for each regression I run, it is as simple as that. People may want to save something that "lines up" with cases e.g.  a column of residuals, or they may want to save a final result, one value, e.g. an odds ratio or a confidence interval automatically, it depends what they want it for.
>
> On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:
>> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>>
>> Carol
>> -----Original Message-----
>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>> Of xenia
>> Sent: Thursday, October 18, 2012 9:45 AM
>> To: [hidden email]
>> Subject: saving specific output
>>
>> hello all,
>> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>>
>> Thank you all
>>
>>
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-t
>> p5715729.html Sent from the SPSSX Discussion mailing list archive at
>> Nabble.com.
>>
>> =====================
>> 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: saving specific output

Mike
In reply to this post by xenia
I could be wrong but it sounds like you want something like what the
matrix OUT ( ) subcommand produces in the regression procedure,
though that produces a file with the first couple of lines for the mean,
SD and N for each variable followed by a correlation matrix for all variables
used in the analysis.  Perhaps you could use this as a starting
point and then strip away the info that you don't need.

-Mike Palij
New York University
[hidden email]


On Thu, Oct 18, 2012 at 1:58 PM, - <[hidden email]> wrote:

> If you read my post carefully you will see that I don't want to create
> a column in my file where its row corresponds to a case, I want to
> save to an EXTERNAL file all the r squares I get from each regression,
> each row in the file will  correspond to a regression. And no, all
> results values that are output from a regression are not linked to a
> specific case/s, they are computed from all of them. The entries in my
> file are used to run regressions, each regression produces the r
> squared and I want to save the r squared in a file for each regression
> I run, it is as simple as that. People may want to save something that
> "lines up" with cases e.g.  a column of residuals, or they may want to
> save a final result, one value, e.g. an odds ratio or a confidence
> interval automatically, it depends what they want it for.
>
> On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:
>> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>>
>> Carol
>> -----Original Message-----
>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
>> Sent: Thursday, October 18, 2012 9:45 AM
>> To: [hidden email]
>> Subject: saving specific output
>>
>> hello all,
>> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>>
>> Thank you all
>>
>>
>>
>> --
>> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> 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

=====================
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: saving specific output

David Marso
Administrator
In reply to this post by xenia
"> If you read my post carefully "...
Read your own damned post carefully and realize you requested Correlations not  R squared!!!  When you misuse terms in your request you really can't expect people to accurately read your mind.  And you might want to work on the tone of your response when someone has tried to help you but misread your mind due to sloppiness on your part in communicating your needs!!!
----
You can either use OMS or easily calculate it as Sum YHat**2 / Sum Y**2.
If using SPLIT FILE save predicted values.
COMPUTE y2=Y**2.
COMPUTE hat2=pred**2.
AGGREGATE OUTFILE * / BREAK whateveryoursplitvariables / Y2 hat2=SUM(y2 hat2).
COMPUTE R2=hat2/y2.
----

xenia wrote
There is no reference to "/ save" anywhere in my message, I wrote "how
can I save" etc etc, this is  "I" not "/"

On 18 October 2012 19:40, Parise, Carol A. <[hidden email]> wrote:
> ahh, sorry!  i misunuderstood. Since there was a reference to /save, i was thinking you wanted to include these in the same file.
>
> -----Original Message-----
> From: - [mailto:[hidden email]]
> Sent: Thursday, October 18, 2012 10:59 AM
> To: Parise, Carol A.
> Cc: [hidden email]
> Subject: Re: saving specific output
>
> If you read my post carefully you will see that I don't want to create a column in my file where its row corresponds to a case, I want to save to an EXTERNAL file all the r squares I get from each regression, each row in the file will  correspond to a regression. And no, all results values that are output from a regression are not linked to a specific case/s, they are computed from all of them. The entries in my file are used to run regressions, each regression produces the r squared and I want to save the r squared in a file for each regression I run, it is as simple as that. People may want to save something that "lines up" with cases e.g.  a column of residuals, or they may want to save a final result, one value, e.g. an odds ratio or a confidence interval automatically, it depends what they want it for.
>
> On 18 October 2012 17:54, Parise, Carol A. <[hidden email]> wrote:
>> In an SPSS file, all values are attached to a case. The values in  \save are values that are computed for a case. The regression coefficients are specific to a variable. Even if you could create a variable called coefficient and have a column of coefficients, what cases would these coefficeients liine up with?
>>
>> Carol
>> -----Original Message-----
>> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
>> Of xenia
>> Sent: Thursday, October 18, 2012 9:45 AM
>> To: [hidden email]
>> Subject: saving specific output
>>
>> hello all,
>> how can I save e.g. the correlation coefficient after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>>
>> Thank you all
>>
>>
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-t
>> p5715729.html Sent from the SPSSX Discussion mailing list archive at
>> Nabble.com.
>>
>> =====================
>> 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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

xenia
I could say the same for your tone actually, because I wrote to C.Parise "if you read my post carefully", I did not offend her, but you are actually offending someone when in your reply you say "read your own damn post", as you have.
Again, in my post - which is there for everybody to see- I referred to the "correlation coefficient", and the person who first replied to me J.Peck talked about R squared. We all know the output from the linear regression has both, R and R squared. These are just two values, very closely related obviously, both appearing in the Model Summary in the output. One regression, one R, one R squared. My question was how can I save the correlation coefficient in a file for each of the regressions I run. Obviously, if I can save the R then I can save the R squared as well, and vice versa, so this wasn't the point of my question really. As I state in my question "what if I want to save something that is not under the "save options" in SPSS? ", so the problem is not if I'm going to save the R or the R squared, but how. I asked for the correlation coefficient R or r or ρ, as it is output in the Model Summary of the regression, right next to the R squared, J.Peck referred to the R squared.
Even so, whether I wanted to save the R, the R squared, the B or whatever else, the essence of my question is the same, because it is clear that I simply want to save something generated in the output in another file for some purpose. C.Parise thought, this is what she wrote, that I wanted to save something in my dataset file, and she wouldn't have understood differently if I had written that I want the R and not the R squared. She misunderstood regarding where I wanted to save, not what. And again, I referred to R, J.Peck referred to the R squared. So, I refer to R, J.P refers to R squared and I misuse terms and am sloppy in my communication....?? Actually neither me nor him are misscommunicating, because he understood exactly where the point in my query was.  
So my post was this:
"hello all,
>> how can I save e.g. the correlation coefficient  after a linear regression i.e. get SPSS to output it in a file, and do that for all the regressions run, so that in the end I have a file with a column of correlation coefficients?  I know you can save residuals from a regression in your data file, but what if I want to save something that is not under the "save options" in SPSS?
>>
>> Thank you all
>> "
I clearly say "the correlation coefficient after a linear regression", "output it in a file", "for all the regressions run". It is pretty clear that after each linear regression I want to output the correlation coefficient, this is one value, to a file, and do the same for a number of regressions. I can hardly call that gross misscommunication and expecting people to read my mind, I was clear in stating what I wanted exactly. My description is clear and concise, and consistent, so I don't see any sloppiness on my part, as you say.
Finally, because I have not insulted anyone, you cannot correct someone's tone if you "think" they are insulting by using a worse tone yourself. I explained again to the person who did not understand. Now, if I was misscommunicating, people would have replied that they do not understand my question and I wouldn't have got many accurate first replies. That shows that the people that replied understood my question. So,  if someone does not understand, this is probably not because of me, otherwise most people wouldn't have understood. And if you think "if you read my post carefully" is insulting, then "read your damn post" certainly is. You will comment on my tone again presumably, but I have to defend myself because I think that your reply was false and too exaggerated really.

So, thank you all for your many replies, I will try them and she what happens.
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

Maguin, Eugene
Xenia,

I know you have gotten some replies but none seem to have been what you are wanting. So, back up and describe the regressions in structural terms. What I mean is this. How many different regression commands are there expected to be? Does each command have a single step or multiple steps? By 'step' I mean either an 'enter' subcommand or a variable addition or removal in a forward or backward stepwise command. What differs from command to command? Is it different DVs or different IV? Or a single regression command embedded in a split files command? What is the range in the number of IVs per regression command across the set of regression commands?

If you were to come to me and ask for how to do this, I think I'd have a pretty detailed set of questions for you about what you wanted to do. Not 'why do this questions' but 'what' questions. I think you may be struggling against a set of what questions on the part of responders.

So, for example, if your regression command were this, what do you want to see?

Regression dependent=y/enter x1.

If it was like this, what do you want to see?

Regression dependent=y/enter x1 x2/enter x3.

Gene Maguin





-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
Sent: Thursday, October 18, 2012 10:44 PM
To: [hidden email]
Subject: Re: saving specific output

I could say the same for your tone actually, because I wrote to C.Parise "if you read my post carefully", I did not offend her, but you are actually offending someone when in your reply you say "read your own damn post", as you have.
Again, in my post - which is there for everybody to see- I referred to the "correlation coefficient", and the person who first replied to me J.Peck talked about R squared. We all know the output from the linear regression has both, R and R squared. These are just two values, very closely related obviously, both appearing in the Model Summary in the output. One regression, one R, one R squared. My question was how can I save the correlation coefficient in a file for each of the regressions I run.
Obviously, if I can save the R then I can save the R squared as well, and vice versa, so this wasn't the point of my question really. As I state in my question "what if I want to save something that is not under the "save options" in SPSS? ", so the problem is not if I'm going to save the R or the R squared, but how. I asked for the correlation coefficient R or r or ρ, as it is output in the Model Summary of the regression, right next to the R squared, J.Peck referred to the R squared.
Even so, whether I wanted to save the R, the R squared, the B or whatever else, the essence of my question is the same, because it is clear that I simply want to save something generated in the output in another file for some purpose. C.Parise thought, this is what she wrote, that I wanted to save something in my dataset file, and she wouldn't have understood differently if I had written that I want the R and not the R squared. She misunderstood regarding where I wanted to save, not what. And again, I referred to R, J.Peck referred to the R squared. So, I refer to R, J.P refers to R squared and I misuse terms and am sloppy in my communication....?? Actually neither me nor him are misscommunicating, because he understood exactly where the point in my query was.
So my post was this:
"hello all,
>> how can I save e.g. the *correlation coefficient * after a *linear
>> regression *i.e. get SPSS to output it in a file, and do that *for
>> all the regressions run*, so that in the end I have a file with a
>> column of *correlation coefficients*?  I know you can save residuals
>> from a regression in your data file, but what if I want to save
>> something that is not under the "save options" in SPSS?
>>
>> Thank you all
>> "
I clearly say "the correlation coefficient after a linear regression", "output it in a file", "for all the regressions run". It is pretty clear that after each linear regression I want to output the correlation coefficient, this is one value, to a file, and do the same for a number of regressions. I can hardly call that gross misscommunication and expecting people to read my mind, I was clear in stating what I wanted exactly. My description is clear and concise, and consistent, so I don't see any sloppiness on my part, as you say.
Finally, because I have not insulted anyone, you cannot correct someone's tone if you "think" they are insulting by using a worse tone yourself. I explained again to the person who did not understand. Now, if I was misscommunicating, people would have replied that they do not understand my question and I wouldn't have got many accurate first replies. That shows that the people that replied understood my question. So,  if someone does not understand, this is probably not because of me, otherwise most people wouldn't have understood. And if you think "if you read my post carefully"
is insulting, then "read your damn post" certainly is. You will comment on my tone again presumably, but I have to defend myself because I think that your reply was false and too exaggerated really.

So, thank you all for your many replies, I will try them and she what happens.




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: saving specific output

Jon K Peck
In the interest of clarity, here is a complete example of capturing the R and R2 from a series of regressions using OMS.  It uses the employee data.sav data.

dataset declare modelsummary.
oms select tables /if subtypes='Model Summary'
/destination outfile=modelsummary format=sav.

REGRESSION
  /STATISTICS COEFF OUTS R ANOVA
  /DEPENDENT salary
  /METHOD=ENTER prevexp educ.
REGRESSION
  /STATISTICS COEFF OUTS R ANOVA
  /DEPENDENT salary
  /METHOD=ENTER prevexp minority.
REGRESSION
  /STATISTICS COEFF OUTS R ANOVA
  /DEPENDENT salary
  /METHOD=ENTER prevexp educ minority.
omsend.

The dataset named modelsummary will contain, among other variables, R, RSquare, AdjustedRSquare, and Std.ErroroftheEstimate.  One case for each regression.  IOW, it turns the Model Summary table into a case for each regression.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        "Maguin, Eugene" <[hidden email]>
To:        [hidden email],
Date:        10/19/2012 07:31 AM
Subject:        Re: [SPSSX-L] saving specific output
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Xenia,

I know you have gotten some replies but none seem to have been what you are wanting. So, back up and describe the regressions in structural terms. What I mean is this. How many different regression commands are there expected to be? Does each command have a single step or multiple steps? By 'step' I mean either an 'enter' subcommand or a variable addition or removal in a forward or backward stepwise command. What differs from command to command? Is it different DVs or different IV? Or a single regression command embedded in a split files command? What is the range in the number of IVs per regression command across the set of regression commands?

If you were to come to me and ask for how to do this, I think I'd have a pretty detailed set of questions for you about what you wanted to do. Not 'why do this questions' but 'what' questions. I think you may be struggling against a set of what questions on the part of responders.

So, for example, if your regression command were this, what do you want to see?

Regression dependent=y/enter x1.

If it was like this, what do you want to see?

Regression dependent=y/enter x1 x2/enter x3.

Gene Maguin





-----Original Message-----
From: SPSSX(r) Discussion [
[hidden email]] On Behalf Of xenia
Sent: Thursday, October 18, 2012 10:44 PM
To: [hidden email]
Subject: Re: saving specific output

I could say the same for your tone actually, because I wrote to C.Parise "if you read my post carefully", I did not offend her, but you are actually offending someone when in your reply you say "read your own damn post", as you have.
Again, in my post - which is there for everybody to see- I referred to the "correlation coefficient", and the person who first replied to me J.Peck talked about R squared. We all know the output from the linear regression has both, R and R squared. These are just two values, very closely related obviously, both appearing in the Model Summary in the output. One regression, one R, one R squared. My question was how can I save the correlation coefficient in a file for each of the regressions I run.
Obviously, if I can save the R then I can save the R squared as well, and vice versa, so this wasn't the point of my question really. As I state in my question "what if I want to save something that is not under the "save options" in SPSS? ", so the problem is not if I'm going to save the R or the R squared, but how. I asked for the correlation coefficient R or r or ρ, as it is output in the Model Summary of the regression, right next to the R squared, J.Peck referred to the R squared.
Even so, whether I wanted to save the R, the R squared, the B or whatever else, the essence of my question is the same, because it is clear that I simply want to save something generated in the output in another file for some purpose. C.Parise thought, this is what she wrote, that I wanted to save something in my dataset file, and she wouldn't have understood differently if I had written that I want the R and not the R squared. She misunderstood regarding where I wanted to save, not what. And again, I referred to R, J.Peck referred to the R squared. So, I refer to R, J.P refers to R squared and I misuse terms and am sloppy in my communication....?? Actually neither me nor him are misscommunicating, because he understood exactly where the point in my query was.
So my post was this:
"hello all,
>> how can I save e.g. the *correlation coefficient * after a *linear
>> regression *i.e. get SPSS to output it in a file, and do that *for
>> all the regressions run*, so that in the end I have a file with a
>> column of *correlation coefficients*?  I know you can save residuals
>> from a regression in your data file, but what if I want to save
>> something that is not under the "save options" in SPSS?
>>
>> Thank you all
>> "
I clearly say "the correlation coefficient after a linear regression", "output it in a file", "for all the regressions run". It is pretty clear that after each linear regression I want to output the correlation coefficient, this is one value, to a file, and do the same for a number of regressions. I can hardly call that gross misscommunication and expecting people to read my mind, I was clear in stating what I wanted exactly. My description is clear and concise, and consistent, so I don't see any sloppiness on my part, as you say.
Finally, because I have not insulted anyone, you cannot correct someone's tone if you "think" they are insulting by using a worse tone yourself. I explained again to the person who did not understand. Now, if I was misscommunicating, people would have replied that they do not understand my question and I wouldn't have got many accurate first replies. That shows that the people that replied understood my question. So,  if someone does not understand, this is probably not because of me, otherwise most people wouldn't have understood. And if you think "if you read my post carefully"
is insulting, then "read your damn post" certainly is. You will comment on my tone again presumably, but I have to defend myself because I think that your reply was false and too exaggerated really.

So, thank you all for your many replies, I will try them and she what happens.




--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: saving specific output

xenia
This post was updated on .
In reply to this post by Maguin, Eugene
Thank you,
I haven't been able to try out any suggestions yet,when I've done so
I'll provide feedback.
I think what I want is more simplified than what you have in mind,
because I have a simple linear regression, one dependent and one
independent variable,
so one ENTER, no use of backward or forward stepwise. So, single step
regression, just repeated many times.
In my file I have 10 observations for individual 1 and run a
regression on those 10, then I run a regression only on the e.g. 15
observations I have for individual two, so
this is the only difference between the regressions, the number of
observations used to run the regressions and of course the fact that
each group of observations
used for each regression belongs to an individual different than the
other groups of observations. Also, the values for the dependent and independent
variables vary between observations of the same individual and of course between different
individuals. So, I run one regression for all the
observations of an individual, and
do so for all individuals in the file. The variable names don't change, so
I'd say it's a  single regression command embedded in a split files
command. Each regression has
output, amongst which is the R, the R square, and other values for
which SPSS doesn't give me the option to save in a file, as it does
with other things. What I want is to
have the one value for e.g. R produced by one regression to be saved
to an external file, then the R produced in the 2nd regression again
saved to the file (without overwriting etc),
in the end I will have a column or row with as many R values as the
regressions run. So, if I generalize I'd say, how can I save a single
value produced in the output of a linear regression
to a file, and do so repetitively for each of many regressions, when
I'm not interested in e.g.residuals or other entities that are saved
automatically.
I think what J.Peck suggests is what I'm after, I just didn't have the
time to try it out yet.
Thank you all for taking the time to look so deeply into this query.


On 19 October 2012 14:34, Maguin, Eugene [via SPSSX Discussion]
<ml-node+s1045642n5715768h97@n5.nabble.com> wrote:
> Xenia,
>
> I know you have gotten some replies but none seem to have been what you are
> wanting. So, back up and describe the regressions in structural terms. What
> I mean is this. How many different regression commands are there expected to
> be? Does each command have a single step or multiple steps? By 'step' I mean
> either an 'enter' subcommand or a variable addition or removal in a forward
> or backward stepwise command. What differs from command to command? Is it
> different DVs or different IV? Or a single regression command embedded in a
> split files command? What is the range in the number of IVs per regression
> command across the set of regression commands?
>
> If you were to come to me and ask for how to do this, I think I'd have a
> pretty detailed set of questions for you about what you wanted to do. Not
> 'why do this questions' but 'what' questions. I think you may be struggling
> against a set of what questions on the part of responders.
>
> So, for example, if your regression command were this, what do you want to
> see?
>
> Regression dependent=y/enter x1.
>
> If it was like this, what do you want to see?
>
> Regression dependent=y/enter x1 x2/enter x3.
>
> Gene Maguin
>
>
>
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
> Sent: Thursday, October 18, 2012 10:44 PM
> To: [hidden email]
> Subject: Re: saving specific output
>
> I could say the same for your tone actually, because I wrote to C.Parise "if
> you read my post carefully", I did not offend her, but you are actually
> offending someone when in your reply you say "read your own damn post", as
> you have.
> Again, in my post - which is there for everybody to see- I referred to the
> "correlation coefficient", and the person who first replied to me J.Peck
> talked about R squared. We all know the output from the linear regression
> has both, R and R squared. These are just two values, very closely related
> obviously, both appearing in the Model Summary in the output. One
> regression, one R, one R squared. My question was how can I save the
> correlation coefficient in a file for each of the regressions I run.
> Obviously, if I can save the R then I can save the R squared as well, and
> vice versa, so this wasn't the point of my question really. As I state in my
> question "what if I want to save something that is not under the "save
> options" in SPSS? ", so the problem is not if I'm going to save the R or the
> R squared, but how. I asked for the correlation coefficient R or r or ρ, as
> it is output in the Model Summary of the regression, right next to the R
> squared, J.Peck referred to the R squared.
> Even so, whether I wanted to save the R, the R squared, the B or whatever
> else, the essence of my question is the same, because it is clear that I
> simply want to save something generated in the output in another file for
> some purpose. C.Parise thought, this is what she wrote, that I wanted to
> save something in my dataset file, and she wouldn't have understood
> differently if I had written that I want the R and not the R squared. She
> misunderstood regarding where I wanted to save, not what. And again, I
> referred to R, J.Peck referred to the R squared. So, I refer to R, J.P
> refers to R squared and I misuse terms and am sloppy in my
> communication....?? Actually neither me nor him are misscommunicating,
> because he understood exactly where the point in my query was.
> So my post was this:
> "hello all,
>>> how can I save e.g. the *correlation coefficient * after a *linear
>>> regression *i.e. get SPSS to output it in a file, and do that *for
>>> all the regressions run*, so that in the end I have a file with a
>>> column of *correlation coefficients*?  I know you can save residuals
>>> from a regression in your data file, but what if I want to save
>>> something that is not under the "save options" in SPSS?
>>>
>>> Thank you all
>>> "
> I clearly say "the correlation coefficient after a linear regression",
> "output it in a file", "for all the regressions run". It is pretty clear
> that after each linear regression I want to output the correlation
> coefficient, this is one value, to a file, and do the same for a number of
> regressions. I can hardly call that gross misscommunication and expecting
> people to read my mind, I was clear in stating what I wanted exactly. My
> description is clear and concise, and consistent, so I don't see any
> sloppiness on my part, as you say.
> Finally, because I have not insulted anyone, you cannot correct someone's
> tone if you "think" they are insulting by using a worse tone yourself. I
> explained again to the person who did not understand. Now, if I was
> misscommunicating, people would have replied that they do not understand my
> question and I wouldn't have got many accurate first replies. That shows
> that the people that replied understood my question. So,  if someone does
> not understand, this is probably not because of me, otherwise most people
> wouldn't have understood. And if you think "if you read my post carefully"
> is insulting, then "read your damn post" certainly is. You will comment on
> my tone again presumably, but I have to defend myself because I think that
> your reply was false and too exaggerated really.
>
> So, thank you all for your many replies, I will try them and she what
> happens.
>
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715768.html
> To unsubscribe from saving specific output, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

xenia
In reply to this post by Jon K Peck
Thank you for this
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

Bruce Weaver
Administrator
In reply to this post by xenia
IIRC, someone earlier in the thread mentioned MATRIX OUT as a means of saving the correlations -- or in the case of simple linear regression, the correlation.  See below for an example.  OMS is another option, as in Jon's post.  But I think MATRIX OUT is even easier if all you want is r (and possibly r-squared).

new file.
dataset close all.

* Modify path to suit your computer.
GET FILE = "C:\SPSSdata\Growth study.sav".

* Run a simple linear regression within a SPLIT FILE by ID.
* Use MATRIX OUT to save the results.

SET RESULTS OFF ERRORS OFF /* suppress output*/ .
split file by subject.
REGRESSION
  MATRIX OUT("C:\Temp\MatrixData.sav") /
  DEPENDENT distance /
  METHOD=ENTER age
.
SPLIT FILE OFF.
SET RESULTS ON ERRORS ON /* output back on */.

GET FILE = "C:\Temp\MatrixData.sav".
select if VARNAME_ EQ "distance" /* replace "distance"with the Y-variable name */.
execute.
rename variables (age=r) /* replace AGE with X-variable name */.
compute rsq = r**2.
match files file = * / keep = subject r rsq.
formats r rsq (f5.4).
descriptives r rsq.



xenia wrote
Thank you,
I haven't been able to try out any suggestions yet,when I've done so
I'll provide feedback.
I think what I want is more simplified than what you have in mind,
because I have a simple linear regression, one dependent and one
independent variable,
so one ENTER, no use of backward or forward stepwise. So, single step
regression, just repeated many times.
In my file I have 10 observations for individual 1 and run a
regression on those 10, then I run a regression only on the e.g. 15
observations I have for individual two, so
this is the only difference between the regressions, the number of
observations used to run the regressions and of course the fact that
each group of observations
used for each regression belongs to an individual different than the
other groups of observations. Also, the values for the dependent and independent
variables vary between observations of the same individual and of course between different
individuals. So, I run one regression for all the
observations of an individual, and
do so for all individuals in the file. The variable names don't change, so
I'd say it's a  single regression command embedded in a split files
command. Each regression has
output, amongst which is the R, the R square, and other values for
which SPSS doesn't give me the option to save in a file, as it does
with other things. What I want is to
have the one value for e.g. R produced by one regression to be saved
to an external file, then the R produced in the 2nd regression again
saved to the file (without overwriting etc),
in the end I will have a column or row with as many R values as the
regressions run. So, if I generalize I'd say, how can I save a single
value produced in the output of a linear regression
to a file, and do so repetitively for each of many regressions, when
I'm not interested in e.g.residuals or other entities that are saved
automatically.
I think what J.Peck suggests is what I'm after, I just didn't have the
time to try it out yet.
Thank you all for taking the time to look so deeply into this query.


On 19 October 2012 14:34, Maguin, Eugene [via SPSSX Discussion]
<ml-node+s1045642n5715768h97@n5.nabble.com> wrote:
> Xenia,
>
> I know you have gotten some replies but none seem to have been what you are
> wanting. So, back up and describe the regressions in structural terms. What
> I mean is this. How many different regression commands are there expected to
> be? Does each command have a single step or multiple steps? By 'step' I mean
> either an 'enter' subcommand or a variable addition or removal in a forward
> or backward stepwise command. What differs from command to command? Is it
> different DVs or different IV? Or a single regression command embedded in a
> split files command? What is the range in the number of IVs per regression
> command across the set of regression commands?
>
> If you were to come to me and ask for how to do this, I think I'd have a
> pretty detailed set of questions for you about what you wanted to do. Not
> 'why do this questions' but 'what' questions. I think you may be struggling
> against a set of what questions on the part of responders.
>
> So, for example, if your regression command were this, what do you want to
> see?
>
> Regression dependent=y/enter x1.
>
> If it was like this, what do you want to see?
>
> Regression dependent=y/enter x1 x2/enter x3.
>
> Gene Maguin
>
>
>
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
> Sent: Thursday, October 18, 2012 10:44 PM
> To: [hidden email]
> Subject: Re: saving specific output
>
> I could say the same for your tone actually, because I wrote to C.Parise "if
> you read my post carefully", I did not offend her, but you are actually
> offending someone when in your reply you say "read your own damn post", as
> you have.
> Again, in my post - which is there for everybody to see- I referred to the
> "correlation coefficient", and the person who first replied to me J.Peck
> talked about R squared. We all know the output from the linear regression
> has both, R and R squared. These are just two values, very closely related
> obviously, both appearing in the Model Summary in the output. One
> regression, one R, one R squared. My question was how can I save the
> correlation coefficient in a file for each of the regressions I run.
> Obviously, if I can save the R then I can save the R squared as well, and
> vice versa, so this wasn't the point of my question really. As I state in my
> question "what if I want to save something that is not under the "save
> options" in SPSS? ", so the problem is not if I'm going to save the R or the
> R squared, but how. I asked for the correlation coefficient R or r or ρ, as
> it is output in the Model Summary of the regression, right next to the R
> squared, J.Peck referred to the R squared.
> Even so, whether I wanted to save the R, the R squared, the B or whatever
> else, the essence of my question is the same, because it is clear that I
> simply want to save something generated in the output in another file for
> some purpose. C.Parise thought, this is what she wrote, that I wanted to
> save something in my dataset file, and she wouldn't have understood
> differently if I had written that I want the R and not the R squared. She
> misunderstood regarding where I wanted to save, not what. And again, I
> referred to R, J.Peck referred to the R squared. So, I refer to R, J.P
> refers to R squared and I misuse terms and am sloppy in my
> communication....?? Actually neither me nor him are misscommunicating,
> because he understood exactly where the point in my query was.
> So my post was this:
> "hello all,
>>> how can I save e.g. the *correlation coefficient * after a *linear
>>> regression *i.e. get SPSS to output it in a file, and do that *for
>>> all the regressions run*, so that in the end I have a file with a
>>> column of *correlation coefficients*?  I know you can save residuals
>>> from a regression in your data file, but what if I want to save
>>> something that is not under the "save options" in SPSS?
>>>
>>> Thank you all
>>> "
> I clearly say "the correlation coefficient after a linear regression",
> "output it in a file", "for all the regressions run". It is pretty clear
> that after each linear regression I want to output the correlation
> coefficient, this is one value, to a file, and do the same for a number of
> regressions. I can hardly call that gross misscommunication and expecting
> people to read my mind, I was clear in stating what I wanted exactly. My
> description is clear and concise, and consistent, so I don't see any
> sloppiness on my part, as you say.
> Finally, because I have not insulted anyone, you cannot correct someone's
> tone if you "think" they are insulting by using a worse tone yourself. I
> explained again to the person who did not understand. Now, if I was
> misscommunicating, people would have replied that they do not understand my
> question and I wouldn't have got many accurate first replies. That shows
> that the people that replied understood my question. So,  if someone does
> not understand, this is probably not because of me, otherwise most people
> wouldn't have understood. And if you think "if you read my post carefully"
> is insulting, then "read your damn post" certainly is. You will comment on
> my tone again presumably, but I have to defend myself because I think that
> your reply was false and too exaggerated really.
>
> So, thank you all for your many replies, I will try them and she what
> happens.
>
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715768.html
> To unsubscribe from saving specific output, click here.
> NAML
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

David Marso
Administrator
FWIW:
 Oct 18, 2012; 10:02am
Re: looping, split file and saving
David Marso
       
In reply to this post by xenia
See DEFINE !ENDDEFINE in FM.  Within that see !DO .
also see TEMPORARY followed by SELECT IF , alternatively FILTER .

DEFINE mloop ()
!DO !I=1 !TO 1000.
COMPUTE @Filt = (code EQ !I) .
FILTER BY @Filt .
graph command.
regression command
!DOEND
!ENDDEFINE .

mloop .

For Correlation see MATRIX OUT on Correlation/Regression/Factor etc command supports SPLIT FILE.
Bruce Weaver wrote
IIRC, someone earlier in the thread mentioned MATRIX OUT as a means of saving the correlations -- or in the case of simple linear regression, the correlation.  See below for an example.  OMS is another option, as in Jon's post.  But I think MATRIX OUT is even easier if all you want is r (and possibly r-squared).

new file.
dataset close all.

* Modify path to suit your computer.
GET FILE = "C:\SPSSdata\Growth study.sav".

* Run a simple linear regression within a SPLIT FILE by ID.
* Use MATRIX OUT to save the results.

SET RESULTS OFF ERRORS OFF /* suppress output*/ .
split file by subject.
REGRESSION
  MATRIX OUT("C:\Temp\MatrixData.sav") /
  DEPENDENT distance /
  METHOD=ENTER age
.
SPLIT FILE OFF.
SET RESULTS ON ERRORS ON /* output back on */.

GET FILE = "C:\Temp\MatrixData.sav".
select if VARNAME_ EQ "distance" /* replace "distance"with the Y-variable name */.
execute.
rename variables (age=r) /* replace AGE with X-variable name */.
compute rsq = r**2.
match files file = * / keep = subject r rsq.
formats r rsq (f5.4).
descriptives r rsq.



xenia wrote
Thank you,
I haven't been able to try out any suggestions yet,when I've done so
I'll provide feedback.
I think what I want is more simplified than what you have in mind,
because I have a simple linear regression, one dependent and one
independent variable,
so one ENTER, no use of backward or forward stepwise. So, single step
regression, just repeated many times.
In my file I have 10 observations for individual 1 and run a
regression on those 10, then I run a regression only on the e.g. 15
observations I have for individual two, so
this is the only difference between the regressions, the number of
observations used to run the regressions and of course the fact that
each group of observations
used for each regression belongs to an individual different than the
other groups of observations. Also, the values for the dependent and independent
variables vary between observations of the same individual and of course between different
individuals. So, I run one regression for all the
observations of an individual, and
do so for all individuals in the file. The variable names don't change, so
I'd say it's a  single regression command embedded in a split files
command. Each regression has
output, amongst which is the R, the R square, and other values for
which SPSS doesn't give me the option to save in a file, as it does
with other things. What I want is to
have the one value for e.g. R produced by one regression to be saved
to an external file, then the R produced in the 2nd regression again
saved to the file (without overwriting etc),
in the end I will have a column or row with as many R values as the
regressions run. So, if I generalize I'd say, how can I save a single
value produced in the output of a linear regression
to a file, and do so repetitively for each of many regressions, when
I'm not interested in e.g.residuals or other entities that are saved
automatically.
I think what J.Peck suggests is what I'm after, I just didn't have the
time to try it out yet.
Thank you all for taking the time to look so deeply into this query.


On 19 October 2012 14:34, Maguin, Eugene [via SPSSX Discussion]
<ml-node+s1045642n5715768h97@n5.nabble.com> wrote:
> Xenia,
>
> I know you have gotten some replies but none seem to have been what you are
> wanting. So, back up and describe the regressions in structural terms. What
> I mean is this. How many different regression commands are there expected to
> be? Does each command have a single step or multiple steps? By 'step' I mean
> either an 'enter' subcommand or a variable addition or removal in a forward
> or backward stepwise command. What differs from command to command? Is it
> different DVs or different IV? Or a single regression command embedded in a
> split files command? What is the range in the number of IVs per regression
> command across the set of regression commands?
>
> If you were to come to me and ask for how to do this, I think I'd have a
> pretty detailed set of questions for you about what you wanted to do. Not
> 'why do this questions' but 'what' questions. I think you may be struggling
> against a set of what questions on the part of responders.
>
> So, for example, if your regression command were this, what do you want to
> see?
>
> Regression dependent=y/enter x1.
>
> If it was like this, what do you want to see?
>
> Regression dependent=y/enter x1 x2/enter x3.
>
> Gene Maguin
>
>
>
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of xenia
> Sent: Thursday, October 18, 2012 10:44 PM
> To: [hidden email]
> Subject: Re: saving specific output
>
> I could say the same for your tone actually, because I wrote to C.Parise "if
> you read my post carefully", I did not offend her, but you are actually
> offending someone when in your reply you say "read your own damn post", as
> you have.
> Again, in my post - which is there for everybody to see- I referred to the
> "correlation coefficient", and the person who first replied to me J.Peck
> talked about R squared. We all know the output from the linear regression
> has both, R and R squared. These are just two values, very closely related
> obviously, both appearing in the Model Summary in the output. One
> regression, one R, one R squared. My question was how can I save the
> correlation coefficient in a file for each of the regressions I run.
> Obviously, if I can save the R then I can save the R squared as well, and
> vice versa, so this wasn't the point of my question really. As I state in my
> question "what if I want to save something that is not under the "save
> options" in SPSS? ", so the problem is not if I'm going to save the R or the
> R squared, but how. I asked for the correlation coefficient R or r or ρ, as
> it is output in the Model Summary of the regression, right next to the R
> squared, J.Peck referred to the R squared.
> Even so, whether I wanted to save the R, the R squared, the B or whatever
> else, the essence of my question is the same, because it is clear that I
> simply want to save something generated in the output in another file for
> some purpose. C.Parise thought, this is what she wrote, that I wanted to
> save something in my dataset file, and she wouldn't have understood
> differently if I had written that I want the R and not the R squared. She
> misunderstood regarding where I wanted to save, not what. And again, I
> referred to R, J.Peck referred to the R squared. So, I refer to R, J.P
> refers to R squared and I misuse terms and am sloppy in my
> communication....?? Actually neither me nor him are misscommunicating,
> because he understood exactly where the point in my query was.
> So my post was this:
> "hello all,
>>> how can I save e.g. the *correlation coefficient * after a *linear
>>> regression *i.e. get SPSS to output it in a file, and do that *for
>>> all the regressions run*, so that in the end I have a file with a
>>> column of *correlation coefficients*?  I know you can save residuals
>>> from a regression in your data file, but what if I want to save
>>> something that is not under the "save options" in SPSS?
>>>
>>> Thank you all
>>> "
> I clearly say "the correlation coefficient after a linear regression",
> "output it in a file", "for all the regressions run". It is pretty clear
> that after each linear regression I want to output the correlation
> coefficient, this is one value, to a file, and do the same for a number of
> regressions. I can hardly call that gross misscommunication and expecting
> people to read my mind, I was clear in stating what I wanted exactly. My
> description is clear and concise, and consistent, so I don't see any
> sloppiness on my part, as you say.
> Finally, because I have not insulted anyone, you cannot correct someone's
> tone if you "think" they are insulting by using a worse tone yourself. I
> explained again to the person who did not understand. Now, if I was
> misscommunicating, people would have replied that they do not understand my
> question and I wouldn't have got many accurate first replies. That shows
> that the people that replied understood my question. So,  if someone does
> not understand, this is probably not because of me, otherwise most people
> wouldn't have understood. And if you think "if you read my post carefully"
> is insulting, then "read your damn post" certainly is. You will comment on
> my tone again presumably, but I have to defend myself because I think that
> your reply was false and too exaggerated really.
>
> So, thank you all for your many replies, I will try them and she what
> happens.
>
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715768.html
> To unsubscribe from saving specific output, click here.
> NAML
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

xenia
In reply to this post by Jon K Peck
I have tried this and it works fine
thank you

On 19 October 2012 17:22, Jon K Peck [via SPSSX Discussion]
<[hidden email]> wrote:

> In the interest of clarity, here is a complete example of capturing the R
> and R2 from a series of regressions using OMS.  It uses the employee
> data.sav data.
>
> dataset declare modelsummary.
> oms select tables /if subtypes='Model Summary'
> /destination outfile=modelsummary format=sav.
>
> REGRESSION
>   /STATISTICS COEFF OUTS R ANOVA
>   /DEPENDENT salary
>   /METHOD=ENTER prevexp educ.
> REGRESSION
>   /STATISTICS COEFF OUTS R ANOVA
>   /DEPENDENT salary
>   /METHOD=ENTER prevexp minority.
> REGRESSION
>   /STATISTICS COEFF OUTS R ANOVA
>   /DEPENDENT salary
>   /METHOD=ENTER prevexp educ minority.
> omsend.
>
> The dataset named modelsummary will contain, among other variables, R,
> RSquare, AdjustedRSquare, and Std.ErroroftheEstimate.  One case for each
> regression.  IOW, it turns the Model Summary table into a case for each
> regression.
>
>
> Jon Peck (no "h") aka Kim
> Senior Software Engineer, IBM
> [hidden email]
> new phone: 720-342-5621
>
>
>
>
> From:        "Maguin, Eugene" <[hidden email]>
> To:        [hidden email],
> Date:        10/19/2012 07:31 AM
> Subject:        Re: [SPSSX-L] saving specific output
> Sent by:        "SPSSX(r) Discussion" <[hidden email]>
> ________________________________
>
>
>
> Xenia,
>
> I know you have gotten some replies but none seem to have been what you are
> wanting. So, back up and describe the regressions in structural terms. What
> I mean is this. How many different regression commands are there expected to
> be? Does each command have a single step or multiple steps? By 'step' I mean
> either an 'enter' subcommand or a variable addition or removal in a forward
> or backward stepwise command. What differs from command to command? Is it
> different DVs or different IV? Or a single regression command embedded in a
> split files command? What is the range in the number of IVs per regression
> command across the set of regression commands?
>
> If you were to come to me and ask for how to do this, I think I'd have a
> pretty detailed set of questions for you about what you wanted to do. Not
> 'why do this questions' but 'what' questions. I think you may be struggling
> against a set of what questions on the part of responders.
>
> So, for example, if your regression command were this, what do you want to
> see?
>
> Regression dependent=y/enter x1.
>
> If it was like this, what do you want to see?
>
> Regression dependent=y/enter x1 x2/enter x3.
>
> Gene Maguin
>
>
>
>
>
>
> -----Original Message-----
> From: SPSSX(r) Discussion [
> [hidden email]] On Behalf Of xenia
>
> Sent: Thursday, October 18, 2012 10:44 PM
> To: [hidden email]
> Subject: Re: saving specific output
>
> I could say the same for your tone actually, because I wrote to C.Parise "if
> you read my post carefully", I did not offend her, but you are actually
> offending someone when in your reply you say "read your own damn post", as
> you have.
> Again, in my post - which is there for everybody to see- I referred to the
> "correlation coefficient", and the person who first replied to me J.Peck
> talked about R squared. We all know the output from the linear regression
> has both, R and R squared. These are just two values, very closely related
> obviously, both appearing in the Model Summary in the output. One
> regression, one R, one R squared. My question was how can I save the
> correlation coefficient in a file for each of the regressions I run.
> Obviously, if I can save the R then I can save the R squared as well, and
> vice versa, so this wasn't the point of my question really. As I state in my
> question "what if I want to save something that is not under the "save
> options" in SPSS? ", so the problem is not if I'm going to save the R or the
> R squared, but how. I asked for the correlation coefficient R or r or ρ, as
> it is output in the Model Summary of the regression, right next to the R
> squared, J.Peck referred to the R squared.
> Even so, whether I wanted to save the R, the R squared, the B or whatever
> else, the essence of my question is the same, because it is clear that I
> simply want to save something generated in the output in another file for
> some purpose. C.Parise thought, this is what she wrote, that I wanted to
> save something in my dataset file, and she wouldn't have understood
> differently if I had written that I want the R and not the R squared. She
> misunderstood regarding where I wanted to save, not what. And again, I
> referred to R, J.Peck referred to the R squared. So, I refer to R, J.P
> refers to R squared and I misuse terms and am sloppy in my
> communication....?? Actually neither me nor him are misscommunicating,
> because he understood exactly where the point in my query was.
> So my post was this:
> "hello all,
>>> how can I save e.g. the *correlation coefficient * after a *linear
>>> regression *i.e. get SPSS to output it in a file, and do that *for
>>> all the regressions run*, so that in the end I have a file with a
>>> column of *correlation coefficients*?  I know you can save residuals
>
>>> from a regression in your data file, but what if I want to save
>>> something that is not under the "save options" in SPSS?
>>>
>>> Thank you all
>>> "
> I clearly say "the correlation coefficient after a linear regression",
> "output it in a file", "for all the regressions run". It is pretty clear
> that after each linear regression I want to output the correlation
> coefficient, this is one value, to a file, and do the same for a number of
> regressions. I can hardly call that gross misscommunication and expecting
> people to read my mind, I was clear in stating what I wanted exactly. My
> description is clear and concise, and consistent, so I don't see any
> sloppiness on my part, as you say.
> Finally, because I have not insulted anyone, you cannot correct someone's
> tone if you "think" they are insulting by using a worse tone yourself. I
> explained again to the person who did not understand. Now, if I was
> misscommunicating, people would have replied that they do not understand my
> question and I wouldn't have got many accurate first replies. That shows
> that the people that replied understood my question. So,  if someone does
> not understand, this is probably not because of me, otherwise most people
> wouldn't have understood. And if you think "if you read my post carefully"
> is insulting, then "read your damn post" certainly is. You will comment on
> my tone again presumably, but I have to defend myself because I think that
> your reply was false and too exaggerated really.
>
> So, thank you all for your many replies, I will try them and she what
> happens.
>
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715758.html
>
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://spssx-discussion.1045642.n5.nabble.com/saving-specific-output-tp5715729p5715769.html
> To unsubscribe from saving specific output, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Automatic reply: saving specific output

Matthew Fuller-Tyszkiewicz

Hi,

I'm away on leave, and will return to work on Wednesday 5th December. I will not have access to my email account while away, and will endeavour to return your emails shortly after my return.

Cheers,
Matt.

 

Reply | Threaded
Open this post in threaded view
|

Re: saving specific output

xenia
In reply to this post by Jon K Peck
hello again,
as I had posted previously, John's code was working fine, and besides the regression output I have also used it for a simple t-test output, done over many iterations for the different levels of the variable "totalsamples", as follows. So, it is pretty efficient with creating variables from the results you get, to maybe use in further analyses, from most procedures in SPSS that give you tables of results.

SORT CASES BY totalsamples.
SPLIT FILE SEPARATE BY totalsamples.

dataset declare modelsummary.
oms select tables /if subtypes='Group Statistics'.
oms select tables /if subtypes='Independent Samples Test'
/destination outfile=modelsummary format=sav.

DATASET ACTIVATE DataSet2.
T-TEST GROUPS=sex('m' 'f')
  /MISSING=ANALYSIS
  /VARIABLES=meanage
  /CRITERIA=CI(.95).

omsend.

SPLIT FILE OFF.

USE ALL.