Standardize


On your USB drive, create a new directory, copy model.R to that directory, rename the file in the new directory, double click on the file to open Rstudio. Then copy all of the text below the line and paste it into your Rstudio editor pane.
# Generate some really random values and then normalize them
#  We will use gnrnd4 to do this, but we will manufacture
#  a random seed value for it
source("../gnrnd4.R")
source("../pop_sd.R")
#
# get a random value of 5 digits to the left of the decimal
x <- runif( 1, min=10000, max=99999)
x
# now, just get the integer portion
x <- as.integer(x)
x
# then create the first key to create 95 values
key1 <- (100000+x)*10000+ 9404
# set the second key to have a mean of around 200
y <- as.integer( runif(1, min=150, max=250))
y
# and a standard deviation of around 40
z <- as.integer( runif(1, min=25, max=55))
z
key2 = z*1000000+y*10
key1
key2
gnrnd4(key1,key2)
L1
L1_mean <- mean(L1)
L1_sd <- pop_sd(L1)
L1_mean
L1_sd
L2 <- ( L1 - L1_mean )
mean(L2)
pop_sd(L2)
L3 <-L2 / L1_sd
mean(L3)
pop_sd( L3 )
L3