[R] Maximum log likelihood estimates of the parameters of a nonlinear model.
Dear all, Is it possible to generate AIC or something equivalent for nonlinear model estimated based on maximum log likelihood l in R? I used nls based on least squares to estimate, and therefore I cannot assess the quality of models with AIC. nlme seems good for only mixed models and mine is not mixed models. res - nls(y ~ d*(x)^3+a*(x)^2+b*x+c, start=list(a=2, b=1,c=1,d=1), data=d) If anybody does know a R-function to estimate nonlinear model based on maximum log likelihood, please let me know. Thanks for your help in advance! Odette __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package installation failed
Dear Uwe and folks, I had connections to CRAN daily and won't have problems for most packages, but only some does. Installed directory is: C:\Documents and Settings\R\library\downloaded_packages I do not have set library path except the R default. I tried to download lme4 and packages that unable to install, but still same error message came up. error in normalizePath(path) : path[1]: no such file to load Any help would be greatly appreciated. Odette On Fri, Jan 23, 2009 at 7:15 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Odette Gaston wrote: Hi Uwe and all, Error message was: error in normalizePath(path) : path[1]: no such file to load Hmmm, what does traceback() tell you at that point? Have you had a cionnection to CRAN and has something been downloaded? If so, to which directory? Where is R installed? Do you have set some library path other than the R default? Uwe Ligges Many thanks, Odette On Fri, Jan 23, 2009 at 1:22 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Odette Gaston wrote: Hi folks, I am currently having the problem with using R 2.8.1 that I cannot install some of packages from CRAN or local drive and somebody may be able to help me. ex) faraway package and lme4 package. I have downloaded them in my hard drive as local, but still R was unable to find the package (message showed up as no such file). I could download most packages, but not all what I want. I showed my PC to R experts around and nobody had ideas. I've re-installed newest R and updated packages hundred times, but still same message came up. So, what is the error message when you try, e.g. install.packages(lme4) ? Uwe Ligges My working environment is: OS: XP Windows R2.8.1 Any suggestions would be appreciated. Thanks a lot, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Package installation failed
Hi folks, I am currently having the problem with using R 2.8.1 that I cannot install some of packages from CRAN or local drive and somebody may be able to help me. ex) faraway package and lme4 package. I have downloaded them in my hard drive as local, but still R was unable to find the package (message showed up as no such file). I could download most packages, but not all what I want. I showed my PC to R experts around and nobody had ideas. I've re-installed newest R and updated packages hundred times, but still same message came up. My working environment is: OS: XP Windows R2.8.1 Any suggestions would be appreciated. Thanks a lot, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package installation failed
Hi Uwe and all, Error message was: error in normalizePath(path) : path[1]: no such file to load Many thanks, Odette On Fri, Jan 23, 2009 at 1:22 AM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Odette Gaston wrote: Hi folks, I am currently having the problem with using R 2.8.1 that I cannot install some of packages from CRAN or local drive and somebody may be able to help me. ex) faraway package and lme4 package. I have downloaded them in my hard drive as local, but still R was unable to find the package (message showed up as no such file). I could download most packages, but not all what I want. I showed my PC to R experts around and nobody had ideas. I've re-installed newest R and updated packages hundred times, but still same message came up. So, what is the error message when you try, e.g. install.packages(lme4) ? Uwe Ligges My working environment is: OS: XP Windows R2.8.1 Any suggestions would be appreciated. Thanks a lot, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Class and object problem
Dear all, I have a problem with accessing class attributes. I was unable to solve this yet, but someone may know how to solve it. I'm trying to extract some information from the summary, and Akaike weight has the desired value. Object for a model fitted using the glmmML function from the glmmML package: result - glmmML(cbind (y, n-y)~ x+a+b+c, family = binomial, data, cluster) library(MASS) stepAIC(result) Then calculated the delta AIC by hand (following is the best four). model1 - 0.0 model2 - 1.8 model3 - 4.2 model4 - 6.2 Then followed equation as below: *W - exp(-0.5 * Delta) / sum(exp(-0.5 * Delta))* However, result was always same value as [1] even each delta AIC is different values. I don't know why happened. I've also tried Ben's AIC tab in the bbmle package under the Ben's suggestion: summary - stepAIC(result) AICtab(summary) When I try to run the code from within a package, error came up as UseMethod(logLik) no method to use logLik. I've tried adding slot -summary (result) slotName (slot) but it didn't help, slotName is NULL. Thanks for any kind of suggestions! Odette r-help@r-project.org [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Akaike weight in R
Hi Graham, Appreciate for your help, but actually I've already looked at this website, and wasn't success yet. 1st, I cannot run *W = exp(-0.5 * Delta) / sum(exp(-0.5 * Delta))* in the R. *W - exp(-0.5 * Delta) / sum(exp(-0.5 * Delta))* *note: Delta means AIC difference between models.* ** I don't know why but always showing 1 even I changed Delta. Also, I couldn't find OAD package, where can I get one? Would be wonderfully appreciated. Thanks in advance, Odette On Fri, Dec 19, 2008 at 8:33 PM, Graham Smith myotis...@gmail.com wrote: Odette Wondering how can I generate Akaike weight with R? I know the description, but is there any function to generate by R on the web-site or R library? I am using GLM or GLMM (family=binomial), so would be appreciated if you help me. You could have a look at this. http://bm2.genes.nig.ac.jp/RGM2/R_current/library/aod/man/summary.aic.html Which is in the OAD package Graham [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Akaike weight in R
Hi folks, Wondering how can I generate Akaike weight with R? I know the description, but is there any function to generate by R on the web-site or R library? I am using GLM or GLMM (family=binomial), so would be appreciated if you help me. Thanks for your contributions in advance, Regards, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] generate random number
Hi Dimitris, Appreciate for your reply with detailed information, many thanks! I realize that generating random number won't be so simple more than I expected, but got some hints from the advice. I am actually hoping to do a parametric bootstrap likelihood test, because this is the way of testing for glmm result what I understood. Following is what I would like to do: # settings n - number of samples y - c(2 2 1 0 0 2 0 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 0 2 0 2 2) x - c(22 22 24 21 26 18 23 21 17 15 22 24 21 17 26 15 16 13 22 15 15 23 16 23 18 37 22 30) #dependent=y #independent=x Then, I would like to generate random number on glmm = random.y - rbinom (num,n,p) to do this test. However, this only hypothesized binomial distribution, not include normal one. In this case, how would you be able to do? Apologize if I didn't understand correctly what you wrote and make confuse you. Greatly appreciated if you help me. Any advice would be wonderful! Best reagards, Odette On Thu, Nov 20, 2008 at 8:24 PM, Dimitris Rizopoulos [EMAIL PROTECTED] wrote: check the following code: # settings n - 100 # number of sample units p - 10 # number of repeated measurements N - n * p # total number of measurements t.max - 3 # parameter values betas - c(0.5, 0.4, -0.5, -0.8) # fixed effects (check also 'X' below) sigma.b - 2 # random effects variance # id, treatment time id - rep(1:n, each = p) treat - rep(0:1, each = n/2) time - seq(0, t.max, length.out = p) # simulate random effects b - rnorm(n, sd = sigma.b) # simulate longitudinal process conditionally on random effects time.rep - rep(time, n) treat.rep - rep(treat, each = p) X - cbind(1, treat.rep, time.rep, treat.rep * time.rep) # fixed effects design matrix muY - plogis(c(X %*% betas) + b[id]) # conditional probabilities y - rbinom(N, 1, muY) # simulate binary responses # put the simulated data in a data.frame simulData - data.frame( id = id, y = y, treat = treat.rep, time = time.rep ) # fit the model library(glmmML) fit - glmmML(y ~ treat * time, data = simulData, cluster = id) summary(fit) I hope it helps. Best, Dimitris Odette Gaston wrote: Hi everybody, I am currently working on glmmML() and wish to generate random number to do some tests, however, glmm was hypothesized the mixed distributions with normal and binomial in terms of having a random effect. How would you be able to generate random number in this case? Is there a function in R to generate random number of mixed distribution (normal+binomial)? Any comments would be appreciated. Many thanks, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] generate random number
Hi everybody, I am currently working on glmmML() and wish to generate random number to do some tests, however, glmm was hypothesized the mixed distributions with normal and binomial in terms of having a random effect. How would you be able to generate random number in this case? Is there a function in R to generate random number of mixed distribution (normal+binomial)? Any comments would be appreciated. Many thanks, Odette [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.