0

I am trying to analyse bird detection probability using the package 'Distance' in R. I split up detection by bird size class: small and medium.large based on weight because individual species detections were low. Below is for small bird size class across 26 different sites, that varied in 4 different habitat types: ag, forest, shrubland, grassland. I have higher but decent AIC values with some of my outputs (Ex 1) and the lower AIC value formulas gives NA and null outputs(Example 2). Trying to troubleshoot and figure out what is wrong. Veg type= category, mean annual rainfall= continuous. I have also included my output without any variables (Example 3). Is it not possible to use a continuous variable as a factor? Because the outputs have low AIC’s with NA’s and nulls (Example 4). I appreciate any guidance or recommendation. Thank you in advance!

> head(det_small3)
  Region.Label Sample.Label Effort distance size Species vegheight canopy weight meanannualrainfall elevation ground avgtempf     vegtype
1  agriculture            5      1       35   15   small      0.35      0   17.9              409.9     31.09     80       78 agriculture
2  agriculture            5      1       40    6   small      0.35      0   17.9              409.9     31.09     80       78 agriculture
3  agriculture            5      1       45    4   small      0.35      0   17.9              409.9     31.09     80       78 agriculture
4  agriculture            5      1       40    5   small      0.35      0   17.9              409.9     31.09     80       78 agriculture
5  agriculture            5      1       45   10   small      0.35      0   17.9              409.9     31.09     80       78 agriculture
6  agriculture            5      1       30    2   small      0.35      0   17.9              409.9     31.09     80       78 agriculture

> tail(det_small3)
    Region.Label Sample.Label Effort distance size Species vegheight canopy weight meanannualrainfall elevation ground avgtempf   vegtype
237    grassland           26      1       60   30   small       0.7      0   17.9             1249.7       341     70     73.0 grassland
238    grassland           26      1       40    3   small       0.7      0   17.9             1249.7       341     70     73.0 grassland
239    grassland           26      1       70    3   small       0.7      0   17.9             1249.7       341     70     73.0 grassland
240    grassland           26      1       80    2   small       0.7      0   17.9             1249.7       341     70     73.0 grassland
241    grassland           26      1       30    3   small       0.7      0   17.9             1249.7       341     70     73.0 grassland
242    shrubland           15      1       NA   NA   small       0.5      0     na             1177.5      2673     50     52.9 shrubland


 dput(det_small3)structure(list(Region.Label = structure(c(1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,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L, 21L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 
23L, 23L, 23L, 23L, 23L, 23L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 
7L, 7L, 7L, 7L, 7L, 9L, 9L, 9L, 9L, 9L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
11L, 11L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 
16L, 16L, 18L, 18L, 18L, 20L, 20L, 20L, 20L, 24L, 24L, 24L, 24L, 
24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 22L, 22L, 22L, 22L, 22L, 22L, 3L, 3L, 3L, 3L, 3L, 
4L, 4L, 4L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 
8L, 14L, 14L, 14L, 14L, 17L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 
25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 
25L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 15L), .Label = c("1", 
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", 
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", 
"25", "26"), class = "factor"), Effort = c(1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1), distance = c(35, 40, 45, 40, 45, 30, 45, 75, 
55, 65, 80, 50, 50, 10, 30, 20, 30, 20, 30, 40, 150, 30, 40, 
10, 10, 15, 20, 20, 30, 50, 20, 40, 25, 30, 30, 50, 50, 20, 20, 
20, 40, 5, 20, 20, 20, 20, 30, 5, 10, 30, 20, 10, 30, 20, 10, 
30, 15, 20, 25, 10, 20, 40, 15, 20, 30, 40, 20, 30, 30, 30, 30, 
30, 100, 30, 30, 30, 10, 40, 30, 60, 90, 40, 80, 40, 30, 45, 
15, 20, 70, 80, 60, 30, 100, 80, 50, 40, 60, 30, 30, 40, 60, 
70, 55, 35, 40, 50, 45, 40, 45, 35, 35, 30, 40, 10, 6, 10, 5, 
15, 20, 30, 15, 40, 20, 25, 20, 30, 40, 20, 25, 15, 30, 25, 30, 
30, 25, 20, 20, 25, 50, 40, 50, 30, 50, 50, 50, 30, 60, 60, 80, 
60, 80, 30, 100, 60, 25, 50, 30, 20, 30, 40, 20, 30, 20, 30, 
50, 40, 30, 40, 30, 20, 30, 60, 50, 20, 50, 55, 35, 55, 15, 30, 
10, 50, 60, 80, 40, 35, 35, 50, 40, 30, 25, 30, 50, 50, 40, 30, 
50, 50, 30, 200, 200, 100, 100, 100, 150, 100, 30, 40, 30, 20, 
70, 40, 40, 60, 60, 30, 50, 50, 30, 50, 60, 80, 90, 30, 60, 80, 
40, 100, 50, 40, 35, 20, 60, 90, 40, 50, 60, 40, 70, 80, 30, 
NA), size = c(15, 6, 4, 5, 10, 2, 2, 4, 2, 10, 3, 3, 3, 3, 11, 
2, 2, 1, 2, 6, 4, 2, 1, 6, 2, 8, 2, 2, 1, 3, 2, 3, 2, 5, 2, 6, 
6, 14, 6, 2, 4, 2, 2, 2, 5, 4, 5, 2, 4, 12, 1, 8, 3, 3, 12, 4, 
2, 6, 6, 6, 2, 7, 2, 8, 10, 1, 14, 2, 3, 1, 2, 2, 3, 2, 2, 4, 
3, 4, 2, 8, 1, 4, 1, 2, 8, 15, 8, 5, 9, 8, 2, 2, 3, 2, 8, 2, 
1, 3, 2, 2, 2, 5, 4, 3, 7, 6, 3, 1, 6, 4, 1, 3, 1, 5, 4, 3, 4, 
3, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 5, 2, 1, 2, 3, 3, 9, 
8, 5, 2, 2, 2, 2, 2, 3, 4, 6, 4, 2, 2, 3, 2, 2, 6, 1, 1, 1, 1, 
1, 4, 2, 6, 1, 1, 4, 4, 2, 3, 3, 3, 8, 2, 3, 4, 2, 4, 1, 1, 2, 
1, 1, 1, 1, 2, 10, 4, 4, 2, 10, 3, 3, 2, 5, 6, 2, 2, 2, 1, 5, 
2, 1, 2, 1, 1, 1, 6, 4, 4, 4, 2, 2, 2, 2, 3, 2, 2, 3, 3, 2, 8, 
2, 1, 2, 2, 1, 2, 2, 3, 6, 1, 8, 3, 12, 10, 15, 30, 3, 3, 2, 
3, NA), Species = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L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 0.2, 0.4, 0.4, 0.4, 0.4, 0.4, 
0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 
0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 
0.4, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 
0.25, 0.25, 0.25, 0.25, 0.25, 0.725, 0.725, 0.725, 0.725, 0.725, 
0.725, 0.725, 0.725, 0.725, 0.725, 0.45, 0.45, 0.45, 0.45, 0.45, 
0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 
0.45, 0.45, 0.45, 0.45, 0.45, 0.45, 2.93, 2.93, 2.93, 9, 9, 9, 
9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5, 20, 20, 20, 20, 20, 20, 20, 
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0.4, 0.4, 
0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 6, 6, 
6, 0.5, 0.5, 0.5, 0.5, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 
8.3, 8.3, 8.3, 8.3, 8.3, 0.3, 0.3, 0.43, 0.43, 0.43, 0.43, 0.43, 
0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 
0.2, 0.2, 0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
0.1, 0.1, 0.1, 0.1, 0.11, 0.11, 0.11, 0.11, 0.3, 0.15, 0.15, 
0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 
0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.7, 0.7, 0.7, 
0.7, 0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1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L), .Label = c("17.9", 
"na"), class = "factor"), meanannualrainfall = c(409.9, 409.9, 
409.9, 409.9, 409.9, 409.9, 409.9, 409.9, 409.9, 409.9, 409.9, 
467.5, 467.5, 467.5, 467.5, 467.5, 467.5, 467.5, 467.5, 467.5, 
467.5, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 
306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 
306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 
306.8, 306.8, 306.8, 306.8, 306.8, 306.8, 320.7, 320.7, 320.7, 
320.7, 320.7, 320.7, 320.7, 320.7, 320.7, 320.7, 320.7, 320.7, 
320.7, 320.7, 320.7, 409.9, 409.9, 409.9, 409.9, 409.9, 409.9, 
409.9, 409.9, 409.9, 409.9, 376.6, 376.6, 376.6, 376.6, 376.6, 
376.6, 376.6, 376.6, 352.4, 352.4, 352.4, 352.4, 352.4, 352.4, 
352.4, 352.4, 352.4, 352.4, 352.4, 352.4, 352.4, 352.4, 2044.1, 
2044.1, 2044.1, 918.3, 918.3, 918.3, 918.3, 918.3, 918.3, 918.3, 
918.3, 918.3, 918.3, 2004.5, 2004.5, 2004.5, 2004.5, 2004.5, 
1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 
1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 1842.8, 
1842.8, 1842.8, 1842.8, 1842.8, 808, 808, 808, 808, 808, 808, 
808, 808, 808, 808, 808, 808, 808, 3550.6, 3550.6, 3550.6, 797.7, 
797.7, 797.7, 797.7, 1352.1, 1352.1, 1352.1, 1352.1, 1352.1, 
1352.1, 1352.1, 1352.1, 1352.1, 1352.1, 1352.1, 1352.1, 1352.1, 
1008, 1008, 1008, 1008, 1008, 1008, 1008, 1012.9, 1012.9, 1012.9, 
1012.9, 1012.9, 1012.9, 634.4, 634.4, 634.4, 634.4, 634.4, 1371, 
1371, 1371, 734.2, 734.2, 734.2, 734.2, 734.2, 734.2, 734.2, 
734.2, 734.2, 734.2, 734.2, 734.2, 734.2, 734.2, 525.8, 525.8, 
525.8, 525.8, 718.9, 677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 
677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 
677.8, 677.8, 677.8, 677.8, 677.8, 677.8, 1249.7, 1249.7, 1249.7, 
1249.7, 1249.7, 1249.7, 1249.7, 1249.7, 1249.7, 1177.5), elevation = c(31.09, 
31.09, 31.09, 31.09, 31.09, 31.09, 31.09, 31.09, 31.09, 31.09, 
31.09, 335.28, 335.28, 335.28, 335.28, 335.28, 335.28, 335.28, 
335.28, 335.28, 335.28, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 
11, 11, 11, 11, 11, 11, 78.02, 78.02, 78.02, 78.02, 78.02, 78.02, 
78.02, 78.02, 78.02, 78.02, 78.02, 78.02, 78.02, 78.02, 78.02, 
52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 182, 182, 182, 182, 182, 
182, 182, 182, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 
44, 44, 27.13, 27.13, 27.13, 1981.2, 1981.2, 1981.2, 1981.2, 
1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 746.76, 746.76, 
746.76, 746.76, 746.76, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 
1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 
1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1981.2, 1433, 
1433, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 
1433, 73, 73, 73, 1343, 1343, 1343, 1343, 396, 396, 396, 396, 
396, 396, 396, 396, 396, 396, 396, 396, 396, 1828.8, 1828.8, 
2194.56, 2194.56, 2194.56, 2194.56, 2194.56, 2569, 2569, 2569, 
2569, 2569, 2569, 502.92, 502.92, 502.92, 502.92, 502.92, 944.88, 
944.88, 944.88, 667.5, 667.5, 667.5, 667.5, 667.5, 667.5, 667.5, 
667.5, 667.5, 667.5, 667.5, 667.5, 667.5, 667.5, 359.05, 359.05, 
359.05, 359.05, 986, 690, 690, 690, 690, 690, 690, 690, 690, 
690, 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, 690, 
341, 341, 341, 341, 341, 341, 341, 341, 341, 2673), ground = c(80, 
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 70, 70, 70, 70, 70, 70, 
70, 70, 70, 70, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 
50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 
75, 75, 75, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 75, 75, 75, 
75, 75, 75, 75, 75, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 
70, 70, 70, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 
90, 90, 90, 90, 90, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
80, 80, 80, 80, 80, 80, 95, 95, 95, 73, 73, 73, 73, 100, 100, 
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 80, 80, 
60, 60, 60, 60, 60, 40, 40, 40, 40, 40, 40, 85, 85, 85, 85, 85, 
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 
95, 35, 35, 35, 35, 75, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 
65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 70, 70, 70, 70, 70, 
70, 70, 70, 70, 50), avgtempf = c(78, 78, 78, 78, 78, 78, 78, 
78, 78, 78, 78, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 77.5, 
77.5, 77.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 
80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 
80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 80.5, 
80.5, 79.5, 79.5, 79.5, 79.5, 79.5, 79.5, 79.5, 79.5, 79.5, 79.5, 
79.5, 79.5, 79.5, 79.5, 79.5, 80.6, 80.6, 80.6, 80.6, 80.6, 80.6, 
80.6, 80.6, 80.6, 80.6, 78.4, 78.4, 78.4, 78.4, 78.4, 78.4, 78.4, 
78.4, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 
76, 76, 76, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 68.5, 68.5, 
68.5, 68.5, 68.5, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 
54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 54.3, 
54.3, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 65.5, 
65.5, 65.5, 65.5, 74.5, 74.5, 74.5, 65, 65, 65, 65, 78, 78, 78, 
78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 65, 65, 65, 65, 65, 65, 
65, 50, 50, 50, 50, 50, 50, 69, 69, 69, 69, 69, 66, 66, 66, 65.8, 
65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 65.8, 
65.8, 65.8, 74.3, 74.3, 74.3, 74.3, 67.4, 75.5, 75.5, 75.5, 75.5, 
75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 
75.5, 75.5, 75.5, 75.5, 75.5, 75.5, 73, 73, 73, 73, 73, 73, 73, 
73, 73, 52.9), vegtype = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L), .Label = c("agriculture", 
"forest", "shrubland", "grassland"), class = "factor")), class = "data.frame", row.names = c(NA, 
-242L))

Example 1:

detect_hrvegtype$dht$individuals$summary

    Region     Area CoveredArea Effort   n       ER     se.ER     cv.ER mean.size   se.mean
1 agriculture 198470.1    198470.1      7 428 61.14286 13.698155 0.2240352  4.412371 0.3501204

2      forest 198470.1    226823.0      8 206 25.75000  5.936419 0.2305405  2.942857 0.2162026

3   shrubland 198470.1    113411.5      4  31  7.75000  2.954516 0.3812279  2.384615 0.5608883

4   grassland 198470.1    198470.1      7 216 30.85714 10.479978 0.3396289  4.408163 0.6912465

5       Total 793880.5    737174.7     26 881 33.88462  5.961241 0.1759276  3.847162 0.2262063

Example 2:

detect_hrcosmeanannualrainfall$dht$individuals$summary NULL

summary(detect_hrcosmeanannualrainfall)

Summary for distance analysis 

Number of observations :  229 

Distance range         :  0  -  95 

Model : Hazard-rate key function 

AIC   : 6 

Detection function parameters

Scale coefficient(s):  

                    estimate se

(Intercept)         3.108856 NA

meanannualrainfall -1.000038 NA

Shape coefficient(s):  

estimate se

(Intercept) 0.8765737 NA

                    Estimate SE CV

Average p                  0 NA NA

N in covered region      Inf NA NA

Example 3:

summary(detect_hrcos)

Summary for distance analysis 

Number of observations :  229 

Distance range         :  0  -  95 

Model : Hazard-rate key function 

AIC   : 1954.596 

Detection function parameters

Scale coefficient(s):  

            estimate         se

(Intercept) 3.645371 0.06451175

Shape coefficient(s):  

            estimate        se

(Intercept) 1.461591 0.1104191

                       Estimate          SE        CV

Average p             0.2519536  0.02109612 0.0837302

N in covered region 908.8975475 92.14143419 0.1013771

Summary for clusters

Summary statistics:

       Region     Area CoveredArea Effort   n  k        ER    se.ER     cv.ER

1 agriculture 198470.1    198470.1      7  97  7 13.857143 3.165503 0.2284383

2      forest 198470.1    226823.0      8  70  8  8.750000 2.234071 0.2553224

3   shrubland 198470.1    113411.5      4  13  4  3.250000 1.376893 0.4236593

4   grassland 198470.1    198470.1      7  49  7  7.000000 2.380476 0.3400680

5       Total 793880.5    737174.7     26 229 26  8.807692 1.406599 0.1597012

Density:

        Label     Estimate           se        cv          lcl         ucl        df

1 agriculture 0.0019397960 0.0004719521 0.2432999 0.0011118509 0.003384274  7.716770

2      forest 0.0012248712 0.0003291242 0.2687010 0.0006710625 0.002235722  8.583516

3   shrubland 0.0004549522 0.0001964729 0.4318541 0.0001286891 0.001608384  3.238871

4   grassland 0.0009798970 0.0003431836 0.3502242 0.0004357316 0.002203646  6.748863

5       Total 0.0011498791 0.0001921382 0.1670942 0.0008205686 0.001611348 33.532371

Summary for individuals

Summary statistics:

       Region     Area CoveredArea Effort   n       ER     se.ER     cv.ER mean.size   se.mean

1 agriculture 198470.1    198470.1      7 428 61.14286 13.698155 0.2240352  4.412371 0.3501204

2      forest 198470.1    226823.0      8 206 25.75000  5.936419 0.2305405  2.942857 0.2162026

3   shrubland 198470.1    113411.5      4  31  7.75000  2.954516 0.3812279  2.384615 0.5608883

4   grassland 198470.1    198470.1      7 216 30.85714 10.479978 0.3396289  4.408163 0.6912465

5       Total 793880.5    737174.7     26 881 33.88462  5.961241 0.1759276  3.847162 0.2262063

Density:

        Label    Estimate           se        cv          lcl         ucl        df

1 agriculture 0.008559100 0.0020470844 0.2391705 0.0049557369 0.014782502  7.789194

2      forest 0.003604621 0.0008841224 0.2452747 0.0020857164 0.006229654  8.963693

3   shrubland 0.001084886 0.0004234468 0.3903146 0.0003470734 0.003391149  3.296311

4   grassland 0.004319546 0.0015109678 0.3497979 0.0019226637 0.009704492  6.750856

5       Total 0.004392038 0.0007439172 0.1693786 0.0031064619 0.006209636 25.098525

Expected cluster size

       Region Expected.S se.Expected.S cv.Expected.S

1 agriculture   4.412371     0.3659490    0.08293704

2      forest   2.942857     0.2285997    0.07767953

3   shrubland   2.384615     0.8192792    0.34356868

4   grassland   4.408163     1.1686187    0.26510331

5       Total   3.819565     0.3229394    0.08454874

Example 4:

detect_hrcoselevation<- ds(det_small3, truncation = 95, transect = "point", key = "hr", formula = 
~elevation) #AIC=-382

detect_hrcosmeanannualrainfall<- ds(det_small3, truncation = 95, transect = "point", key = "hr", formula = ~meanannualrainfall) #AIC=6

detect_hrcosmeanannualrainfallvegheight<- ds(det_small3, truncation = 95, transect = "point", key = "hr", formula = ~meanannualrainfall+vegheight) #AIC=8
lrluther
  • 1
  • 1
  • "Is it not possible to use a continuous variable as a factor?" Perhaps try make it a factor based on median split (just to see if that solves anything; although probably not the best alternative since you are loosing a lot of information this way... ) – Oscar Kjell Feb 02 '20 at 08:44
  • Consider giving some example data using dput(). for example see: https://stackoverflow.com/questions/49994249/example-of-using-dput – Oscar Kjell Feb 02 '20 at 08:45
  • Thank you @Gorp, I've added the head, tail and dput of my dataset. I do not include the area: 200m2 radius. I wonder if that would improve the models? Thanks again! – lrluther Feb 03 '20 at 21:50
  • Added area= 125700. It did not change anything except the AIC for elevation from negative to 6. Still received NA outputs. summary(detect_hrcoselevation) Model : Hazard-rate key function AIC : 6 Detection function parameters Scale coefficient(s): estimate se (Intercept) 1.7278892 NA elevation -0.9999534 NA Shape coefficient(s): estimate se (Intercept) 2.609438 NA Estimate SE CV Average p 0 NA NA N in covered region Inf NA NA – lrluther Feb 03 '20 at 22:15
  • @lrluther this is an old question, but for further questions and other people using this package, there is a google group where the developers answer to you. Since the distance package is very useful in ecology but there are some problems that might be more related more to ecology than with coding, you should consider making your questions there. – MyName Jul 14 '20 at 14:37

0 Answers0