[R] Function hatTrace in package lme4

2012-10-13 Thread ingaschwabe
Dear all, For a project I need to calculate the conditional AIC of a mixed effects model. Luckily, I found a reference in the R help forum for a function to be used: CAIC - function(model) { sigma - attr(VarCorr(model), 'sc') observed - attr(model, 'y') predicted -

Re: [R] Function hatTrace in package lme4

2012-10-18 Thread ingaschwabe
Thanks for the reply!! Inga -- View this message in context: http://r.789695.n4.nabble.com/Function-hatTrace-in-package-lme4-tp4646071p4646593.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] For loop with i and j and multiple if statements... help!

2012-10-18 Thread ingaschwabe
Dear all! I'm quite new to R and at this moment a little bit lost in trying to make a function work with a for loop that has two variables (i and j) and multiple if statements.. I hope that someone of you could help me. I would very appreciate it! What do I want to do? I am analysing the data

Re: [R] For loop with i and j and multiple if statements... help!

2012-10-18 Thread ingaschwabe
Dear all, Thanks for the many replies! Indeed, the function does not represent my explanation. It should have been: if (x[i] 170 x[i] 1250 y[j] 150 y[j] 480) Sorry, my mistake. My data looks like this: head(input[,3:4]) x y 1 701 209 2 685 209 3 566 248 4 562 234 5 601 225 6

Re: [R] For loop with i and j and multiple if statements... help!

2012-10-19 Thread ingaschwabe
Again, thank you all for the replies (and for the free R lesson!) You helped me a lot and I very appreciate it. I will work my self trough the for and apply section of my R manual again.. Thanks, Bye, inga -- View this message in context: