[R-sig-ME] error: 'Calloc' could not allocate memory

Thierry Onkelinx thierry.onkelinx at inbo.be
Tue Sep 13 10:21:09 CEST 2016


Dear Diego,

Please keep the mailing list in cc.

You can turn off HTML posting in the settings of your mail editor.

The problem with your model is that the random slope with a factor requires
a variance-covariance matrix with the same dimension as the number of
levels of the factor. In your case this requires 3079 parameters, just for
the random effects. You would need observations for most of the species -
year combination which you clearly don't have.

So you model is too complex given the data.

Here a a few solutions.
1) use a nested random effect of species within year: ~1|YearFound/Species
2) use a nested random effect of year within species: ~1|Species/YearFound
3) use crossed random effects using lme4
lmer(Lat ~ Killed + (1 | Species) + (1| YearFound))

Another option would be to model the probability of getting killed by
latitude.

glmer(Killed ~ Lat + (1 | Species) + (1| YearFound), family = binomial)

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-09-13 10:08 GMT+02:00 Diego Pavon <diego.pavonjordan op gmail.com>:

>  Hello
>
> Thanks for the reply. First, I did not know I was posting in HTML... How
> can I do it otherwise (plain text like now)?
>
>
> So, I want to asses whether the Latitude of ring recovery is related to
> whether the bird was shot (killed) or not. I have recoveries from 1914 to
> 2014. Then I thought to use 'Year' (i.e. when the ring was recovered) as a
> random intercept and, since I am using multiple species, use 'species' as a
> random slope. The code looks like this:
>
> model1 <- lme(Lat ~ Killed, random =~ 1 + Species | YearFound, #Year =
> random intercept, Species = random slope
>               method = "REML",
>               data = Rings2)
>
> Killed has two levels (killed or not killed),
> Year has 100 levels (1913-2013) and
> species has 56 levels (56 different species included). We have selected
> species with >= 10 observations (recoveries).
>
> Or can I even do this? Would I need observations in all years?
>
> By the way, I am using RStudio Version 0.99.903 and R-64 3.2.2 on Windows
> 7 (RAM 8GB).
>
> Thanks!
>
> Diego
>
> 2016-09-13 10:36 GMT+03:00 Thierry Onkelinx <thierry.onkelinx op inbo.be>:
>
>> Dear Diego,
>>
>> Please don't post in HTML.
>>
>> Can you provide more information on the model and the data? What is the
>> formula of the model (fixed and random). Type of the variables. In case of
>> factors: the number of levels. How many observations/groups do you have?
>>
>> Best regards,
>>
>> ir. Thierry Onkelinx
>> Instituut voor natuur- en bosonderzoek / Research Institute for Nature
>> and Forest
>> team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
>> Kliniekstraat 25
>> 1070 Anderlecht
>> Belgium
>>
>> To call in the statistician after the experiment is done may be no more
>> than asking him to perform a post-mortem examination: he may be able to say
>> what the experiment died of. ~ Sir Ronald Aylmer Fisher
>> The plural of anecdote is not data. ~ Roger Brinner
>> The combination of some data and an aching desire for an answer does not
>> ensure that a reasonable answer can be extracted from a given body of data.
>> ~ John Tukey
>>
>> 2016-09-13 8:18 GMT+02:00 Diego Pavon <diego.pavonjordan op gmail.com>:
>>
>>> Dear colleagues
>>>
>>> I am handling a (relatively large) data set on ring recoveries and I want
>>> to fit a random effects model to the data using the package lme. When I
>>> run
>>> the RANDOM INTERCEPT ONLY model it runs nicely, but when I try to include
>>> also RANDOM SLOPE then I get an error message:
>>>
>>> Error in logLik.lmeStructInt(lmeSt, lmePars) :
>>>   'Calloc' could not allocate memory (2036500788 of 8 bytes)
>>>
>>>
>>> My memory is right now:
>>> > memory.size()
>>> [1] 375.64
>>> > memory.limit()
>>> [1] 3e+11
>>>
>>>
>>> I have tried to run it only with R running in the computer (plus the
>>> basic
>>> stuff that may use RAM) but still can't get the results. Any ideas how to
>>> deal with this issue?
>>>
>>> THANK YOU VERY MUCH!
>>>
>>> Di
>>>
>>>
>>>
>>> --
>>> *Diego Pavón Jordán*
>>>
>>> *Finnish Museum of Natural History*
>>> *PO BOX 17 *
>>>
>>> *Helsinki. Finland*
>>>
>>>
>>>
>>> *0445061210https://tuhat.halvi.helsinki.fi/portal/en/persons
>>> /diego-pavon-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html
>>> <https://tuhat.halvi.helsinki.fi/portal/en/persons/diego-pav
>>> on-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html>htt
>>> p://www.linkedin.com/profile/view?id=170617924&trk=nav_respo
>>> nsive_tab_profile
>>> <http://www.linkedin.com/profile/view?id=170617924&trk=nav_r
>>> esponsive_tab_profile>https://helsinki.academia.edu/DiegoPavon
>>> <https://helsinki.academia.edu/DiegoPavon>*
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-mixed-models op r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>>
>>
>
>
> --
> *Diego Pavón Jordán*
>
> *Finnish Museum of Natural History*
> *PO BOX 17 *
>
> *Helsinki. Finland*
>
>
>
> *0445061210https://tuhat.halvi.helsinki.fi/portal/en/persons/diego-pavon-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html
> <https://tuhat.halvi.helsinki.fi/portal/en/persons/diego-pavon-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html>http://www.linkedin.com/profile/view?id=170617924&trk=nav_responsive_tab_profile
> <http://www.linkedin.com/profile/view?id=170617924&trk=nav_responsive_tab_profile>https://helsinki.academia.edu/DiegoPavon
> <https://helsinki.academia.edu/DiegoPavon>*
>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list