Reordering of variables

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

Reordering of variables

Kelly Sorensen
Hi All,

I've looked in the archives for this and haven't been able to figure it out (though I'm sure others could and maybe I just can't follow enough of the snytax).

I have a data set with demographic variables that I'd like to order in a way that makes sense, and alphabetically would be fine, but I'd prefer to have "other" after the discrete categories and then "no response" last. I could do this by making variable titles a bit awkward (such as changing "no response" to "response not given," but I'd like to use short title versions for my tables.

I know there has to be a way to do this, but I don't know it. Any suggestions?

Thanks,

Kelly
Reply | Threaded
Open this post in threaded view
|

Re: Reordering of variables

Spousta Jan
Hi,

Save the file with the variables ordered and open it then again.

Save oufile="c:/myfile.sav" /keep var1 var2 ... (ordered it the right
manner, you may get the names e.g. from the Variable View) ... Var100
/compressed.

Get file ="c:/myfile.sav".

HTH

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Kelly Sorensen
Sent: Saturday, December 09, 2006 4:07 AM
To: [hidden email]
Subject: Reordering of variables

Hi All,

I've looked in the archives for this and haven't been able to figure it
out (though I'm sure others could and maybe I just can't follow enough
of the snytax).

I have a data set with demographic variables that I'd like to order in a
way that makes sense, and alphabetically would be fine, but I'd prefer
to have "other" after the discrete categories and then "no response"
last. I could do this by making variable titles a bit awkward (such as
changing "no response" to "response not given," but I'd like to use
short title versions for my tables.

I know there has to be a way to do this, but I don't know it. Any
suggestions?

Thanks,

Kelly
Reply | Threaded
Open this post in threaded view
|

Re: Reordering of variables

ariel barak
In reply to this post by Kelly Sorensen
Hi Kelly,

I found out how to do this myself 3 months ago after finding the topic
covered on Raynald's SPSS Tools
site<http://www.spsstools.net/Syntax/LabelsAndVariableNames/DeleteOrReorderVariableNames.txt>.
Here is the syntax below...hope it helps. I like this because it doesn't
require you to spell out all of the variable names nor save the data.

-Ariel


* How to delete or reorder variable names.

* Raynald Levesque 2002/02/09.

DATA LIST LIST /id sex var1 z age.
BEGIN DATA
1 1 1 1 25
2 2 2 2 35
3 1 5 0 65
END DATA.

* TO change the order to the variables to age id sex var1 z.
MATCH FILES FILE=* /KEEP=age ALL.
LIST.

* NOTE: In the above command, ALL means all remaining variables not
previously named.

* Use the following to delete variables var1, z and age.
MATCH FILES FILE=* /DROP=var1 z age.
LIST.



On 12/8/06, Kelly Sorensen <[hidden email]> wrote:

>
> Hi All,
>
> I've looked in the archives for this and haven't been able to figure it
> out (though I'm sure others could and maybe I just can't follow enough of
> the snytax).
>
> I have a data set with demographic variables that I'd like to order in a
> way that makes sense, and alphabetically would be fine, but I'd prefer to
> have "other" after the discrete categories and then "no response" last. I
> could do this by making variable titles a bit awkward (such as changing "no
> response" to "response not given," but I'd like to use short title versions
> for my tables.
>
> I know there has to be a way to do this, but I don't know it. Any
> suggestions?
>
> Thanks,
>
> Kelly
>
Reply | Threaded
Open this post in threaded view
|

Association and trend analysis

cbautista
Hi list,

I'd like to know what method to use in SPSS (or in other package) to
evaluate the association and linear association (trend) of the following
scenearios:

a) 2 (unordered) x 4 (ordered). For example: 2 (gender) by 4 (period)
b) 3 (unordered) x 4 (ordered). For example: 3 (race) by 4 (period)

For a: I'm using the chi-square peason test and the Cochran-Armitage test
For b: I'm using the chi-square pearson test and the Linear-by-Linear
Association test

Thanks,

/Christian