Creating a variable or function?

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

Re: Creating a variable or function?

David Marso-2
VALUE LABELS AMBIGUOUS_POND_RMQ
"-1" 'All PREGYEARS missing'
"0" 'Matching Unique RMQ Preg Year'
"1" 'Multiple Possible RMQ Preg Years'.

Should be:

VALUE LABELS AMBIGUOUS_POND_RMQ
 -1 'All PREGYEARS missing'
 0 'Matching Unique RMQ Preg Year'
 1 'Multiple Possible RMQ Preg Years'.

=====================
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: Creating a variable or function?

J.D. Haltigan
Interesting. The double quotes around the values for the value labels has
always worked for me with no trouble.



--
Sent from: http://spssx-discussion.1045642.n5.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: Creating a variable or function?

David Marso
Administrator
I would expect it to give an error or warning but it works.
Don't plan to use it.  Something doesn't feel quite right .

DATA LIST FREE / x.
BEGIN DATA
1
END DATA.
VALUE LABELS
 x
 "1" "One".
FREQUENCIES x.



J.D. Haltigan wrote

> Interesting. The double quotes around the values for the value labels has
> always worked for me with no trouble.
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Creating a variable or function?

Jon Peck
Single and double quotes are perfectly legit anywhere in Statistics.  And inside either, you can use the other or double it.

On Mon, Apr 8, 2019 at 8:29 AM David Marso <[hidden email]> wrote:
I would expect it to give an error or warning but it works.
Don't plan to use it.  Something doesn't feel quite right .

DATA LIST FREE / x.
BEGIN DATA
1
END DATA.
VALUE LABELS
 x
 "1" "One".
FREQUENCIES x.



J.D. Haltigan wrote
> Interesting. The double quotes around the values for the value labels has
> always worked for me with no trouble.
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
--
Jon K Peck
[hidden email]

===================== 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: Creating a variable or function?

David Marso
Administrator
These were for labeling a NUMERIC variable, hence my initial post.


Jon Peck wrote
> Single and double quotes are perfectly legit anywhere in Statistics.  And
> inside either, you can use the other or double it.
>
> On Mon, Apr 8, 2019 at 8:29 AM David Marso &lt;

> david.marso@

> &gt; wrote:
>
>> I would expect it to give an error or warning but it works.
>> Don't plan to use it.  Something doesn't feel quite right .
>>
>> DATA LIST FREE / x.
>> BEGIN DATA
>> 1
>> END DATA.
>> VALUE LABELS
>>  x
>>  "1" "One".
>> FREQUENCIES x.
>>
>>
>>
>> J.D. Haltigan wrote
>> > Interesting. The double quotes around the values for the value labels
>> has
>> > always worked for me with no trouble.
>> >
>> >
>> >
>> > --
>> > Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>> >
>> > =====================
>> > To manage your subscription to SPSSX-L, send a message to
>>
>> > LISTSERV@.UGA
>>
>> >  (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?"
>> --
>> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (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
>>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Creating a variable or function?

J.D. Haltigan
In reply to this post by J.D. Haltigan
Wanted to follow-up with an elementary query on this thread rather than
clutter the board with a useless one.

I am working with a raw data set that is a behemoth and creating summary
variables for a subsequent analyses. Part of my strategy is to
create/compute relevant summary variables and place them at the end of the
working raw dataset. I will then DROP variables when ready. For some
variables I just want to essentially copy them to the end (slightly
different variant of the variable name, of course).

Right now I just use COMPUTE V1_VARIANT=VARIANT.
EXE.

This is fine and serves my purposes, but I was wondering if there was
something more relevant/efficient/informative.

Thanks for any suggestions.



--
Sent from: http://spssx-discussion.1045642.n5.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: Creating a variable or function?

Rich Ulrich
Well, I would not DROP variables. I keep my "real analysis" files as
permanent documentation. For a computation that you sometimes
want/ sometimes don't want, you might put the syntax into a file to
be INSERTed.  Or the reusable summary scores could be saved in a
smaller file with just ID, Scores.

Is your dataset behemoth because of number of variables?  I grew up
with slow computers and slow processing, so I learned to strip my "big"
file down to only the variables that I needed for a set of analyses. I
imagine that also helped to prevent mistakes of using the wrong
variable with a too-similar name, or failing to include part of the
essential set. And that file would be saved as permanent documentation.

--
Rich Ulrich


From: SPSSX(r) Discussion <[hidden email]> on behalf of J.D. Haltigan <[hidden email]>
Sent: Sunday, April 14, 2019 9:39 PM
To: [hidden email]
Subject: Re: Creating a variable or function?
 
Wanted to follow-up with an elementary query on this thread rather than
clutter the board with a useless one.

I am working with a raw data set that is a behemoth and creating summary
variables for a subsequent analyses. Part of my strategy is to
create/compute relevant summary variables and place them at the end of the
working raw dataset. I will then DROP variables when ready. For some
variables I just want to essentially copy them to the end (slightly
different variant of the variable name, of course).

Right now I just use COMPUTE V1_VARIANT=VARIANT.
EXE.

This is fine and serves my purposes, but I was wondering if there was
something more relevant/efficient/informative.

Thanks for any suggestions.



--
Sent from: http://spssx-discussion.1045642.n5.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: Creating a variable or function?

J.D. Haltigan
I did not mean to imply I would not save the original file, Rich. Indeed, I
would drop and 'pair down' my analytic file to only those variables I need
for subsequent analyses saving as a new file etc. Of course all this gets
documented both in the syntax file as well as in a separate document.



--
Sent from: http://spssx-discussion.1045642.n5.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: Creating a variable or function?

David Marso-2
In reply to this post by J.D. Haltigan
RECODE VARIANT (COPY) INTO V1_VARIANT.

Perhaps.  I have not done any benchmarks.
At any rate get rid of the EXE if you have a behemoth file.

=====================
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: Creating a variable or function?

David Marso
Administrator
Should be

RECODE VARIANT (ELSE=COPY) INTO V1_VARIANT.

Slightly slower than COMPUTE.

MATRIX.
SAVE MAKE(30000000,1,1)/ OUTFILE */VARIABLES test.
END MATRIX.
COMPUTE test=TRUNC(RV.UNIFORM(1,6)).
EXECUTE.
DATASET NAME rawtest.

MATRIX.
SAVE MAKE(1,1,1)/ OUTFILE */VARIABLES bench.
END MATRIX.
DATASET NAME bench.

COMPUTE T0=$TIME.
DATASET ACTIVATE rawtest.
COMPUTE test_new=test.
EXECUTE.
DATASET ACTIVATE bench.
COMPUTE T_elapsed=$TIME-t0.
PRINT /T_elapsed.
EXECUTE.

COMPUTE T0=$TIME.
DATASET ACTIVATE rawtest.
RECODE test (ELSE=COPY) INTO test_new.
EXECUTE.
DATASET ACTIVATE bench.
COMPUTE T_elapsed=$TIME-t0.
PRINT /T_elapsed.
EXECUTE.



David Marso-2 wrote
> RECODE VARIANT (COPY) INTO V1_VARIANT.
>
> Perhaps.  I have not done any benchmarks.
> At any rate get rid of the EXE if you have a behemoth file.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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: Creating a variable or function?

J.D. Haltigan
Based on this would seem the COMPUTE route is marginally a more efficient way
to do it. Would you agree?

Also re: my prior post I want to correct to 'pare down' NOT pair down as
previously stated.



--
Sent from: http://spssx-discussion.1045642.n5.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: Creating a variable or function?

David Marso
Administrator
True.  It is also more concise unless you are copying many variables.
OTOH: DO REPEAT will help with that.

J.D. Haltigan wrote

> Based on this would seem the COMPUTE route is marginally a more efficient
> way
> to do it. Would you agree?
>
> Also re: my prior post I want to correct to 'pare down' NOT pair down as
> previously stated.
>
>
>
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (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?"
--
Sent from: http://spssx-discussion.1045642.n5.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
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?"
12