Re: [R] lme cant get parameter estimated correctly

2008-04-06 Thread toby909
Bill.Venables at csiro.au writes: Here is a demo you may like to consider. (I can see what you are trying to do with your loops, but I prefer to do it this way.) This is just for pedagogical purpose, so I like to keep the simple-minded 'for' loop. But what I really wonder is why do I not

[R] lme cant get parameter estimated correctly

2008-04-05 Thread toby909
I am caught in a mental trap. Why isn't the between groups variance estimated (0.0038) to be around the value with which I generated the data (0.0002)? Thanks Toby set.seed(76589437887) fph = 0.4 Sigh = sqrt(0.0002) Sigi = sqrt(0.04) ci = 1 fpi = matrix(,7200,3) for (i in 1:90) { fph =

[R] stats/debugging question hotelling t-sq

2008-03-16 Thread toby909
Hi I spent hours looking over my formula. Somehow I cant find the reason why it gives me different answer. help appreciated. x = as.matrix(read.table(http://www.niehs.nih.gov/research/atniehs/core/microarrays/docs/heinloth.txt,1)) x = t(x)#now rows are subjects, cols are genes x =

Re: [R] lm design matrix bug?

2007-10-29 Thread toby909
uups, ok, I see, thanks Tim Calkins wrote: check the dimensions of your X and P matrices: dim(X) [1] 21 9 dim(P) [1] 9 21 what you see is that the final row is *named* 26. It's actually row 21. cheers, On 10/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All Maybe I dont

[R] lm design matrix bug?

2007-10-28 Thread toby909
Hi All Maybe I dont understand it, but I would have expected that the design matrix has as many rows as there were observations available to fit the model. Below a small artificial dataset created, then one model fitted and the design matrix outputted, having 27 rows. Then I delete 6 obs, and

[R] bugs() ignores my inits

2007-10-26 Thread toby909
Hi All I can specify whatever inits, it has no effect on the estimation. I am replicating a textbook example. The result is completely trash, having estimates of -58.7 (sd=59.3), where it should be closer to an ml estimate of 0.585 (SE=0.063). The two chains within one run are different, but

Re: [R] Error bars using data from bugs()

2007-10-26 Thread toby909
only one out of many many dt = cbind(sim$mean$u2+sim$mean$beta1,sim$sd$u2) dt = dt[order(dt[,1]),] bounds = cbind(c(dt[,1]-1.96*dt[,2],dt[,1]+1.96*dt[,2],dt[,1]),rep(1:length(sim$mean$u2),3)) bounds = bounds[order(bounds[,2]),] plot(bounds) T Matthew Krachey wrote: I'm trying to compare the