Skip to content

lqmm - package: Error in f(arg, …) : NA/NaN/Inf in foreign function call (arg 1)

3 messages · florian k., Ben Bolker

#
Dear mailing list,

After some requests I finally managed to make my error reproducible -
please find the dataset here:

https://dl.dropboxusercontent.com/u/79415744/mixedModelDataSet.txt

require("lqmm")

stackoverflow <- read.table("mixedModelDataSet.txt",  sep="\t", header
= TRUE ) # import

mixMoGs15 <- lqmm(gsDeviationMio ~ aoi, random =  ~ 1, group = vpName,
data = stackoverflow, tau = 0.15)

Thanks in advance for your help,
Best,
Florian
On Sat, Aug 16, 2014 at 5:57 PM, florian k. <zournyque at gmail.com> wrote:
#
I did some poking around and couldn't figure it out -- it fails fairly deep
inside the function (options(error=recover) is useful ...).  I would ask
the maintainer (see maintainer("lqmm")).

  However, I wonder why you're pulling out these big guns for this
problem.  With only 4 random effects groups, you won't get much shrinkage,
and with so many data points all comparisons will probably be statistically
significant.  Why not just compute the quantiles you're interested in
across groups?


require("lqmm")
stackoverflow <- read.table("mixedModelDataSet.txt",
                            sep="\t", header = TRUE ) # import

so2 <- stackoverflow[complete.cases(stackoverflow),]
mixMoGs15 <- lqmm(gsDeviationMio ~ aoi, random =  ~ 1, group = vpName,
                  data = so2, tau = 0.15)

library(ggplot2); theme_set(theme_bw())
ggplot(so2,aes(x=aoi,y=gsDeviationMio,colour=vpName))+geom_point()
ggplot(so2,aes(x=aoi,y=gsDeviationMio,colour=vpName))+geom_boxplot()
ggplot(so2,aes(x=aoi,y=gsDeviationMio,colour=vpName,fill=vpName))+
    geom_violin()
with(so2,tapply(gsDeviationMio,list(vpName,aoi),quantile,0.15))
with(so2,table(vpName,aoi))
On Sat, Aug 16, 2014 at 9:02 AM, florian k. <zournyque at gmail.com> wrote:

            

  
  
#
Hi Ben,

thank you for your time and effort, I will contact the project
maintainer as you suggested. I provided only a simplified version of
my model and dataset to reproduce the error. My original model has
twenty variables and the dataset has 42 subjects with around 400k
observations.

The plots you created look beautiful but I am not sure whether I
understand your code completely. Especially those two lines:
with(so2,tapply(gsDeviationMio,list(vpName,aoi),quantile,0.15))
with(so2,table(vpName,aoi))

However I think they will be hard to absorb when I do the same
procedure for all of my 42 test subjects. So here is some background
information:

Being a psychology student and still a novice to R and statistics in
general, I am not even sure whether the "big gun" is the right method
here. So here is some context. The data was obtained in a flight
simulator. The gsDeviationMio variable is a measurement for how far a
pilot deviates from his original landing course. 0 is no deviation, so
perfect landing course - higher or lower numbers indicate deviation. I
multiplied all values with 1 million as the values usually oscillate
between 0 and 1 and I had some issues with rounding going on when
calculating quantile regressions. Now I want to investigate the
relationship between a pilot's eye movements and the flying
performance. Variable Aoi are areas of interest so in other words
where the pilot is looking at.

First I calculated linear models and quantile regressions for RMSD
course deviations, now I want to investigate single observations.
Therefore I learned I need to delve into mixed models. I soon
calculated my first linear mixed model. (I guess I should apply a
transformation here, so how about square rooting everything to get rid
of the negative values of gsDeviationMio?).

The problem is theoretically average flight performance is not that
interesting, I am much more interested in predictors for either very
good or very bad flight performance. Therefore I wanted to use lqmm. I
hope this makes sense?

Hope you have a nice Sunday,
Florian
On Sun, Aug 17, 2014 at 12:45 AM, Ben Bolker <bbolker at gmail.com> wrote: