在lmer中使用的b样条中,“导数大于x的长度”

时间:2017-11-02 12:35:56

标签: r lme4

我使用Rstudio。根据{{​​3}},我想在我的lmer模型中添加所谓的b样条:

degree<- 3
fit<- lmer(log(log(Amplification)) ~ bs(poly(Voltage, degree)) + bs(poly(Voltage, degree) | Serial_number),data = APD))

但这会导致

Error in splineDesign(Aknots, x, ord) : 
  length of 'derivs' is larger than length of 'x'
In addition: Warning messages:
1: In Ops.factor(poly(Voltage, 3), Serial_number) :
  ‘+’ not meaningful for factors
2: In min(x, na.rm = na.rm) :
  no non-missing arguments to min; returning Inf
3: In max(x, na.rm = na.rm) :
  no non-missing arguments to max; returning -Inf

这是什么意思?当我用而不是

summary(fit<- lmer(log(log(Amplification)) ~ (poly(bs(Voltage), degree)) + (poly(Voltage, degree) | Serial_number), data = APD))

然后这会导致

Error in poly(dots[[i]], degree, raw = raw, simple = raw) : 
  'degree' must be less than number of unique points

降至degree=0收益

Error in poly(dots[[1L]], degree, raw = raw, simple = raw && nd > 1) : 
  'degree' must be at least 1

如何将b样条添加到lmer中? 提前谢谢!

0 个答案:

没有答案