sam.cor {multilevel} | R Documentation |
This function will generate a sample of numbers (y) that are correlated with a fixed set of observations (x). The degree of correlation between x and y is determined by the parameter rho (the population correlation). Note that the sample correlation of x and y will vary around the true population correlation, but this variation will decrease as the size of x increases.
sam.cor(x,rho)
x |
The fixed set of observations. |
rho |
The targeted population correlation value. |
The function prints the sample correlation for the specific set of numbers generated.
y |
A vector of numbers correlated with x. |
Paul Bliese paul.bliese@us.army.mil
data(bh1996) NEWVAR<-sam.cor(x=bh1996$LEAD,rho=.30) cor(bh1996$LEAD,NEWVAR)