Re: [R] How to create list of objects?
Thanks everybody - it's working Rainer Dimitris Rizopoulos wrote: try something like: lapply(f, summary) sapply(f, function(x) AIC(logLik(x))) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Rainer M Krug [EMAIL PROTECTED] To: R help list r-help@stat.math.ethz.ch Sent: Tuesday, June 06, 2006 4:38 PM Subject: [R] How to create list of objects? Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f - list() f$IP - mle(...) f$NE - mle(...) but when I say: summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from summary(f$IP) summary(f$IP) Maximum likelihood estimation Call: mle(minuslogl = IPNeglogPoisL, method = L-BFGS-B, fixed = list(), control = list(maxit = 1e+08, factr = 1e-20)) Coefficients: Estimate Std. Error a 1242.0185506 44.92341097 b0.8802538 0.01685811 -2 log L: 145.3509 What I want to do is something like: AICs - AIC(logLik(f)) and then have all the AICs in the vector AICs. It must be possible or is this again a namespace issue? Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa Tel:+27 - (0)72 808 2975 (w) Fax:+27 - (0)21 808 3304 Cell: +27 - (0)83 9479 042 email: [EMAIL PROTECTED] [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How to create list of objects?
Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f - list() f$IP - mle(...) f$NE - mle(...) but when I say: summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from summary(f$IP) summary(f$IP) Maximum likelihood estimation Call: mle(minuslogl = IPNeglogPoisL, method = L-BFGS-B, fixed = list(), control = list(maxit = 1e+08, factr = 1e-20)) Coefficients: Estimate Std. Error a 1242.0185506 44.92341097 b0.8802538 0.01685811 -2 log L: 145.3509 What I want to do is something like: AICs - AIC(logLik(f)) and then have all the AICs in the vector AICs. It must be possible or is this again a namespace issue? Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to create list of objects?
lapply(f, summary) sapply(f, AIC) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr --- Rainer M Krug a écrit : Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f - list() f$IP - mle(...) f$NE - mle(...) but when I say: summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from summary(f$IP) summary(f$IP) Maximum likelihood estimation Call: mle(minuslogl = IPNeglogPoisL, method = L-BFGS-B, fixed = list(), control = list(maxit = 1e+08, factr = 1e-20)) Coefficients: Estimate Std. Error a 1242.0185506 44.92341097 b0.8802538 0.01685811 -2 log L: 145.3509 What I want to do is something like: AICs - AIC(logLik(f)) and then have all the AICs in the vector AICs. It must be possible or is this again a namespace issue? Rainer __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to create list of objects?
try something like: lapply(f, summary) sapply(f, function(x) AIC(logLik(x))) Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Rainer M Krug [EMAIL PROTECTED] To: R help list r-help@stat.math.ethz.ch Sent: Tuesday, June 06, 2006 4:38 PM Subject: [R] How to create list of objects? Hi I am doing several mle and want to store them in a list (or whatever is the right construct) to be able to analyse them later. at the moment I am doing: f - list() f$IP - mle(...) f$NE - mle(...) but when I say: summary(f) I get: Length Class Mode IP 0 mle list NE 0 mle list I don't get the output I would have, i.e. the one from summary(f$IP) summary(f$IP) Maximum likelihood estimation Call: mle(minuslogl = IPNeglogPoisL, method = L-BFGS-B, fixed = list(), control = list(maxit = 1e+08, factr = 1e-20)) Coefficients: Estimate Std. Error a 1242.0185506 44.92341097 b0.8802538 0.01685811 -2 log L: 145.3509 What I want to do is something like: AICs - AIC(logLik(f)) and then have all the AICs in the vector AICs. It must be possible or is this again a namespace issue? Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html