What exactly is 'width' in variable view?

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

What exactly is 'width' in variable view?

Ruben Geert van den Berg

Dear all,
 
I apologize for this silly question but I'm referring to this in a tutorial so I should know (and I'm curious too).
 
I've always thought that 'width' is the total number of characters a numeric variable can contain. However, if I reduce 'width' to 1 (zero decimals), then the value 10000 shows up perfectly normally in data view. Am I missing something here?
 
TIA!


 





Express yourself instantly with MSN Messenger! MSN Messenger
Reply | Threaded
Open this post in threaded view
|

Syntax commands to assign measurement level to variables

William Dudley WNDUDLEY

I am using vers 17 and need to redefine the measure levels of several variables which SPSS has decided are Scale but which are actually nominal or ordinal.
It is not clear to me how one does this with syntax.

Thanks in advance for your help.


William N. Dudley, PhD
Associate Dean for Research
The School of Health and Human Performance Office of Research
The University of North Carolina at Greensboro
126 HHP Building, PO Box 26170
Greensboro, NC 27402-6170
VOICE 336.2562475
FAX 336.334.3238
Reply | Threaded
Open this post in threaded view
|

Re: Syntax commands to assign measurement level to variables

Daniel Robertson
See p.2040 in the syntax guide. The command is VARIABLE LEVEL.

William Dudley WNDUDLEY wrote:

>
> I am using vers 17 and need to redefine the measure levels of several
> variables which SPSS has decided are Scale but which are actually
> nominal or ordinal.
> It is not clear to me how one does this with syntax.
>
> Thanks in advance for your help.
>
>
> William N. Dudley, PhD
> Associate Dean for Research
> The School of Health and Human Performance Office of Research
> The University of North Carolina at Greensboro
> 126 HHP Building, PO Box 26170
> Greensboro, NC 27402-6170
> VOICE 336.2562475
> FAX 336.334.3238

--
Daniel Robertson
Senior Research and Planning Associate
Institutional Research and Planning
Cornell University / irp.cornell.edu

=====================
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
|

Compute newvar string+number

parisec
Hi all,

I need to compute a new variable that combines a string variable with a
year variable which is stored as a number.

For example:
V1      Year
A5      2007
C90     2006

I would like my new variable to be a string:

A52007
C902006

Should i just convert my year to a string and use concat to do this or
does someone know of a trick so that i can leave year as a number?

Thanks
Carol

=====================
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: Compute newvar string+number

Daniel Robertson
You can use the string() function inside the concat() to convert the
value of Year to a string for the purposes of the transformation. You
may also want to use rtrim() on the V1 variable to remove trailing
blanks as necessary, e.g.,

string newvar (a8).
compute newvar = concat(rtrim(V1),string(Year,N4)).



Parise, Carol A. wrote:

> Hi all,
>
> I need to compute a new variable that combines a string variable with a
> year variable which is stored as a number.
>
> For example:
> V1      Year
> A5      2007
> C90     2006
>
> I would like my new variable to be a string:
>
> A52007
> C902006
>
> Should i just convert my year to a string and use concat to do this or
> does someone know of a trick so that i can leave year as a number?
>
> Thanks
> Carol
>
> =====================
> 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
>
>

--
Daniel Robertson
Senior Research and Planning Associate
Institutional Research and Planning
Cornell University / irp.cornell.edu

=====================
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: Compute newvar string+number

parisec
worked perfectly. thanks a bunch.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Daniel Robertson
Sent: Thursday, July 02, 2009 11:29 AM
To: [hidden email]
Subject: Re: Compute newvar string+number

You can use the string() function inside the concat() to convert the
value of Year to a string for the purposes of the transformation. You
may also want to use rtrim() on the V1 variable to remove trailing
blanks as necessary, e.g.,

string newvar (a8).
compute newvar = concat(rtrim(V1),string(Year,N4)).



Parise, Carol A. wrote:

> Hi all,
>
> I need to compute a new variable that combines a string variable with
> a year variable which is stored as a number.
>
> For example:
> V1      Year
> A5      2007
> C90     2006
>
> I would like my new variable to be a string:
>
> A52007
> C902006
>
> Should i just convert my year to a string and use concat to do this or

> does someone know of a trick so that i can leave year as a number?
>
> Thanks
> Carol
>
> =====================
> 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
>
>

--
Daniel Robertson
Senior Research and Planning Associate
Institutional Research and Planning
Cornell University / irp.cornell.edu

=====================
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