0

I wanted to build a model of nonlinear mixed effects, but after the code was written, there was no way to get the results, and it was always wrong. I don't know what's wrong. Can someone help me?

Just like this:

model2<-gamm(feno~s(lag0pm2.5,k=3),random=list(id=~1),data=data)

Error in gamm(feno ~ s(lag0pm2.5, k = 3), random = list(id = ~1), data = data) :

Not enough (non-NA) data to do anything meaningful rsquared(model)

  Response   family     link method  Marginal Conditional
1     fev1 gaussian identity   none 0.1043005   0.9087206
> AIC(model)
[1] -264.2586
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Welcome to Stack Overflow! Please take the [tour](https://stackoverflow.com/tour) and read through the [help center](http://stackoverflow.com/help), in particular [how to ask](https://stackoverflow.com/help/how-to-ask). Your best bet here is to do your research, search for related topics on SO, and give it a go. After doing more research and searching, post a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) of your attempt and say specifically where you're stuck, which can help you get better answers. – help-info.de Nov 03 '19 at 17:02
  • 1
    Please make your question reproducible by adding the data, e.g. with ´dput(sit2)´. See also [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610). EDIT your question by adding code ... – help-info.de Nov 03 '19 at 17:02
  • Try with `gam()` or `bam()` and specify the range as `+ s(id, bs = ‘re’)`. Assuming that `id` isn’t `1:nrow(data)` (Observation level random effect) as that won’t work with these models. – Gavin Simpson Nov 03 '19 at 23:46

0 Answers0