Re: [R] Help with simulation of unbalanced clustered data

2020-12-17 Thread Chao Liu
Thank you for your help Abby! On Wed, Dec 16, 2020 at 11:32 PM Abby Spurdle wrote: > Hi Chao Liu, > > I'm having difficulty following your question, and examples. > And also, I don't see the motivation for increasing, then decreasing > the sample sizes. > Intuitively, one would compute the corre

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Abby Spurdle
Hi Chao Liu, I'm having difficulty following your question, and examples. And also, I don't see the motivation for increasing, then decreasing the sample sizes. Intuitively, one would compute the correct sample sizes, first time round... But I thought I'd add some comments, just in case they're u

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Jeff Newmiller
Sigh. You still haven't read the Posting Guide? HTML email causes problems with this mailing list so do send email using your mail client's plain text option. You assert that >The probability of excluding an observation within each cluster was not uniform but having a different number excluded

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Chao Liu
Thank you for the reminder, Jeff. I am new to R-help and so please bear with my ignorance. This is not homework and here is a reproducible example. The number of observations per cluster doesn't follow the condition specified above though, I just used this to convey my idea. > y <- rnorm(20) >

Re: [R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Jeff Newmiller
This is R-help, not R-do-my-work-for-me. It is also not a homework help line. The Posting Guide is required reading. Assuming this is not homework, since each step in your problem definition can be mapped to a fairly basic operation in R (the sample function and indexing being key tools), you sh

[R] Help with simulation of unbalanced clustered data

2020-12-16 Thread Chao Liu
Dear R experts, I want to simulate some unbalanced clustered data. The number of clusters is 20 and the average number of observations is 30. However, I would like to create an unbalanced clustered data per cluster where there are 10% more observations than specified (i.e., 33 rather than 30). I t