0

I'm trying to simulate two random variables: One with a Normal Dist. and one with an Exp dist. I've run into issues as I cannot seem to find a good way to specify a different distribution for each variable. The column "row.names" is created everytime I run this, and I would like this not to happen. Also, the correlations at the end of the script are not what I was aiming for at the beginning. The code is rough (newish to R) so any advice would be appreciated.

m= matrix(c(1,.8,.8,1),nrow=2)
l=t(chol(m))
normal=matrix(rnorm(100,mean=10,sd=5),nrow=1,ncol=100)
exp=matrix(rexp(100,2), nrow=1,ncol=100)
data=rbind(normal,exp)
data2=t(as.data.frame(t(l)%*%data))
fix(data2)
cor(data2)

Thanks

  • 1
    It's NOT a column name. All dataframes have an attribute named "row.names" which is printed along the left side of the column values by the `print.data.frame` method which is called by the regualr read-eval-print loop of the R interpreter. You seem to having troubles with your statstical theory but that is off-topic for SO. – IRTFM Mar 30 '14 at 19:08
  • possible duplicate of [Is there a way to omit the first column when reading a csv](http://stackoverflow.com/questions/14527466/is-there-a-way-to-omit-the-first-column-when-reading-a-csv) – IRTFM Mar 30 '14 at 19:14

0 Answers0