我用Rstudio。根据https://stats.stackexchange.com/questions/135694/using-b-splines-within-a-linear-mixed-effects-model-in-r我想将所谓的 b-splines 添加到我的型号:
degree<- 3\nfit<- lmer(log(log(Amplification)) ~ bs(poly(Voltage, degree)) + bs(poly(Voltage, degree) | Serial_number),data = APD))\nRun Code Online (Sandbox Code Playgroud)\n\n但这会导致
\n\nError in splineDesign(Aknots, x, ord) : \n length of \'derivs\' is larger than length of \'x\'\nIn addition: Warning messages:\n1: In Ops.factor(poly(Voltage, 3), Serial_number) :\n \xe2\x80\x98+\xe2\x80\x99 not meaningful for factors\n2: In min(x, na.rm = na.rm) :\n no non-missing arguments to min; returning Inf\n3: In max(x, na.rm = na.rm) :\n no non-missing arguments to max; returning -Inf\nRun Code Online (Sandbox Code Playgroud)\n\n这意味着什么?当我使用
\n\nsummary(fit<- lmer(log(log(Amplification)) ~ (poly(bs(Voltage), degree)) + (poly(Voltage, degree) | Serial_number), data = APD))\nRun Code Online (Sandbox Code Playgroud)\n\n那么这会导致
\n\nError in poly(dots[[i]], degree, raw = raw, simple = raw) : \n \'degree\' must be less than number of unique points\nRun Code Online (Sandbox Code Playgroud)\n\ndegree=0收益率下降
Error in poly(dots[[1L]], degree, raw = raw, simple = raw && nd > 1) : \n \'degree\' must be at least 1\nRun Code Online (Sandbox Code Playgroud)\n\n如何将 b 样条线添加到 lmer 中?\n提前谢谢您!
\n