Re: [R] Convergence in Monte Carlo Simulation

2020-06-14 Thread Michael Dewey
Dear Edward Every time you call your function powercrosssw() it resets the seed so you must be calling it multiple times in some way. Michael On 14/06/2020 13:57, Phat Chau wrote: Thank you Michael. I will clarify some more. The function in the first part of the code that I posted

Re: [R] Convergence in Monte Carlo Simulation

2020-06-14 Thread Phat Chau
Thank you Michael. I will clarify some more. The function in the first part of the code that I posted generates the simulated dataset for a cluster randomized trial from the simstudy package. I am not quite clear what you mean by placing it outside the loop. So the goal here is to create n

[R] R 4.0.1 built with Intel Composer 19.1.1, error in R CMD make check on CentOS 7.7

2020-06-14 Thread Ryan Novosielski
Hi there, Built R 4.0.1 with the Intel Composer 19.1.1. Build seems to go fine. I built it like this: module purge module load intel/19.1.1 module list export CC=icc export CXX=icpc export F77=ifort export FC=ifort export AR=xiar export LD=xild export CFLAGS="-O3 -ipo -qopenmp

Re: [R] Convergence in Monte Carlo Simulation

2020-06-14 Thread Michael Dewey
I am not 100% clear what your code is doing as it gets a bit wangled as you posted in HTML but here are a couple of thoughts. You need to set the seed outside any loops so it happens once and for all. I would test after trycatch and keep a separate count of failures and successes as the

Re: [R] Help with a (g)lmer code

2020-06-14 Thread Jim Lemon
Hi Saudi, Apologies for the delay. (also returning to the list) In your initial code: model1<- lmer (better ~ gender + age + education + WF + (1 | part), > data=sub_data) you have age as a fixed effect and there are also 36 levels. This probably causing the error you describe above and I have

Re: [R] Convergence in Monte Carlo Simulation

2020-06-14 Thread Phat Chau
Hello, I put together the following code and am curious about its correctness. My first question relates to the Monte Carlo simulations – the goal is to continue to iterate until I get n = 1000 simulations where the model successfully converges. I am wondering if I coded it correctly below