Dear Justus, 

A further suggestion is to use the doMC library, which allows for parallel computation (on Linux or Mac only - on Windows there may be other options, but I don't know them). On a multi-core machine, using doMC will speed up computations by how ever many cores you have available - by default, R uses only a single core. It will output the results as a list - just as in the suggestion of Drew. 
A brief example follows...

cordially, 
tim

library(doMC)
registerDoMC()
tofit <- list(
	expression(<MODEL 1>), 
	expression(<MODEL 2>), 
	expression(<MODEL 3>), 
	…
	expression(<MODEL n>)
	)

# Run this only from the command line (i.e., the terminal)!
output <- foreach(i = 1:length(tofit), .errorhandling = "pass", .verbose = T) %dopar% {eval(tofit[[i]])}
lapply(output, anova)
BICs <-unlist(lapply(output, AIC, k = log(nrow(<DATAFRAME>))))
output.best <- output[[which.min(BICs)]]




On Apr 11, 2012, at 5:56 PM, Drew Tyre wrote:

> Justus,
> 
> I don't know if anyone suggested this yet, but rather than storing each of
> your model results as a seperate object, I suggest you store them in a
> list. When model averaging, I typically create a list of the formulas I
> want to use, then use lapply() to go over the list passing each formula to
> lmer() inside a wrapper function. This results in a list of fitted model
> objects, to which you use lapply() again to extract AIC, log likelihoods,
> coefficients, whatever, as David suggests. This is very efficient, and
> we've successfully used this to fit datasets with 1000's of observations
> and a hundred models on bog-standard workstations.
> 
> On Tue, Apr 10, 2012 at 8:27 PM, Justus Deikumah <j.deikumah2@uq.edu.au>wrote:
> 
>> Thanks for your many suggestions although non of them worked for me.
>> 
>> I still need help to continue, below is a sample data
>> 
>> omnv    Sobs    ACE     Chao1   Chao2   Abund   elev    ccov    gcov
>> frt     flt     ltr     p_area  l_yr
>> 5       75      90.54   99.04   105     240     0.082257        -0.28202
>>     -0.67125        0.16311 4.654942        1.964076        0.096949
>> -0.03285
>> 8       64      68.06   67.67   70.3    260     -0.17708        1.44516
>> -1.33116        -1.14177        -0.82818        2.249209        0.096949
>>     -0.03285
>> 2       63      85.83   82.12   97.31   170     3.129431        -1.79329
>>     0.648565        -0.48933        -0.37125        -1.07972
>> 0.469158        -0.85874
>> 3       56      74.65   71.81   71.39   141     3.544365        -1.1456
>> -0.3413 -1.14177        0.085674        -0.81597        0.469158
>> -0.85874
>> 2       47      68.32   70.1 83.25 149     -0.15114        0.581573
>> 0.318611        -1.14177        -0.82818        -0.56648        -0.85981
>>     0.117315
>> 6       64      94.95   95.07   90.1    175     -0.06038        1.358802
>>     -1.0012 -1.14177        -0.82818        0.894827        -0.85981
>> 0.117315
>> 4       53      56.98   57.09   59.89   301     0.276758        -1.3615
>> 2.298332        -1.14177        -0.82818        -0.60212        -0.53266
>>     1.243534
>> 2       58      73.55   88      204.25  262     0.082257        0.927008
>>     -1.33116        -1.14177        -0.82818        0.50277 -0.53266
>> 1.243534
>> 2       53      81.77   83      103.45  216     -0.57904        0.149779
>>     0.648565        -0.48933        -0.37125        -0.99418
>> 0.026581        -0.40825
>> 2       43      67.91   64      59.43   143     -0.85134        1.013366
>>     -0.67125        -1.14177        -0.82818        0.538411
>> 0.026581        -0.40825
>> 7       50      57.11   60.11   60.63   159     -0.87728        -1.79329
>>     -0.01134        -1.14177        -0.82818        -0.74469
>> -0.9524 -2.81086
>> 2       63      71.82   71.5    79.25   204     -0.70871        1.013366
>>     -1.33116        -1.14177        -0.82818        -0.74469
>> -0.9524 -2.81086
>> 4       53      57.35   55.05   64.78   236     0.691692        -2.22509
>>     1.638425        0.16311 -0.37125        -0.95854        -0.79993
>> -0.40825
>> 2       45      54.24   51.5    50.8    134     0.925093        -1.3615
>> 0.648565        -0.48933        -0.37125        -1.17239        -0.79993
>>     -0.40825
>> 7       57      83.72   82.09   75.28   206     -0.33268        -0.28202
>>     -0.67125        0.16311 0.542601        0.894827        0.343853
>> -0.48334
>> 6       67      83.23   92.09   89.79   225     0.821359        1.44516
>> -1.33116        0.815548        -0.37125        1.82151 0.343853
>> -0.48334
>> 6       71      90.21   87.67   89.33   286     -0.22894        0.149779
>>     1.308472        -0.48933        0.085674        0.146353
>> 0.343853        -0.48334
>> 5       59      87.87   90.91   75.92   164     -0.21598        1.013366
>>     -0.01134        -1.14177        -0.82818        2.284851
>> 0.343853        -0.48334
>> 4       52      93.7    92.62   99.73   188     -0.83838        0.149779
>>     0.648565        -0.48933        -0.37125        -0.74469
>> -0.74253        1.243534
>> 2       47      50.72   50.12   49.5    80      -0.74761        0.322496
>>     0.252621        -0.48933        -0.37125        -0.28135
>> -0.74253        1.243534
>> 5       61      73.48   71      72.25   194     -0.47531        0.149779
>>     0.648565        -1.14177        -0.82818        -0.78033
>> -0.1623 1.243534
>> 4       61      111.3   110.58  127.35  223     -0.76058        1.013366
>>     -0.67125        -0.48933        -0.82818        -0.03185
>> -0.1623 1.243534
>> 4       58      89.49   89.33   100.69  130     0.043357        -0.49791
>>     0.318611        -0.48933        0.085674        -0.35263
>> -0.32217        -0.33317
>> 5       69      102.95  107.15  123.17  184     0.173024        0.365676
>>     -1.33116        -0.48933        0.085674        0.217637
>> -0.32217        -0.33317
>> 4       74      136.29  138.65  199     183     -0.31971        -0.49791
>>     -0.67125        0.16311 -0.37125        -0.60212        2.325264
>> 0.868128
>> 4       57      69.74   70.88   87.38   289     -0.70871        0.581573
>>     -1.33116        -1.14177        -0.82818        0.467128
>> 2.325264        0.868128
>> 6       61      69.47   73      92.25   400     -0.83838        -0.49791
>>     0.318611        0.815548        -0.37125        -0.88725
>> 2.325264        0.868128
>> 7       59      78.1    82.1    89.09   375     -0.94211        -0.06612
>>     -0.01134        -0.48933        -0.82818        1.037394
>> 2.325264        0.868128
>> 3       67      94.59   89.56   96.29   232     -0.13818        -0.28202
>>     -0.01134        -1.14177        0.085674        -0.78033
>> -0.8166 0.042233
>> 3       47      57.6    54      53.71   122     0.341591        0.581573
>>     -1.33116        -1.14177        -0.82818        0.110712
>> -0.8166 0.042233
>> 4       62      88.77   85.4    106.11  171     -0.03444        -1.3615
>> 2.298332        0.16311 -0.37125        -0.53084        -0.74253
>> 0.192396
>> 1       55      80.66   76.23   80.89   162     -0.12521        0.79747
>> 0.318611        0.16311 -0.82818        -0.45955        -0.74253
>> 0.192396
>> 5       75      90.54   99.04   105     240     0.082257        0.581573
>>     -0.67125        2.120424        2.370308        1.964076
>> 0.096949        -0.03285
>> 8       64      68.06   67.67   70.3    260     -0.17708        1.013366
>>     -1.0012 2.120424        0.999527        2.249209        0.096949
>> -0.03285
>> 2       63      85.83   82.12   97.31   170     3.129431        -1.79329
>>     1.968379        0.16311 -0.37125        -1.07972        0.469158
>> -0.85874
>> 
>> 
>> headings in red are all resposes, a sample output is also showm below for
>> the 126th model
>>> m126
>> Linear mixed model fit by REML
>> Formula: fvt ~ elev + ccov + frst + crpl + mtx + site + (1 | patch) +
>> (frst | mtx) + (frst | site)
>>  Data: var2
>>  AIC   BIC logLik deviance REMLdev
>> 336.4 368.8 -153.2    315.4   306.4
>> Random effects:
>> Groups   Name        Variance   Std.Dev.   Corr
>> patch    (Intercept) 0.0000e+00 0.0000e+00
>> site     (Intercept) 6.7195e-01 8.1972e-01
>>         frst        2.0813e+00 1.4427e+00 0.000
>> mtx      (Intercept) 6.7195e-01 8.1972e-01
>>         frst        6.1916e-13 7.8687e-07 -1.000
>> Residual             8.0639e+00 2.8397e+00
>> Number of obs: 64, groups: patch, 16; site, 2; mtx, 2
>> Fixed effects:
>>           Estimate Std. Error t value
>> (Intercept) 13.54988    3.32972   4.069
>> elev        -0.18927    0.43400  -0.436
>> ccov         0.02083    0.54921   0.038
>> frst        -1.23953    1.31890  -0.940
>> crpl        -1.15140    0.37938  -3.035
>> mtx         -1.05470    1.38819  -0.760
>> site        -4.54585    1.62218  -2.802
>> Correlation of Fixed Effects:
>>    (Intr) elev   ccov   frst   crpl   mtx
>> elev  0.202
>> ccov  0.369  0.486
>> frst -0.052  0.149 -0.030
>> crpl -0.131 -0.023 -0.105 -0.092
>> mtx  -0.640 -0.103 -0.046 -0.072  0.047
>> site -0.712 -0.155 -0.455  0.189  0.121 -0.007
>> Now,
>> for each of the 126 models for this particular response (species richness
>> of forest visitors(fvt), I want to write a code that will extract the
>> following as textfile. I will then call this from a model averaging
>> template in excel for averaging and ranking of my explanatory variables.
>> SD for randome effects/intercepts
>> Parameter Estimates for fixed effects
>> SE for fixed effects /intercepts and the
>> AICs
>> 
>> My initial questions was to run all models in a loop and extract the
>> details above but its not working.
>> Can someone hear me?? I can extract these model by model but it is
>> inefficient and time consuming.
>> Thanks
>> 
>> 
>> 
>> Deikumah Justus
>> PhD Candidate (Confirmed) - Landscape Ecology & Conservation
>> Landscape Ecology and Conservation Group
>> School of Geography, Planning and Environmental Management
>> The University of Queensland
>> Brisbane Qld 4072
>> Australia
>> 
>> Chamberlain Building (35)
>> Campbell Rd - St Lucia Campus
>> 
>> W: http://www.gpem.uq.edu.au/cser-jdeikumah
>> E: j.deikumah2@uq.edu.au
>> M: +61 424481796, +61 479094200
>> If you don't like something, Change it. If you can't change it, change
>> your Attitude. DON'T COMPLAIN (Maya Angelou)
>> 
>>       [[alternative HTML version deleted]]
>> 
>> _______________________________________________
>> R-sig-mixed-models@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> 
> 
> 
> 
> -- 
> Drew Tyre
> 
> School of Natural Resources
> University of Nebraska-Lincoln
> 416 Hardin Hall, East Campus
> 3310 Holdrege Street
> Lincoln, NE 68583-0974
> 
> phone: +1 402 472 4054
> fax: +1 402 472 2946
> email: atyre2@unl.edu
> http://snr.unl.edu/tyre
> http://aminpractice.blogspot.com
> http://www.flickr.com/photos/atiretoo
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

______________________
C. E. Timothy Paine
Institut für Evolutionsbiologie und Umweltwissenschaften
Universität Zürich
Winterthurerstrasse 190
CH-8057 Zürich Switzerland
timothy.paine@ieu.uzh.ch
office: ++41 (0)44 635 47 40

skype: cetimothypaine
manuplants.org/paine









	[[alternative HTML version deleted]]

