glm_pres_abs | R Documentation |
glm_pres_abs
returns a presence/absence GLM model. It can run a StepAIC if specified. It runs the GLMs, plot the residuals analysis graphs and return the GLM outputs.
glm_pres_abs(
tableau_pres,
parameters,
formula_select,
summary = FALSE,
type = 2
)
tableau_pres |
table of presence and absence data, coming as the output of table_pres_abs |
parameters |
list of parameters to test |
formula_select |
if "auto", the function select which formula as the lowest AIC. Else, run the selected formula. |
summary |
To show residuals plots. |
type |
To study marginal effects with Anova type III in case of interaction |
glm_pres_abs
can either return the best GLM model based on AIC comparison, or return the outputs of the GLM based on the formula given in formula_select
data(tableau_sc)
list_param <- c("annee", "saison")
table_ex <- table_pres_abs(tableau_sc, esp="PSEUDOTOLITHUS ELONGATUS", list_param=c("annee", "saison"), espece_id='nom_taxonomique', var_eff_list=c("surface_chalutee"), catch_col='total_capture', limit=0.0001)
param <- param_use(table_ex, list_param)
for (i in 1:length(param)){
table_ex[,param[i]] <- as.factor(table_ex[,param[i]])
table_ex[,param[i]] <- droplevels(table_ex[,param[i]])
contrasts(table_ex[,param[i]]) <- contr.sum(levels(table_ex[,param[i]]))
}
glm_pres_abs(table_ex, param, formula_select = "auto")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.