[R] About nlminb function

2012-07-04 Thread Freddy Hernández
Hello I want to use the nlminb function but I have the objective function like characters. I can summarize the problem using the first example in the nlminb documentation. x <- rnbinom(100, mu = 10, size = 10) hdev <- function(par) -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE)) nlminb

[R] A question about loglik in GLMM

2012-03-15 Thread Freddy Hernández
Hi All, I am using the glmer function to adjust a simple model (mod1) with Poisson response variable and random intercept. When I use logLik(mod1) I obtain a value different from if I calculate the log-likelihood using the pdf. Someone could explain if I have an error? This is the code for the

[R] Converting a function from Splus to R

2012-02-29 Thread Freddy Hernández
I have a function written for Splus, when I run it in R I obtain get an error because the function has the elements "0.d0" and "2.d0". How can I change it to run in R? The function can be found in page 230 from http://www.stat.wisc.edu/~mchung/teaching/stat471/stat_computing.pdf Function is as f