{"id":15555146,"url":"https://github.com/psolymos/resourceselection","last_synced_at":"2025-04-13T02:13:16.473Z","repository":{"id":22167569,"uuid":"25499267","full_name":"psolymos/ResourceSelection","owner":"psolymos","description":"Resource Selection (Probability) Functions for Use-Availability Data in R","archived":false,"fork":false,"pushed_at":"2024-05-21T16:26:28.000Z","size":15609,"stargazers_count":8,"open_issues_count":8,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T02:13:09.600Z","etag":null,"topics":["cran","ecology","estimation","lele","r","rsf","rspf","solymos","weighted-distributions"],"latest_commit_sha":null,"homepage":"https://peter.solymos.org/ResourceSelection/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psolymos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-21T03:07:55.000Z","updated_at":"2024-09-20T02:04:33.000Z","dependencies_parsed_at":"2022-08-07T10:01:35.716Z","dependency_job_id":"dd558383-26db-4783-81fc-dbb05f553938","html_url":"https://github.com/psolymos/ResourceSelection","commit_stats":{"total_commits":1196,"total_committers":4,"mean_commits":299.0,"dds":"0.11036789297658867","last_synced_commit":"cd971b69a9e55e31f7d6401b85fecf22d52e0765"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psolymos%2FResourceSelection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psolymos%2FResourceSelection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psolymos%2FResourceSelection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psolymos%2FResourceSelection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psolymos","download_url":"https://codeload.github.com/psolymos/ResourceSelection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654094,"owners_count":21140236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran","ecology","estimation","lele","r","rsf","rspf","solymos","weighted-distributions"],"created_at":"2024-10-02T15:06:59.305Z","updated_at":"2025-04-13T02:13:16.454Z","avatar_url":"https://github.com/psolymos.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ResourceSelection: Resource Selection (Probability) Functions for Use-Availability Data\n\n[![CRAN version](https://www.r-pkg.org/badges/version/ResourceSelection)](https://CRAN.R-project.org/package=ResourceSelection)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/ResourceSelection)](https://www.rdocumentation.org/packages/ResourceSelection/)\n[![check](https://github.com/psolymos/ResourceSelection/actions/workflows/check.yml/badge.svg)](https://github.com/psolymos/ResourceSelection/actions/workflows/check.yml)\n\nResource Selection (Probability) Functions\nfor use-availability wildlife data\nbased on weighted distributions as described in\nLele and Keim (2006), Lele (2009), and Solymos \u0026 Lele (2016).\n\n## Install\n\nCRAN version:\n\n```R\ninstall.packages(\"ResourceSelection\")\n```\n\nDevelopment version:\n\n```R\ndevtools::install_github(\"psolymos/ResourceSelection\")\n```\n\nUser visible changes in the package are listed in the [NEWS](https://github.com/psolymos/ResourceSelection/blob/master/NEWS.md) file.\n\n## Report a problem\n\nUse the [issue tracker](https://github.com/psolymos/ResourceSelection/issues)\nto report a problem.\n\n## Example\n\n```R\n## Some data processing\ngoats$exp.HLI \u003c- exp(goats$HLI)\ngoats$sin.SLOPE \u003c- sin(pi * goats$SLOPE / 180)\ngoats$ELEVATION \u003c- scale(goats$ELEVATION)\ngoats$ET \u003c- scale(goats$ET)\ngoats$TASP \u003c- scale(goats$TASP)\n\n## Fit two RSPF models:\n## global availability (m=0) and bootstrap (B=99)\nm1 \u003c- rspf(STATUS ~ TASP + sin.SLOPE + ELEVATION, goats, m=0, B = 99)\nm2 \u003c- rspf(STATUS ~ TASP + ELEVATION, goats, m=0, B = 99)\n\n## Inspect the summaries\nsummary(m1)\n# Call:\n# rspf(formula = STATUS ~ TASP + sin.SLOPE + ELEVATION, data = goats, m = 0,\n#     B = 99)\n#\n# Resource Selection Probability Function (Logistic RSPF) model\n# Non-matched Used-Available design\n# Maximum Likelihood estimates\n# with Nonparametric Bootstrap standard errors (B = 99)\n#\n# Fitted probabilities:\n#      Min.   1st Qu.    Median      Mean   3rd Qu.      Max.\n# 1.947e-08 4.280e-07 9.977e-07 1.376e-06 1.924e-06 8.793e-06\n#\n# Coefficients (logit link):\n#              Estimate Std. Error z value Pr(\u003e|z|)\n# (Intercept) -16.89454    0.26284 -64.276   \u003c2e-16 ***\n# TASP          0.39116    0.01396  28.011   \u003c2e-16 ***\n# sin.SLOPE     5.36640    0.09740  55.098   \u003c2e-16 ***\n# ELEVATION     0.09829    0.01165   8.439   \u003c2e-16 ***\n# ---\n# Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n#\n# Log-likelihood: -5.729e+04\n# BIC = 1.146e+05\n#\n# Hosmer and Lemeshow goodness of fit (GOF) test:\n# X-squared = 152.4, df = 8, p-value \u003c 2.2e-16\n\nsummary(m2)\n# Call:\n# rspf(formula = STATUS ~ TASP + ELEVATION, data = goats, m = 0, B = 99)\n#\n# Resource Selection Probability Function (Logistic RSPF) model\n# Non-matched Used-Available design\n# Maximum Likelihood estimates\n# with Nonparametric Bootstrap standard errors (B = 99)\n#\n# Fitted probabilities:\n#    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.\n# 0.01194 0.58010 0.86180 0.73660 0.95710 0.99830\n#\n# Coefficients (logit link):\n#             Estimate Std. Error z value Pr(\u003e|z|)\n# (Intercept)  1.62906    0.10110   16.11   \u003c2e-16 ***\n# TASP         1.86071    0.07751   24.01   \u003c2e-16 ***\n# ELEVATION    1.14338    0.08315   13.75   \u003c2e-16 ***\n# ---\n# Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n#\n# Log-likelihood: -5.91e+04\n# BIC = 1.182e+05\n#\n# Hosmer and Lemeshow goodness of fit (GOF) test:\n# X-squared = 174.3, df = 8, p-value \u003c 2.2e-16\n\n## Compare models: looks like m1 is better supported\nCAIC(m1, m2)\n#    df     CAIC\n# m1  4 114591.7\n# m2  3 118225.2\n\n## Visualize the relationships\nplot(m1)\nmep(m1) # marginal effects similar to plot but with CIs\nkdepairs(m1) # 2D kernel density estimates\nplot(m2)\nkdepairs(m2)\nmep(m2)\n```\n\n#### Marginal effect plots\n\n![](https://github.com/psolymos/ResourceSelection/raw/master/images/goats-mep.png)\n\n#### Scatterplot matrix with 2D kernel density estimates\n\n![](https://github.com/psolymos/ResourceSelection/raw/master/images/goats-m1.png)\n\n## References\n\nLele, S.R. (2009)\nA new method for estimation of resource selection probability function.\n_Journal of Wildlife Management_ 73, 122--127. [[link](https://doi.org/10.2193/2007-535)]\n\nLele, S. R. \u0026  Keim, J. L. (2006)\nWeighted distributions and estimation of resource selection probability functions.\n_Ecology_ 87, 3021--3028. [[link](https://doi.org/10.1890/0012-9658(2006)87%5B3021:WDAEOR%5D2.0.CO;2)]\n\nSolymos, P. \u0026 Lele, S. R. (2016) Revisiting resource selection probability functions and single-visit methods: clarification and extensions. _Methods in Ecology and Evolution_ 7, 196--205. [[link](https://doi.org/10.1111/2041-210X.12432), [preprint](https://arxiv.org/abs/1501.05880)]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsolymos%2Fresourceselection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsolymos%2Fresourceselection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsolymos%2Fresourceselection/lists"}