search for: simu1

Displaying 6 results from an estimated 6 matches for "simu1".

Did you mean: simul
2003 Mar 05
3
reading in tab delimited data in a loop
Dear all, I need to read in 4 sets of tab delimited data in a loop. The 4 data sets are called "simu1.dat", "simu2.dat" and so on. I know what I need on the righthand side of the read.table expression but I can't the left hand side of it to work (see the line in bold below). Can you kindly help? Many thanks. simu1 <- matrix(0,30,3) simu2 <- matrix(0,30,3) simu3 <- matr...
2004 Aug 09
0
Need help on this problem!
...I don't get a reply. I really want to solve this problem, so I post it again... I am trying to use R to fit some mixed-effects models for a nested data. The data is a simulated data with 111 subjects. Each subject has 6 waves' data. Below are the first two subjects' data : > simu1[1:12,] Grouped Data: gf ~ age | id id occasion age gf tau b0 b1 b2 1 1 1 4.056714 35.08943 14.8 14.502078 5.209333 -5.199452 2 1 2 14.056714 87.18276 14.8 14.502078 5.209333 -5.199452 3 1 3 29.056714 91.19566 14.8 14.502078...
2004 Jul 30
0
a question about nlme
...and compare the results with the true values. The equations of the models are as below: gf[ij]=b0[i]+b1[i]*age[ij]+b2[i]*max(0,(age[ij]-tau[i]))+e[ij] b0[i]=b00+e[i0] b1[i]=b10+e[i1] b2[i]=b20+e[i2] tau[i]=tau+e[i3] i: 1,2,...,111 subjects j: 1,2,...,6 occasions The main scripts of R is: > simu1<-groupedData(gf~age|id,data=simu1) #fitting a linear mixed-effects model is ok > mm.lme.1<-lme(gf~age,random=~age|id,data=simu1) #but when I fit a nonlinear mixed-effects model, it shows an error as below > simu.nlme<-nlme(gf~b0 + b1 * age + b2 * max(0,(age-tau)),data=simu1,fixed=b0...
2004 Jul 28
1
a question about using nlme
...g Splus to run a multiphase mixed-effects model. The quations of the models are as below: gf[ij]=b0[i]+b1[i]*age[ij]+b2[i]*max(0,(age[ij]-tau[i]))^2+e[ij] b0[i]=b00+e[i0] b1[i]=b10+e[i1] b2[i]=b20+e[i2] tau[i]=tau+e[i3] i: 1,2,...,100 subjects j: 1,2,...,6 occasions The main scripts of Splus is: simu1<-groupedData(gf~age|id) simu.nlme<-nlme(gf~(b0 + b1 * age + b2 * max(0,(age-tau))^2),data=simu1,fixed=list(b0~1,b1~1,b2~1,tau~1), + random=list(b0~1,b1~1,b2~1,tau~1),start=c(b0=4,b1=5.32,b2=-5.29,tau=14.8)) But it seems like that there are some errors in it. Error in .C("mixed_EM&quo...
2010 Apr 13
0
Error using reshape method
....3,.2) replis<- 3 stdev<-c(1,2,5,10) #1st set corrmat <- matrix(1, dims, dims) corrmat[upper.tri(corrmat)]<-co selectlow <- lower.tri(corrmat) corrmat[selectlow] <- t(corrmat)[selectlow] sigma<- diag(stdev) %*% corrmat %*% diag(stdev) simu1<-rmnorm(n=ss, Sigma=sigma, mu=mu, d=dims, rho=co) simu11<-cbind(simu1,data.grp=1) #2nd set corrmat2 <- matrix(1, dims, dims) corrmat2[upper.tri(corrmat2)]<-co selectlow2 <- lower.tri(corrmat2) corrmat2[selectlow2] <- t(corrmat2)[selectlow2]...
2001 Apr 09
4
fastest R platform
....fixed > 4 ) x[, , 5:n.fixed] <- rnorm( m*n*(n.fixed-4) ); z <- x[, , 1:2]; for(i in 1:50) { y <- glmm.sample.y(x, z, b, D.u); obj <- mle.b.D.u(b, D.u, y, x, z); print("mle"); print(obj$D.u); write(obj$D.u, file = "simu1.dat", append=T); obj <- REML.b.D.u(b, D.u, y, x, z); print("REML"); print(obj$D.u); write(obj$D.u, file = "simu2.dat", append=T); } } ################################################### #global variable m, n, n.fixed, n.rand...