Open biocsmith opened 2 years ago
I came across the same error today. According to the Change Log of nlme and #17880 they check the offset term and threw an error at the latest version. I think NBZIMM can figure out this BUG if they ignore the offset term when pass formula to nlme.
Temporarily, I suggest to re-install an old version of nlme:
remotes::install_version("nlme", version = "3.1.152", repos = "http://cran.us.r-project.org")
Thanks! I will try that!
Edit: Unfortunately , ran the code to install an older version of nlme and am still running into that error.
I came across the same error today. According to the Change Log of nlme and #17880 they check the offset term and threw an error at the latest version. I think NBZIMM can figure out this BUG if they ignore the offset term when pass formula to nlme. Temporarily, I suggest to re-install an old version of nlme:
remotes::install_version("nlme", version = "3.1.152", repos = "http://cran.us.r-project.org")
Thanks - ran into the same issue and this workaround worked for me after restarting R.
Can someone help me out with this error? I tried installing the older version as recommended in this thread, but I get this error instead:
`Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/nlme/nlme_3.1-152.tar.gz
Any help would be greatly appreciated.
If you still care, follow the instructions here to install gfortran on your system.
has anybody been able to figure out a workaround for this? Still getting error messages when trying to install an archived version of nlme
. I've installed gfortran and all but still get error messages
I think MRAN is still supported for now (until 1 July 2023), so you could try the snapshot
package to install the older version ... However, you should be aware that this is actually flagging a bug in the package: offsets are silently ignored by nlme in earlier versions!! I would be interested in hearing from the package maintainers whether I'm wrong/this is a problem that can be ignored, or whether the package needs to be adjusted somehow.
To go into a little bit more detail:
IIRC this package uses glmmPQL
from MASS
, which in turn calls lme
with a set of weights that incorporates the expected mean-variance relationship of the response. In general people don't implement offsets for linear models because in this case it's just as easy to subtract the offset from the response variable, i.e y - v ~ 1 + x
rather than y ~ 1 + x + offset(v)
. This doesn't work for GLMs, which is why the machinery of offsets exists in the first place. It might be possible to implement the equivalent of offsets in this case by modifying the response variable, but I really don't know.
I'm running this model for mms:
`N <- metadf[, "sampling_depth"] Pigment <- metadf$pigment tank <- metadf$tank
f_zinb <- mms(y = otu_t, fixed = ~ Pigment + offset(log(N)), random =~ 1 | tank, data = metadf, min.p = 0.2, method = "zinb", zi_fixed = ~1, zi_random = NULL)`
and getting this error
y1 error: offset() terms are not supported
and the model fails. When I was running this last month, I was not getting this error.Is
stats::offset(log(N))
and appropriate work around? After extracted the estimates and pvalues withfixed(f_zinb)$dist
this causes one of the variables to bestats::offset(log(N))
and I'm not sure if this was in results previously.