我可以创建一个包含所有连续变量和分类变量的模型吗?对不起,如果这令人困惑,我是 GAM 和 GAMM 的新手......! 解决方案 我正在处理类似的情况.您确实可以同时使用连续变量和分类变量.以下链接有望解决您的任何问题.但是,您可能需要考虑在 stats.stackexchange.com 而不是 stackoverflow.com 上提问,因为您的问题似乎更多是关于统计方法而不是 R 编程.https://kevintshoemaker.github.io/NRES-746/GAMs.htmlhttps://www.fromthebottomoftheheap.net/2014/05/09/modelling-seasonal-data-with-gam/https://petolau.github.io/Analyzing-double-seasonal-time-series-with-GAM-in-R/https://cran.r-project.org/web/packages/itsadug/vignettes/acf.htmlWanting to see the effects of multiple variables on grey seal abundance (data collected from my MSc research) using a GAM or GAMM in R.My response variable is total count, and I have continuous variables of temperature, windspeed and categorical variables of month, season and tide (low/high).gam(YthanCount$Total~s(YthanCount$Temperature)+s(YthanCount$Windspeed)The above model is for the two continuous variables....but I am just generally unsure what an appropriate model would be, and if I would be better using GAMM with a smoother over time (data collection period).Can I create a model with all of my continuous and categorical variables?Sorry if this is confusing, I am new to GAMs and GAMMs...! 解决方案 I'm am dealing with a similar situation. You can indeed use both continuous and categorical variables. The links below will hopefully resolve any questions you have.However, you may want to consider asking your question at stats.stackexchange.com rather than stackoverflow.com, as your question(s) seem to be more about statistical methods than about R programming.https://kevintshoemaker.github.io/NRES-746/GAMs.htmlhttps://www.fromthebottomoftheheap.net/2014/05/09/modelling-seasonal-data-with-gam/https://petolau.github.io/Analyzing-double-seasonal-time-series-with-GAM-in-R/https://cran.r-project.org/web/packages/itsadug/vignettes/acf.html 这篇关于R中的GAM具有分类和连续变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-29 04:00