Date: Wed, 8 Jun 2011 14:26:03 -0600
Reply-To: Jon K Peck <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Jon K Peck <email@example.com>
Subject: Re: Generating random 'constants'
I interpreted the request as asking for a column of constant values, so
something like this would be required.
DO IF $casenum = 1.
COMPUTE RV = rv.normal(0,1).
Senior Software Engineer, IBM
new phone: 720-342-5621
From: David Marso <firstname.lastname@example.org>
Date: 06/08/2011 02:20 PM
Subject: Re: [SPSSX-L] Generating random 'constants'
Sent by: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
DO IF $CASENUM=1.
* If you want a permanent copy *.
Note use of scratch variable.
Read up on scratch variables.
> I'm attempting to generate random 'constant' variables. I mean random as
> in randomly generated, and constant as in constant across all
> observations. I intend this to be used as a multiplier of sorts which is
> randomly generated when the syntax is run to introduce a little
> For example, I have a probability for a certain event, and I am running
> multiple 'trials' of this event and recording the outcome. For
> reasons, I want to add or subtract a randomly generated value (something
> like RV.Normal(0,.1)) from this probability for each observation.
> just generating a variable such as:
> compute randomadjustment = RV.Normal(0,.1).
> will create a unique random number for each observation. However, I want
> this adjustment to be constant across all observations. This way, every
> time the syntax is run, every observation's probability has the same
> random number added or subtracted from it. Is it possible to generate a
> 'random constant variable'?
> I hope all of this makes sense. Thanks for any help,
View this message in context:
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command