random variables from normal distn

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

random variables from normal distn

jimjohn
can someone plz tell me how to use the random num generator to generate variables from a normal distribution. for example, if i know the mean and standard deviationa nd want to generate 30 nums.
Reply | Threaded
Open this post in threaded view
|

Re: random variables from normal distn

Jason Burke
This command syntax should help you create a dataset with 3 variables,
each with 30 cases. Each variable will feature a normal distribution
with a mean of 7.8 and a standard deviation of 1.3 :

NEW FILE .
INPUT PROGRAM .
VECTOR x (3, f3) .
LOOP #i = 1 to 30.
LOOP #p = 1 to 3.
COMPUTE x(#p) = RND(RV.NORMAL(7.8,1.3)) .
END LOOP .
END CASE .
END LOOP .
END FILE .
END INPUT PROGRAM .
EXECUTE .




On 3/4/08, jimjohn <[hidden email]> wrote:

> can someone plz tell me how to use the random num generator to generate
> variables from a normal distribution. for example, if i know the mean and
> standard deviationa nd want to generate 30 nums.
> --
> View this message in context: http://www.nabble.com/random-variables-from-normal-distn-tp15812244p15812244.html
> Sent from the SPSSX Discussion mailing list archive at 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