项目作者: psolymos

项目描述 :
Resource Selection (Probability) Functions for Use-Availability Data in R
高级语言: R
项目地址: git://github.com/psolymos/ResourceSelection.git
创建时间: 2014-10-21T03:07:55Z
项目社区:https://github.com/psolymos/ResourceSelection

开源协议:

下载


ResourceSelection: Resource Selection (Probability) Functions for Use-Availability Data

CRAN version
CRAN RStudio mirror downloads
check

Resource Selection (Probability) Functions
for use-availability wildlife data
based on weighted distributions as described in
Lele and Keim (2006), Lele (2009), and Solymos & Lele (2016).

Install

CRAN version:

  1. install.packages("ResourceSelection")

Development version:

  1. devtools::install_github("psolymos/ResourceSelection")

User visible changes in the package are listed in the NEWS file.

Report a problem

Use the issue tracker
to report a problem.

Example

  1. ## Some data processing
  2. goats$exp.HLI <- exp(goats$HLI)
  3. goats$sin.SLOPE <- sin(pi * goats$SLOPE / 180)
  4. goats$ELEVATION <- scale(goats$ELEVATION)
  5. goats$ET <- scale(goats$ET)
  6. goats$TASP <- scale(goats$TASP)
  7. ## Fit two RSPF models:
  8. ## global availability (m=0) and bootstrap (B=99)
  9. m1 <- rspf(STATUS ~ TASP + sin.SLOPE + ELEVATION, goats, m=0, B = 99)
  10. m2 <- rspf(STATUS ~ TASP + ELEVATION, goats, m=0, B = 99)
  11. ## Inspect the summaries
  12. summary(m1)
  13. # Call:
  14. # rspf(formula = STATUS ~ TASP + sin.SLOPE + ELEVATION, data = goats, m = 0,
  15. # B = 99)
  16. #
  17. # Resource Selection Probability Function (Logistic RSPF) model
  18. # Non-matched Used-Available design
  19. # Maximum Likelihood estimates
  20. # with Nonparametric Bootstrap standard errors (B = 99)
  21. #
  22. # Fitted probabilities:
  23. # Min. 1st Qu. Median Mean 3rd Qu. Max.
  24. # 1.947e-08 4.280e-07 9.977e-07 1.376e-06 1.924e-06 8.793e-06
  25. #
  26. # Coefficients (logit link):
  27. # Estimate Std. Error z value Pr(>|z|)
  28. # (Intercept) -16.89454 0.26284 -64.276 <2e-16 ***
  29. # TASP 0.39116 0.01396 28.011 <2e-16 ***
  30. # sin.SLOPE 5.36640 0.09740 55.098 <2e-16 ***
  31. # ELEVATION 0.09829 0.01165 8.439 <2e-16 ***
  32. # ---
  33. # Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  34. #
  35. # Log-likelihood: -5.729e+04
  36. # BIC = 1.146e+05
  37. #
  38. # Hosmer and Lemeshow goodness of fit (GOF) test:
  39. # X-squared = 152.4, df = 8, p-value < 2.2e-16
  40. summary(m2)
  41. # Call:
  42. # rspf(formula = STATUS ~ TASP + ELEVATION, data = goats, m = 0, B = 99)
  43. #
  44. # Resource Selection Probability Function (Logistic RSPF) model
  45. # Non-matched Used-Available design
  46. # Maximum Likelihood estimates
  47. # with Nonparametric Bootstrap standard errors (B = 99)
  48. #
  49. # Fitted probabilities:
  50. # Min. 1st Qu. Median Mean 3rd Qu. Max.
  51. # 0.01194 0.58010 0.86180 0.73660 0.95710 0.99830
  52. #
  53. # Coefficients (logit link):
  54. # Estimate Std. Error z value Pr(>|z|)
  55. # (Intercept) 1.62906 0.10110 16.11 <2e-16 ***
  56. # TASP 1.86071 0.07751 24.01 <2e-16 ***
  57. # ELEVATION 1.14338 0.08315 13.75 <2e-16 ***
  58. # ---
  59. # Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  60. #
  61. # Log-likelihood: -5.91e+04
  62. # BIC = 1.182e+05
  63. #
  64. # Hosmer and Lemeshow goodness of fit (GOF) test:
  65. # X-squared = 174.3, df = 8, p-value < 2.2e-16
  66. ## Compare models: looks like m1 is better supported
  67. CAIC(m1, m2)
  68. # df CAIC
  69. # m1 4 114591.7
  70. # m2 3 118225.2
  71. ## Visualize the relationships
  72. plot(m1)
  73. mep(m1) # marginal effects similar to plot but with CIs
  74. kdepairs(m1) # 2D kernel density estimates
  75. plot(m2)
  76. kdepairs(m2)
  77. mep(m2)

Marginal effect plots

Scatterplot matrix with 2D kernel density estimates

References

Lele, S.R. (2009)
A new method for estimation of resource selection probability function.
Journal of Wildlife Management 73, 122—127. [link]

Lele, S. R. & Keim, J. L. (2006)
Weighted distributions and estimation of resource selection probability functions.
Ecology 87, 3021—3028. [link87%5B3021:WDAEOR%5D2.0.CO;2)]

Solymos, P. & 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, preprint]