howto handle different variable structure while import

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

howto handle different variable structure while import

Moon Kid
I don't input the data with SPSS itself. The data comes from cvs-files.

An example:
v01, v02, v03

So after import to SPSS I want to have fourth variable depending on the
three before.

v04 = (v01 + v02) * v03

So how do I handle that in practice? So I have 4 variables in SPSS but
only 3 fields the CVS-file. How can I specify while cvs-import which of
the cvs-fields are related to which spss-variable?

=====================
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: howto handle different variable structure while import

Art Kendall
At the end of the syntax you use to read the csv file add

COMPUTE
v04 = (v01 + v02) * v03.
DESCRIPTIVES variables = v04.

then of course go bak and complete the metadata for you data. I.e., meaningful names, labels, level of measurement, etc.
Art Kendall
Social Research Consultants
On 3/22/2014 7:28 AM, Moon Kid [via SPSSX Discussion] wrote:
I don't input the data with SPSS itself. The data comes from cvs-files.

An example:
v01, v02, v03

So after import to SPSS I want to have fourth variable depending on the
three before.

v04 = (v01 + v02) * v03

So how do I handle that in practice? So I have 4 variables in SPSS but
only 3 fields the CVS-file. How can I specify while cvs-import which of
the cvs-fields are related to which spss-variable?

=====================
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/howto-handle-different-variable-structure-while-import-tp5724981.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: howto handle different variable structure while import

Moon Kid
On 2014-03-22 05:30 Art Kendall <[hidden email]> wrote:
>     At the end of the
>         syntax you use to read the csv file add
>
>         COMPUTE v04 = (v01 + v02) * v03.
>       DESCRIPTIVES variables = v04.

Ok, this is logical for me. There is no other solution?
Because this workflow affect the logical order of my variables. E.g. I
create v01 to v50 depending on the cvs-file. And for v04 I want to do
some calculations (v04x). In that case it would be great to have v04x
between v04 and v05 instead of having it at the end of all other
variables.

But I can live with it if there is no other way. :)

=====================
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: howto handle different variable structure while import

Jon K Peck
If for some reason you really need the variables in a fixed order, you can use the SORT VARIABLES command to reorder the variables according to various criteria including name.


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




From:        Moon Kid <[hidden email]>
To:        [hidden email],
Date:        03/22/2014 07:33 AM
Subject:        Re: [SPSSX-L] howto handle different variable structure while              import
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




On 2014-03-22 05:30 Art Kendall <[hidden email]> wrote:
>     At the end of the
>         syntax you use to read the csv file add
>
>         COMPUTE v04 = (v01 + v02) * v03.
>       DESCRIPTIVES variables = v04.

Ok, this is logical for me. There is no other solution?
Because this workflow affect the logical order of my variables. E.g. I
create v01 to v50 depending on the cvs-file. And for v04 I want to do
some calculations (v04x). In that case it would be great to have v04x
between v04 and v05 instead of having it at the end of all other
variables.

But I can live with it if there is no other way. :)

=====================
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: howto handle different variable structure while import

Art Kendall
In reply to this post by Moon Kid
something like (untested)
match files  file
= ID V01 to v04 v04x v05 all.

of course variable names are only used to describe the task.
You should have meaningful variable names.
Art Kendall
Social Research Consultants
On 3/22/2014 9:38 AM, Moon Kid [via SPSSX Discussion] wrote:
On 2014-03-22 05:30 Art Kendall <[hidden email]> wrote:
>     At the end of the
>         syntax you use to read the csv file add
>
>         COMPUTE v04 = (v01 + v02) * v03.
>       DESCRIPTIVES variables = v04.

Ok, this is logical for me. There is no other solution?
Because this workflow affect the logical order of my variables. E.g. I
create v01 to v50 depending on the cvs-file. And for v04 I want to do
some calculations (v04x). In that case it would be great to have v04x
between v04 and v05 instead of having it at the end of all other
variables.

But I can live with it if there is no other way. :)

=====================
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/howto-handle-different-variable-structure-while-import-tp5724981p5724990.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: howto handle different variable structure while import

Richard Ristow
At 09:52 AM 3/22/2014, Art Kendall wrote:

>something like (untested)
>match files  file = ID V01 to v04 v04x v05 all.

I think you mean

MATCH FILES
    /FILE=*
    /KEEP=ID V01 to v04 v04x v05 all.

=====================
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: howto handle different variable structure while import

Art Kendall
Yes I did.

I don't know how that snippet of text became lost in the post.
Art Kendall
Social Research Consultants
On 3/22/2014 5:46 PM, Richard Ristow [via SPSSX Discussion] wrote:
At 09:52 AM 3/22/2014, Art Kendall wrote:

>something like (untested)
>match files  file = ID V01 to v04 v04x v05 all.

I think you mean

MATCH FILES
    /FILE=*
    /KEEP=ID V01 to v04 v04x v05 all.

=====================
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/howto-handle-different-variable-structure-while-import-tp5724981p5725005.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants