Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The ‘multGLM‘ function in the ‘fuzzySim‘ R package automatically calculates generalized linear models for one or more species, with a range of options for variable selection. However, you may want to build your final models with other methods (e.g. multimodel-inference with packages ‘glmulti’ or ‘MuMIn’, or other modelling algorithms such as those implemented in packages ‘dismo’, ‘biomod2’ or ‘sdm’), but still previously apply some of the variable selection methods implemented in ‘multGLM’. Since ‘fuzzySim’ package version 2.2.3 (currently available on R-Forge), function ‘multGLM’ includes an additional item in the output: a list of character vectors naming the variables selected for each model, following the specified criteria. So, you can use ‘multGLM’ with your desired selection criteria and then use the selected variables elsewhere, as below:

```library(fuzzySim) # >2.2.3
data(rotif.env)
names(rotif.env)

# make models for 2 of the species in rotif.env using some selection criteria:
mods_multGLM <- multGLM(rotif.env, sp.cols = 18:19, var.cols = 5:17, id.col = 1,
FDR = TRUE, corSelect = TRUE, cor.thresh = 0.8, step = FALSE, trim = FALSE)
mods_multGLM\$variables

# now use the selected variables elsewhere:
library(glmulti)
mod_glmulti_Abrigh <- glmulti(y = "Abrigh", xr = mods_multGLM\$variables[["Abrigh"]], data = rotif.env, level = 1, method = "h", crit = "aic", fitfunction = "glm", family = binomial)
mod_glmulti_Abrigh
summary(mod_glmulti_Abrigh@objects[])
```

Also, the ‘multGLM‘ function (since fuzzySim version 2.2.3) now also accepts column names (not only index numbers) as the ‘sp.cols‘, ‘var.cols‘ and ‘id.col‘ arguments.
{"ft_lang_label":"__label__en","ft_lang_prob":0.76306576,"math_prob":0.96445614,"size":2048,"snap":"2023-40-2023-50","text_gpt3_token_len":539,"char_repetition_ratio":0.11741683,"word_repetition_ratio":0.10033445,"special_character_ratio":0.24804688,"punctuation_ratio":0.16879795,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9596928,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-07T05:08:56Z\",\"WARC-Record-ID\":\"<urn:uuid:225a33b9-2a9e-41fa-8e83-4615242905f6>\",\"Content-Length\":\"85764\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d70ac526-092b-443b-aa85-74db9ec168d9>\",\"WARC-Concurrent-To\":\"<urn:uuid:1d70c301-34d3-46ff-93df-56af6281d157>\",\"WARC-IP-Address\":\"172.67.211.236\",\"WARC-Target-URI\":\"https://www.r-bloggers.com/2020/01/variable-selection-with-multglm/\",\"WARC-Payload-Digest\":\"sha1:7D7LND2NSO5K4Y6IWBBPFR7V2CZ32WPD\",\"WARC-Block-Digest\":\"sha1:57FZXH2PGQ6ZXBX5ZH6E3BF6UUIKUHZ4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100632.0_warc_CC-MAIN-20231207022257-20231207052257-00036.warc.gz\"}"}