dimanche 8 novembre 2020

Create a vector of values using rnorm for sample sizes stored in a different vector

I'm a complete newbie to R. My problem is as follows: I have a vector of sample sizes (I put random numbers)

samplesizes <- as.vector(c(50, 150, 50^3, 50^4, 50^5))

I need to create a vector of values using rnorm for each sample size in my samplesize vector and I am not sure how to take each sample from the vector and put it as N in rnorm function. The vectors will be of different sizes and I am not sure how to store them. I was thinking that I could store them as a matrix?




Aucun commentaire:

Enregistrer un commentaire