[英]Fixed terms in dredge function (MuMin) in GAM
I am trying to use MuMIn::dredge()
function to build a GAM model.我正在尝试使用
MuMIn::dredge()
function 来构建 GAM model。 I am working on fish distribution and with the aim to speed up the analysis due the size of the dataset, I want to fix two variables, for example, depth and the interaction (latitude, longitude).我正在研究鱼的分布,并且由于数据集的大小,为了加快分析速度,我想修复两个变量,例如深度和交互(纬度、经度)。
I have read the package documentation and also have looked for any suggestion in this forum but I have not been successful.我已阅读 package 文档,并在此论坛中寻找任何建议,但我没有成功。 The following code works,
以下代码有效,
Allmodels_Presence <- dredge(Gadiculus_Pres, rank=AIC, fixed= ~s(depth, k=4), trace=2)
for but it only has fixed one variable and I don´t know how to fix the other one s(Lon_Proj, Lat_Proj, k=20)
, even though I have tried several approaches (mainly following the help for subsetting in dredge() ).因为但它只修复了一个变量,我不知道如何修复另一个变量
s(Lon_Proj, Lat_Proj, k=20)
,即使我尝试了几种方法(主要是在 dredge() 子集的帮助下) .
Any idea or suggestions will be more than welcome.任何想法或建议都将受到欢迎。 Thanks in advance.
提前致谢。
From the MuMIn documentation:从 MuMIn 文档中:
fixed - optional, either a single-sided formula or a character vector giving names of terms to be included in all models.
固定 - 可选,单面公式或字符向量,给出要包含在所有模型中的术语名称。
You need to put the names of the variables, enclosed in '', into a vector:您需要将包含在“”中的变量名称放入向量中:
Allmodels_Presence <- dredge(Gadiculus_Pres, rank=AIC,
fixed= c('s(depth, k=4)', 's(Lon_Proj, Lat_Proj, k=20)'),
trace=2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.