Mao Yang Yang SPSS essays

Uniformly distributed random numbers:

Set random seed.

Choose to convert the random number generator. Check setting the start point and the user enter a given numerical value in the fixed value of the check. Here we set event generator, the fixed value portion of the initialization 123456.

Generates two random numbers uniformly distributed.

Select the Transform Compute Variable, enter the variable name in the target variable box "Spinn" In the box, enter a numeric expression. "TRUNC (RV.UNIFORM (1,5))", then click the OK button.

Analytical properties of the random numbers generated.

Select analysis, descriptive statistics, frequency. Then the variable Spinn selected into a variable box. Click the Chart button. Check the histogram option. Then click Continue and OK.

Normally distributed random numbers.

First set the random number seed 123456. Open the data file chapter "sim.sav" and select Convert to calculate variable. Calculated variables dialog box to set the target variable "Rnorm01", the input numeric expressions portion. "RV.Normal (0,1)" click the OK button.

Observing the distribution of the random number generated.

FIG drawn first random number sequence generated. Select the graphic and the Chart Builder. In the choice of library label. Select the next bar. Then double-click the bar chart template on the right. Variable drag to the outer shaft Rnorm01 canvas. xid drag and drop variables to the x-axis. Then set the element properties. Edit Properties, select the thin line bar-style box. Select the bar chart. Statistics section of Statistics list box, select value. Finally, click the OK button.

Select the graphic chart builder. In the choice of selecting the histogram tag library. The Rnorm01 drop it on the horizontal axis. Then click Element Properties button. Then select the normal curve displayed in the dialog box. It is seen from the distribution of the histogram generated random number. Indeed normal.

And the probability distribution function of the binomial distribution.

Select New Data File, opens an empty data file in the data editor, the input 012,345,678,910 random variable X are all possible values ​​in the first column of the data view. Click the Variables view the variable name. X is set to zero instead of decimal places to build another two new variables, named c25 and c40. It is set to four decimal places. Variables view and data obtained.

Set random seed 123456. Then select the conversion calculation variable, the target variable in the box enter c25 calculated variables dialog box, the box, enter a numeric expression. "CDF.BINOM (x, 10,0.25)" and then click the OK button.

123456 random number seed set, and select the conversion calculation variable, the target variable input box c40 calculated variables dialog. But in the digital expression input box. "CDF.BINOM (x, 10,0.4)" to generate binomial random variable to another subject, c40

 

 

 

Guess you like

Origin www.cnblogs.com/206740a/p/11858631.html