[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-mixed-models
Subject:    Re: [R-sig-ME] Error in logLik.reStruct(object, conLin) : NA/NaN/Inf in foreign function call (arg 3
From:       Ben Bolker <bbolker () gmail ! com>
Date:       2022-04-19 15:43:19
Message-ID: 1c116634-7d2a-9575-55a1-def36b39e790 () gmail ! com
[Download RAW message or body]

   PS can you perhaps find a subset of women for which it *breaks*? e.g. 
by bisection:

   * run the model on the first half of the data (the first 5834 women)
   * run the model on the second half of the data

   see if either half gives the error.  If so, subdivide the 'bad' half 
of the data and continue ...

On 4/19/22 9:54 AM, Esan, Oluwaseun wrote:
> Dear List Members,
> 
> I am relatively new to R and Mixed Effects Models using LME.
> 
> I am unable to post sample data:
> 
> 
> I am trying to get the effect of pregnancy on lung function  and age on women with \
> a certain genetic condition. We know lung function declines with age in people with \
> the condition but we do not know the effect pregnancy has on this relationship. 
> I have repeat measurements of lung function measured up to 4 times in a year for up \
> to 14 years for each woman (A total of 331,722 observations for 11668 women). 
> I am having problems when trying to add an exponential serial correlation to a \
> validated model. 
> library(nlme)
> 
> covariate 1= age
> M1<-lme(lung function~age +covariate1+covariate2+covariate3+ timesincepregnancy \
> ,data=df5,random=~1+age|id, na.action=na.exclude, method ="ML", \
> control=lmeControl(opt='optim'), corr=corExp(form=~age|id, nugget=T)) 
> The following error occurs:
> 
> Error in logLik.reStruct(object, conLin) :
> NA/NaN/Inf in foreign function call (arg 3)
> 
> When I run it on random sample of 40 women it runs without an error. Is there any \
> further processing I need to do on the data? I have already removed duplicates. 
> Previous studies have shown exponential correlation structure is the best fit for \
> the data but I cannot seem to get this to work on the dataset I have. 
> All the best,
> Seun
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics

_______________________________________________
R-sig-mixed-models@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic