1
$\begingroup$

I am trying to determine the habitat of a species of dolphin. My data is highly zero-inflated, so I chose hurdle and zero-inflated negative binomial models to analyze it. I used the pscl package in R to run a suite of models with different combinations of the explanatory (environmental) variables. I have selected two models (using AIC, k-fold cross validation, likelihood ratio tests, and AUC), one that models the zero part best and one that models the count part best. These models only retained a few variables and only three ended up being significant. There are two results I'd really like to obtain, but I'm having trouble finding a method to get them. One would be a plot of the results against the original explanatory variables, just the significant ones. I'm new to statistics, so I first tried to plot the fitted responses against the original variables, but it didn't agree with the model results, so I figured that was the wrong way to go about it. The other is the "optimal" values of the significant environmental variables (e.g. dolphins are most often found in waters of x1-x2 meters depth). This is the really important metric, but I can't find anything explaining how to determine this. Does anyone have a method or a resource I can look through to try to get at these things?

Turbidity and chlorophyll a have been binned into low, medium, and high due to instrument issues. I'm not sure if there's a better way to paste in the data, so if there is, please let me know and I'll fix it so it's easier to use.

# zero-inflated model:
zeroinfl(formula = sightings ~ temp + salinity + turbidity + dr + calves + depth +chl,
         data = hdata1, dist = "negbin", link = "logit")

Pearson residuals:
     Min       1Q   Median       3Q      Max   
-0.94465 -0.48090 -0.37887 -0.01391  9.94491

Count model coefficients (negbin with log link):  
             Estimate Std. Error z value Pr(>|z|)   
(Intercept) 30.947611  14.123449   2.191   0.0284 *   
temp        -0.537494   0.264139  -2.035   0.0419 *   
salinity    -0.488792   0.218886  -2.233   0.0255 *   
turbidity    0.289667   0.204845   1.414   0.1573     
dr           0.008783   0.030695   0.286   0.7748     
calves       0.797886   0.266925   2.989   0.0028 **  
depth       -0.018132   0.059215  -0.306   0.7595     
chl         -0.197840   0.148794  -1.330   0.1836     
Log(theta)   0.907219   0.420729   2.156   0.0311 *   

Zero-inflation model coefficients (binomial with logit link):  
              Estimate Std. Error z value Pr(>|z|)     
(Intercept)   21.73311   21.43736   1.014   0.3107     
temp          -0.42438    0.39871  -1.064   0.2872     
salinity      -0.30755    0.33770  -0.911   0.3624     
turbidity      1.00807    0.36828   2.737   0.0062 **    
dr             0.05110    0.04615   1.107   0.2682     
calves       -17.78058 1147.55001  -0.015   0.9876     
depth         -0.20554    0.08252  -2.491   0.0127 *     
chl            0.14151    0.25268   0.560   0.5755     

Theta = 2.4774   
Number of iterations in BFGS optimization: 36   
Log-likelihood: -376.5 on 17 Df 

# the hurdle model:
hurdle(formula = sightings ~ depth + temp + calves + turbidity, 
       data = hdata2, dist = "negbin", link = "logit")

Pearson residuals:
    Min      1Q  Median      3Q     Max   
-0.7917 -0.5273 -0.3893  0.1989  6.9482 

Count model coefficients (truncated negbin with log link):  
            Estimate Std. Error z value Pr(>|z|)     
(Intercept) 39.33117   12.31539   3.194   0.0014 **  
depth       -0.14725    0.08518  -1.729   0.0839 .   
temp        -1.43828    0.45299  -3.175   0.0015 **  
calves       0.47433    0.50256   0.944   0.3453     
turbidity    0.62601    0.33974   1.843   0.0654 .   
Log(theta)   0.53961    0.64078   0.842   0.3997    

Zero hurdle model coefficients (binomial with logit link):  
             Estimate Std. Error z value Pr(>|z|)     
(Intercept)   -6.7758    10.1788  -0.666  0.50561     
depth          0.1853     0.0605   3.063  0.00219 **  
temp           0.1153     0.3718   0.310  0.75652     
calves        17.2969  1474.2424   0.012  0.99064     
turbidity      1.1366     0.6058   1.876  0.06063 .    

Theta: count = 1.7153  
Number of iterations in BFGS optimization: 41   
Log-likelihood: -201.7 on 11 Df  

# data for the zero-inflated model.  
depth   temp    dr  salinity    turbidity   chl sightings   calves  
4.7 29.36   2.011850876 28.83987925 1   3   0   0  
4.7 29.13   1.900586093 28.63125671 1   2   0   0  
3.3 29.01   3.010121079 28.70284166 1   3   0   0  
3.9 29.07   2.861992795 28.76710579 1   2   0   0  
5.2 29.2    4.583672075 28.6029197  1   2   0   0  
5.5 29.6    4.379241797 28.59126789 1   2   3   0  
5.6 29.68   4.511140984 28.52428319 1   1   4   0  
5.2 29.22   5.302718836 28.73739597 1   2   1   0  
3.1 29.9    7.430188607 28.99989079 1   2   0   0  
6.8 29.63   5.893449871 28.4416111  1   2   0   0  
6.6 29.83   5.987042043 28.65321564 2   2   0   0  
7.3 29.61   7.391268916 28.73067284 2   2   0   0  
6.6 29.64   8.64153464  28.58743846 2   2   0   0  
3.5 30.2    12.07894269 29.01145684 1   2   0   0  
3.5 29.49   12.47664456 28.59040281 2   2   0   0  
7.6 29.51   10.09069541 28.72418516 2   1   0   0  
8   29.56   9.863018878 28.75394812 2   2   6   0  
8.5 29.35   9.151127294 28.81283849 2   2   2   0  
8.5 29.45   9.13865022  28.7598053  2   2   2   0  
8.7 29.63   10.37079927 28.67277598 2   2   0   0  
9   29.72   10.35469783 28.73161687 2   2   0   0  
6.7 29.87   12.45499002 28.8073637  2   1   0   0  
5.1 30.02   12.59796555 28.54818389 2   2   0   0  
3.6 30.29   11.83865306 28.46222804 2   2   0   0  
8.1 29.82   13.25289048 28.81727466 2   3   0   0  
9   29.47   13.28918743 28.90043291 2   2   0   0  
8.7 29.29   13.14122345 28.96855549 3   2   0   0  
9   29.06   13.0892942  29.23451699 2   1   0   0  
8.3 29.16   14.10087042 29.12027592 2   1   2   0  
9.5 29.4    13.85489948 29.00210782 2   2   6   1  
9.5 29.4    13.55266688 29.0021078  2   2   3   0  
9.8 29.4    10.94446353 29.10172937 2   2   0   0  
4.6 29.54   8.789362985 28.92481034 2   1   0   0  
10  29.69   10.36418006 28.90128052 2   1   0   0  
9.5 29.57   11.88796421 28.93989064 2   1   2   0  
8.5 29.35   14.47562218 29.0588281  2   1   0   0  
10  29.72   10.31256306 28.95605919 2   1   0   0  
7.3 29.9    6.742906448 28.82909105 3   1   0   0  
5.3 29.89   6.224763251 28.82183531 2   1   0   0  
10.5    29.55   8.119615201 28.9915907  3   2   0   0  
9.5 29.28   11.04378489 29.10113712 2   2   0   0  
8.3 29.28   13.14867431 29.16763054 3   2   0   0  
8.5 29.02   13.37031102 29.40620646 2   2   0   0  
10  29.25   9.80081831  29.29252644 2   1   4   0  
11  29.81   6.219508767 29.02752455 2   1   2   0  
11  29.81   5.528110919 29.0275245  2   1   2   0  
11  29.81   5.000346763 29.0275245  2   1   1   0  
7.8 29.66   3.969359786 28.99186977 2   1   7   1  
4   30.03   2.969666548 28.69963259 1   1   0   0  
4   30.03   3.04603305  28.6996326  1   1   2   0  
4   30.03   3.518844779 28.6996326  1   1   2   0  
10  29.7    9.389445598 29.00093723 2   1   0   0  
9.5 29.68   12.35980725 29.14512854 3   1   0   0  
9.2 29.68886    7.600460524 29.04483    2   1   0   0  
11  29.87   5.036949007 28.99164911 2   2   0   0  
5.8 29.33   0.857344694 29.15070369 2   2   0   0  
11.5    29.34   5.270453212 29.2511809  2   1   0   0  
10.5    29.13   7.620376215 29.41252301 2   2   0   0  
11  29.11   12.43655259 29.44484927 3   1   0   0  
11  29.19   8.003988425 29.34246753 3   1   0   0  
11  29.66   3.194525736 29.08453485 2   1   0   0  
4.7 29.85   1.07590107  28.871956   2   1   0   0  
12  29.74   3.406281332 29.07606789 3   1   0   0  
12.6    29.69   4.470762347 29.05327726 2   1   0   0  
11.5    29.9    3.410955138 28.98043804 2   1   13  1  
11  29.62   9.783137665 29.12836693 3   1   0   0  
11  29.6    12.36742671 29.24636957 3   1   0   0  
11.5    29.62   8.697637689 29.04891793 3   1   0   0  
12.5    29.73   4.633373317 28.96325035 3   1   0   0  
6.5 30.08   0.828870815 28.79464769 3   1   0   0  
12.5    29.82   3.26276353  28.95562644 3   2   2   0  
13  29.58   9.067819425 29.17236731 3   1   0   0  
12.5    29.18   9.182096085 29.4553741  3   1   0   0  
13.5    29.91351    4.868906575 28.93683    3   1   0   0  
8.5 29.73477    3.404373434 29.13679    3   1   0   0  
5.5 29.69   4.142661209 29.41040454 3   1   0   0  
13.5    29.76791    5.239392512 29.02875    3   1   0   0  
13.5    29.94902    6.982683414 28.96435    3   1   5   0  
15.5    29.96003    7.400368992 28.99043    3   1   0   0  
12.5    29.37   5.766773774 29.23295073 3   1   0   0  
4   29.7    2.154222459 29.05385606 1   1   0   0  
13.5    30.10941    7.676737927 28.85073    3   1   0   0  
14  29.38   7.458393659 31.48782252 3   1   0   0  
9.5 29.59   2.774917784 29.07360676 3   1   0   0  
1.7 29.64   1.66547717  29.12961848 1   1   0   0  
13  29.6    4.654906952 29.12056903 3   1   0   0  
14.5    29.68   8.180363812 29.08565885 3   1   0   0  
12.5    30.02   5.00907329  28.99431746 3   1   0   0  
9.5 29.98   4.356557059 28.97213912 2   1   3   0  
7.3 30.11   4.259060003 28.88830059 2   1   1   0  
7.8 29.42   4.173517999 29.20261129 2   1   0   0  
13  29.49   5.062757777 29.19354435 3   1   0   0  
14.5    29.81   8.168807109 29.04734245 3   1   0   0  
12.5    29.72   4.491526504 29.08147121 3   1   2   0  
7.8 29.79   2.633742228 29.05268089 2   1   3   0  
2.6 29.96   1.929356287 28.89206476 1   1   0   0  
12.5    29.98   4.34165668  28.99189556 3   1   0   0  
13.5    30.05   7.491453522 28.94355434 3   1   0   0  
13.5    30.11   7.653779493 28.84895757 3   1   0   0  
7.5 30.25   2.791320694 28.82509285 3   1   0   0  
6.1 30.17   2.336981796 28.88549773 2   1   2   0  
3.5 30.17   2.061542531 28.75464078 1   1   0   0  
12  30.03   6.091402123 28.92262233 3   1   0   0  
13  29.96   7.351647185 28.9905203  3   1   0   0  
10  29.97   4.051074474 28.97152239 3   1   0   0  
11.5    29.57   4.088863626 29.22473448 3   2   0   0  
8   29.68   4.256975401 29.13191018 2   1   0   0  
5.2 29.8    4.586146937 29.05327783 2   2   0   0  
12.5    29.84   4.543197975 28.9832718  3   1   0   0  
13  29.94   7.833093244 28.96307407 3   1   0   0  
12.5    29.89   9.144613493 29.04554093 3   1   0   0  
12  30.2    8.075421041 28.84808374 3   1   9   0  
12  30.13   3.397139461 28.83056079 3   1   3   0  
6   30.41   0.860964384 28.77647084 1   1   0   0  
11.5    30.32   4.640321257 28.77074787 2   2   0   0  
11  30.04   9.186577221 28.9954599  2   2   0   0  
11  30.03   8.697804137 28.89638697 3   2   0   0  
13.5    29.89   4.456552268 28.99949653 3   1   0   0  
11.5    29.68   8.507109451 29.17158242 2   1   0   0  
11  29.62   12.40655521 29.08202989 3   1   0   0  
11  29.72   7.546991932 29.10137027 2   1   0   0  
11.5    29.94   4.35468665  28.9762505  2   1   3   0  
6.1 30.69   1.072825086 28.6061417  2   1   0   0  
11  29.99   5.5133099   29.0318527  2   1   0   0  
10.5    29.84   6.626526816 29.10181508 2   2   0   0  
9.7 29.67   9.042345068 29.13790526 2   2   0   0  
11  29.45   8.958467514 29.31071781 3   2   0   0  
10.5    29.31   11.25229821 29.31599407 3   1   3   0  
10  29.26   12.52833301 29.33979065 3   1   0   0  
10  29.44   11.50836371 29.2237962  3   1   0   0  
10.5    29.62   9.275779598 29.1747051  2   1   4   0  
11.5    29.88   6.387971806 29.05159431 2   1   3   1  
3   30.65   2.925534703 28.59700414 1   2   0   0  
3   30.65   2.95143391  28.5970041  1   2   0   0  
5.2 30.55   3.035058163 28.70080146 2   2   1   0  
11  29.93   6.392332943 28.98879354 2   2   0   0  
9.5 30.16   10.51055811 28.92416139 2   1   0   0  
8.6 30.28   13.13013301 28.81390704 2   1   0   0  
10  30.27   8.601104713 28.83939199 2   1   3   0  
4.8 31  6.000112942 28.40077275 1   1   0   0  
9.5 30.18   8.115770305 28.8729779  2   2   0   0  
9.5 30.21   9.750799982 28.83561219 2   2   9   0  
7.7 30.03   14.58064239 29.03429269 2   2   0   0  
8.2 29.86   8.845254785 29.15575186 2   2   0   0  
8.3 29.72   10.3772397  29.24006972 2   2   0   0  
9.2 29.28   10.31273195 29.10769452 2   1   0   0  
6.3 29.74   12.98825657 29.03644802 3   2   0   0  
7.3 29.8    13.91169967 29.06648402 3   2   3   1  
3.7 30.7    11.84831414 28.58734126 2   1   0   0  
8.7 29.95   13.28521649 29.03606134 3   1   0   0  
9   29.71   13.14053493 28.71780474 2   1   0   0  
9.7 29.89   12.87993308 29.14437938 3   2   0   0  
7.6 30.12   9.455180322 28.84305653 3   2   0   0  
4.8 30.64   8.707607728 28.68711376 2   1   0   0  
9.5 30.16   10.60603263 28.93722371 3   1   0   0  
8.1 29.95   14.57068664 29.02287847 3   2   0   0  
7.8 29.81   7.202404567 28.90891816 2   2   0   0  
8.5 29.56   9.023794322 29.17772807 1   2   0   0  
7.5 29.77   9.574542688 28.8667924  1   2   0   0  
3.5 30.3    12.3168118  28.45642915 1   2   0   0  
6.7 30.12   9.560253351 28.70551897 2   2   4   0  
8.5 30.27   7.490584684 28.79366833 2   2   3   0  
8.1 30.15   7.410217507 28.75330851 2   2   0   0  
8.1 30.31   7.243489619 28.66573738 2   1   0   0  
7   30.36   5.896232688 28.62990971 2   1   0   0  
3   30.83   7.729748361 28.14412878 1   1   0   0  
5.2 31.15   6.077294196 27.88537887 1   2   10  1  
6   31.2    5.74378923  27.89556857 1   2   1   0  
6.1 31.21   5.410054727 27.90270428 1   2   1   0  
5   30.91   4.553877677 28.07274257 2   2   0   0  
3.6 31.2    2.953496489 27.80606412 2   1   0   0  
4.6 31.45   2.972738218 27.60899237 1   1   4   0  
3.1 31.4    3.647301445 27.56684719 1   1   0   0  
4.1 31.53   2.013234743 27.26023996 1   3   0   0  
4.5 26.47   1.936861246 32.77   2   3   1   1  
1.7 25.65   3.611281423 32.82   1   1   0   0  
5.1 26.35   2.76293324  32.8    1   2   2   0  
3.8 26.85   2.988773196 32.7    1   1   0   0  
5.2 27.01   4.545916234 32.64   1   2   0   0  
5.2 27.01   4.553999774 32.63   1   1   1   0  
6   26.93   4.790281894 32.7    1   1   0   0  
6.1 27.13   4.982764741 32.6    1   1   1   0  
5.4 27.08   5.631690158 32.6    1   1   4   0  
3.7 24.93   7.930438823 32.64236    1   2   0   0  
6.9 27.29   6.170235535 32.58   1   2   1   0  
6.8 27.39   5.98615462  32.59   1   1   0   0  
7.5 27.43   7.269733065 32.69   1   2   0   0  
6.2 27.61   8.869036609 32.61   1   1   0   0  
3   27.45   12.3814557  32.75   1   1   0   0  
3.3 26.71   12.40168154 32.79   1   2   0   0  
7.1 27.14   9.554706483 32.58   1   3   0   0  
8.1 26.91   9.059168735 32.62   1   3   0   0  
7.4 27.22   10.4331513  32.57   1   1   0   0  
8.7 27.13   10.28904374 32.61   1   3   0   0  
9.1 27.15   10.45752513 32.59   1   1   2   0  
9.1 27.15   10.64100531 32.59   1   1   1   1  
9.1 27.24   10.84024546 32.62   1   1   2   1  
5.8 27.25   13.66171736 32.64   1   1   0   0  
3.4 27.24   12.27719603 32.98   1   2   0   0  
2.6 26.42   11.96951493 32.73   1   1   0   0  
8   26.82   13.58752573 32.58   1   3   0   0  
9.3 26.74   13.25348719 32.66   1   3   4   1  
9.3 26.91   13.04072258 32.73   1   3   2   0  
9   26.59   13.13052031 32.75   1   3   0   0  
9.5 27.05   12.98995003 32.72   1   1   0   0  
6.1 27.39   9.33700795  32.76   1   2   0   0  
4.7 27.68   8.860754017 32.83   1   2   0   0  
9.8 27.16   10.42085676 32.74   1   1   0   0  
10.6    27.05   9.0147051   32.82   1   1   0   0  
5.5 26.55   6.137115111 32.78708    1   1   0   0  
4.7 26.46   3.1810468   32.85   1   1   0   0  
8.372993    26.33   5.366827653 32.79   1   3   0   0  
8.3 26.11   8.364940423 32.89   1   3   0   0  
10.4    26.18   7.576045416 32.82   1   1   0   0  
2.3 26.77   0.646188602 32.81   1   1   0   0  
4   26.11   2.676012951 32.87   2   1   0   0  
9.7 26.06   4.517188945 32.9    1   2   5   0  
10.7    26.07   5.482313705 32.89   1   1   15  0  
10.9    25.86   7.288018822 32.9    1   3   2   0  
8.3 25.49   13.09703714 32.87   1   2   0   0  
8.7 25.54   12.54850768 32.75   1   1   5   0  
10.4    25.96   8.755025322 32.75   1   1   0   0  
10.7    26.14   7.939864687 32.85   1   2   3   1  
4.3 26.56   6.031308177 32.77   1   1   0   0  
9.4 26.22   10.42148038 32.78   1   1   0   0  
8.3 25.73   14.54966766 32.69   1   3   0   0  
10.1    26.27   9.066946569 32.96   1   1   0   0  
11.2    25.93   12.39996638 32.7806 1   1   0   0  
11  26.31   7.5398252   32.75   1   2   0   0  
11.2    26.29   6.88134427  32.72   1   3   1   0  
9.3 26.28   2.049234294 32.83   1   3   0   0  
5   26.48   0.76436598  32.89   1   2   0   0  
12.1    26.335  4.477933643 32.76207    1   2   0   0  
11.1    25.63   9.643440162 32.77   1   2   0   0  
10.9    25.54   12.38104264 32.84   1   2   0   0  
11.4    25.78   8.632018256 32.73   1   2   0   0  
11.6    25.83   9.159043774 32.86   1   2   0   0  
11.9    26.16   7.214526544 32.78   1   1   4   0  
10.5    26.51   1.921833117 32.75   1   1   0   0  
6.3 26.34   0.826710181 32.89   1   1   0   0  
12.3    26.62   5.023862758 32.72   1   2   0   0  
12.9    25.91   8.08180253  32.82   1   3   1   0  
12.6    26.75   9.118365869 32.8    1   2   0   0  
12.6    26.59   6.1223438   32.75   1   1   2   0  
12.7    26.7    5.950026524 32.87   1   1   1   0  
8.8 26.78   3.522094106 32.86   1   2   0   0  
5   26.56   4.305294146 32.82   1   2   0   0  
12.8    26.76   4.928382663 32.75   1   2   3   1  
13.4    26.72   7.33733834  32.83   1   2   0   0  
13.6    25.83   7.392709162 32.87   1   3   0   0  
11.8    26.05   5.916364458 32.83   1   2   0   0 
2.5 26.12   1.879579704 32.9    1   2   0   0  
10.5    26.13   4.004376931 32.75   1   2   5   0  
13.4    26.22   7.621839315 32.75   1   2   0   0  
13.9    26.3    7.470786139 32.8    1   2   0   0  
9.5 26.34   2.635667496 32.89   1   2   0   0  
1.5 26.58   1.886167311 33.01   1   2   0   0  
7.1 26.35   4.309524603 32.72   1   2   0   0  
13.1    26.45   5.832630407 32.84   1   2   0   0  
14.4    26.37   8.178365664 32.84   1   2   0   0  
11  26.58   3.85694089  32.84   1   1   0   0  
3.2 26.54   2.213665632 32.95   1   3   0   0  
7.8 25.97   4.26858637  32.81   1   3   0   0  
9.5 25.92   4.196378687 32.89   1   3   3   0  
12.1    25.99   4.619408132 32.85   1   3   5   0  
14.4    25.95   7.92443959  32.82   1   2   0   0  
14.1    26.13   8.188787243 32.79   1   2   0   0  
13.7    25.99   5.817045957 32.72   2   1   3   0  
13.2    26.42   4.975641002 32.82   1   1   0   0  
11.3    26.09   4.158203563 32.79   2   1   2   0  
11.3    26.09   3.717719323 32.79   2   1   3   0  
2.7 26.22   1.926657466 32.93   1   2   0   0  
11.3    26.64   3.984972891 32.83   1   2   0   0  
11.3    26.64   4.302636245 32.83   1   2   2   0  
12  26.26   4.868786075 32.78   1   3   1   0  
13.2    26.73   7.33867965  32.81   1   2   1   0  
13.3    26.45   7.505326543 32.81   1   2   0   0  
13.4    26.36   7.655497249 32.85   1   2   0   0  
10  26.84   4.392261535 32.84   1   2   2   0  
3.3 27.14   1.635868338 32.98   1   2   0   0  
12  26.97   6.059146718 32.86   1   3   0   0  
13.1    26.87   7.330404224 32.86   1   2   0   0  
11  25.75   2.550645674 32.92   1   3   0   0  
13.8    25.62   7.359628796 32.96   1   2   0   0  
13.2    25.97   4.204313203 32.87   1   1   3   0  
16.1    25.98   3.931741914 33  1   3   1   0  
5.5 26.24   4.419553483 32.87   1   1   0   0  
11.1    26.16   3.494532097 32.81   1   1   1   0  
11.3    26.08   3.625707911 32.86   1   2   3   0  
13.4    26.48   6.967947604 32.8    1   1   0   0  
13.2    26.55   9.14483713  32.8    1   1   0   0  
12.2    26.46   4.128193493 32.94   1   1   0   0  
6.2 26.7    0.839726378 33  1   1   0   0  
12  26.68   4.989643532 32.98   1   2   0   0  
11.2    26.55   8.084378239 32.96   1   3   1   0  
12.4    26.65   8.652134914 33  1   1   0   0  
10.9    26.34   9.104442941 32.96   1   3   0   0  
12.9    25.94   4.473138178 32.9    1   1   0   0  
11.7    26.42   9.166145778 32.67   1   1   0   0  
11.8    26.51   12.37305389 32.57   1   2   0   0  
11.7    26.24   7.332765348 32.92   1   1   0   0  
12.2    26.35   4.396652102 32.88   1   1   5   0  
12.3    26.12   3.960103363 32.91   1   1   1   0  
12.3    26.12   3.525125176 32.91   1   1   1   0  
4.3 26.72   0.686421186 32.91   1   1   0   0  
11.8    26.51   3.999631548 32.89   1   2   2   1  
12  26.56   4.29402447  32.71   3   2   1   0  
10.4    27.18   8.676283115 32.84   1   1   1   0  
10.2    26.62   9.416393288 32.72   1   2   2   0  
9.6 27.48   12.49056063 32.52   1   2   0   0  
9.3 26.96   11.37553511 32.61   1   1   1   0  
10.8    26.84   6.364116525 32.94   1   2   0   0  
4.6 26.97   2.928647782 33.07   1   2   0   0  
3.4 26.46   2.841736021 33.03   1   3   0   0  
11.5    26.21   6.528943448 32.87   1   2   0   0  
9.7 26.47   11.65671968 32.76   1   2   0   0  
9.1 26.81   13.13085241 32.71   1   2   0   0  
8.9 26.5    10.35085054 32.97   1   1   2   0  
10.3    26.24   9.428661525 32.94   1   1   5   0  
10.7    26.21   8.711508391 33.05   1   2   7   0  
4.5 26.9    5.998816439 33.15   1   2   0   0  
10.4    26.83   9.390238203 33.07   1   2   0   0  
8.6 26.32   10.99214749 33.01   1   2   2   0  
8.5 26.13   14.53967166 32.93   1   2   0   0  
9.4 26.91   11.97222959 33.04   1   2   2   0  
9.1 26.81   10.69169582 32.99   1   2   2   0  
3.9 27.9    8.712436523 33.08   1   3   0   0  
6.5 27.21   9.763665166 32.97   1   2   3   0  
7.1 27.38   10.13856796 33.06   3   2   7   0  
8.7 27.03   13.03044331 33.04   1   2   0   0  
8.6 26.71   13.1200947  33.02   1   3   0   0  
8.5 26.45   13.11099202 33.16   1   2   0   0  
9.8 26.49   13.93612654 33.07   1   1   1   0  
9.8 26.72   13.59306787 33.23   1   1   1   0  
8.4 26.99   12.59045136 32.94   1   1   2   0  
5.9 26.89   11.78406859 33.05   1   2   1   0  
2.7 27.92   11.73670573 33.11   1   1   0   0  
7.1 27.49   13.89237165 32.97   2   2   0   0  
9.2 26.64   11.54959123 33  1   2   2   0  
9.5 27.46   10.75675741 33.08   1   1   1   0  
8.8 27.15   10.29719857 33.05   1   3   0   0  
7.1 27.3    10.36571776 33.18   1   1   0   0  
7.9 26.86   9.067479051 32.98   1   3   0   0  
6.9 27.35   9.929454709 33.12   1   2   0   0  
2.5 28.66   12.40081634 33.1    1   1   0   0  
4.2 26.68051    1.999096419 33.20698    1   1   0   0  
1.4 26.62   3.658323174 33.13   2   2   0   0  
3.7 26.68   2.969692048 33.21   2   2   0   0  
4.9 26.54   4.541368702 33.2    1   3   0   0  
5.4 26.39   5.654485707 33.34   1   1   3   0  
2   27.47   8.003006041 33.14   1   1   0   0  
6.9 26.88   6.043154453 33.16   1   3   2   1  
6.9 26.85   5.98216496  33.14   1   3   1   0  
6.6 26.94   5.985144971 33.24   1   3   0   0  
7.6 26.89   7.535159504 33.2    1   1   0   0  
7.4 26.72   7.235677019 33.14   1   1   0   0  
7.9 27.17   7.212905221 33.21   1   3   1   0  
5.5 27.38   9.404652742 33.11   1   2   0   0  
3.1 26.93   12.40175438 33.15791    1   1   0   0  

# data for the hurdle model. 
depth   temp    dr  salinity    turbidity   chl pH  sightings   calves  
4.5 26.47   1.936861246 32.77   2   3   7.88    0   0 
1.7 25.65   3.611281423 32.82   1   1   7.85    0   0 
5.1 26.35   2.76293324  32.8    1   2   7.91    2   0 
3.8 26.85   2.988773196 32.7    1   1   7.92    0   0 
5.2 27.01   4.545916234 32.64   1   2   7.95    0   0 
5.2 27.01   4.553999774 32.63   1   1   8   1   0 
6   26.93   4.790281894 32.7    1   1   8.09    0   0 
6.1 27.13   4.982764741 32.6    1   1   8.02    1   0 
5.4 27.08   5.631690158 32.6    1   1   8.02    4   0 
3.7 24.93   7.930438823 32.64236    1   2   7.56    0   0 
6.9 27.29   6.170235535 32.58   1   2   8.01    1   0 
6.8 27.39   5.98615462  32.59   1   1   8.01    0   0 
7.5 27.43   7.269733065 32.69   1   2   8.06    0   0 
6.2 27.61   8.869036609 32.61   1   1   8.08    0   0 
3   27.45   12.3814557  32.75   1   1   8.12    0   0 
3.3 26.71   12.40168154 32.79   1   2   8.15    0   0 
7.1 27.14   9.554706483 32.58   1   3   7.96    0   0 
8.1 26.91   9.059168735 32.62   1   3   8.04    0   0 
7.4 27.22   10.4331513  32.57   1   1   8.14    0   0 
8.7 27.13   10.28904374 32.61   1   3   8.08    0   0 
9.1 27.15   10.45752513 32.59   1   1   8.04    2   0 
9.1 27.15   10.64100531 32.59   1   1   8.04    1   1 
9.1 27.24   10.84024546 32.62   1   1   8.08    2   1 
5.8 27.25   13.66171736 32.64   1   1   8.13    0   0 
3.4 27.24   12.27719603 32.98   1   2   8.08    0   0 
2.6 26.42   11.96951493 32.73   1   1   8   0   0 
8   26.82   13.58752573 32.58   1   3   8.02    0   0 
9.3 26.74   13.25348719 32.66   1   3   7.99    4   1 
9.3 26.91   13.04072258 32.73   1   3   8.01    2   0 
9   26.59   13.13052031 32.75   1   3   8.02    0   0 
9.5 27.05   12.98995003 32.72   1   1   8.11    0   0 
6.1 27.39   9.33700795  32.76   1   2   8.1 0   0 
4.7 27.68   8.860754017 32.83   1   2   8.06    0   0 
9.8 27.16   10.42085676 32.74   1   1   8.02    0   0 
10.6    27.05   9.0147051   32.82   1   1   8.09    0   0 
5.5 26.55   6.137115111 32.78708    1   1   7.69    0   0 
4.7 26.46   3.1810468   32.85   1   1   7.91    0   0 
8.372993    26.33   5.366827653 32.79   1   3   7.91    0   0 
8.3 26.11   8.364940423 32.89   1   3   7.99    0   0 
10.4    26.18   7.576045416 32.82   1   1   8.06    0   0 
2.3 26.77   0.646188602 32.81   1   1   8.21    0   0 
4   26.11   2.676012951 32.87   2   1   7.09    0   0 
9.7 26.06   4.517188945 32.9    1   2   7.53    5   0 
10.7    26.07   5.482313705 32.89   1   1   7.59    15  0 
10.9    25.86   7.288018822 32.9    1   3   7.7 2   0 
8.3 25.49   13.09703714 32.87   1   2   7.58    0   0 
8.7 25.54   12.54850768 32.75   1   1   7.77    5   0 
10.4    25.96   8.755025322 32.75   1   1   7.72    0   0 
10.7    26.14   7.939864687 32.85   1   2   7.92    3   1 
4.3 26.56   6.031308177 32.77   1   1   7.86    0   0 
9.4 26.22   10.42148038 32.78   1   1   7.93    0   0 
8.3 25.73   14.54966766 32.69   1   3   7.71    0   0 
10.1    26.27   9.066946569 32.96   1   1   8.14    0   0 
11.2    25.93   12.39996638 32.7806 1   1   8.1 0   0 
11  26.31   7.5398252   32.75   1   2   8.05    0   0 
11.2    26.29   6.88134427  32.72   1   3   8.02    1   0 
9.3 26.28   2.049234294 32.83   1   3   8.05    0   0 
5   26.48   0.76436598  32.89   1   2   8.04    0   0 
12.1    26.335  4.477933643 32.76207    1   2   7.15    0   0 
11.1    25.63   9.643440162 32.77   1   2   7.76    0   0 
10.9    25.54   12.38104264 32.84   1   2   7.71    0   0 
11.4    25.78   8.632018256 32.73   1   2   8.16    0   0 
11.6    25.83   9.159043774 32.86   1   2   8.04    0   0 
11.9    26.16   7.214526544 32.78   1   1   8.18    4   0 
10.5    26.51   1.921833117 32.75   1   1   8.07    0   0 
6.3 26.34   0.826710181 32.89   1   1   8.16    0   0 
12.3    26.62   5.023862758 32.72   1   2   7.9 0   0 
12.9    25.91   8.08180253  32.82   1   3   7.91    1   0 
12.6    26.75   9.118365869 32.8    1   2   7.94    0   0 
12.6    26.59   6.1223438   32.75   1   1   8.04    2   0 
12.7    26.7    5.950026524 32.87   1   1   7.96    1   0 
8.8 26.78   3.522094106 32.86   1   2   8.07    0   0 
5   26.56   4.305294146 32.82   1   2   8.05    0   0 
12.8    26.76   4.928382663 32.75   1   2   8.03    3   1 
13.4    26.72   7.33733834  32.83   1   2   8.04    0   0 
13.6    25.83   7.392709162 32.87   1   3   7.73    0   0 
11.8    26.05   5.916364458 32.83   1   2   8.05    0   0 
2.5 26.12   1.879579704 32.9    1   2   7.88    0   0 
10.5    26.13   4.004376931 32.75   1   2   7.87    5   0 
13.4    26.22   7.621839315 32.75   1   2   7.94    0   0 
13.9    26.3    7.470786139 32.8    1   2   8.1 0   0 
9.5 26.34   2.635667496 32.89   1   2   8.13    0   0 
1.5 26.58   1.886167311 33.01   1   2   8.24    0   0 
7.1 26.35   4.309524603 32.72   1   2   8.01    0   0 
13.1    26.45   5.832630407 32.84   1   2   7.98    0   0 
14.4    26.37   8.178365664 32.84   1   2   8.03    0   0 
11  26.58   3.85694089  32.84   1   1   8.1 0   0 
3.2 26.54   2.213665632 32.95   1   3   8.1 0   0 
7.8 25.97   4.26858637  32.81   1   3   7.94    0   0 
9.5 25.92   4.196378687 32.89   1   3   7.98    3   0 
12.1    25.99   4.619408132 32.85   1   3   7.93    5   0 
14.4    25.95   7.92443959  32.82   1   2   7.99    0   0 
14.1    26.13   8.188787243 32.79   1   2   7.88    0   0 
13.7    25.99   5.817045957 32.72   2   1   8.03    3   0 
13.2    26.42   4.975641002 32.82   1   1   8.16    0   0 
11.3    26.09   4.158203563 32.79   2   1   8.03    2   0 
11.3    26.09   3.717719323 32.79   2   1   8.03    3   0 
2.7 26.22   1.926657466 32.93   1   2   8.04    0   0 
11.3    26.64   3.984972891 32.83   1   2   8.02    0   0 
11.3    26.64   4.302636245 32.83   1   2   8.02    2   0 
12  26.26   4.868786075 32.78   1   3   8.03    1   0 
13.2    26.73   7.33867965  32.81   1   2   8.03    1   0 
13.3    26.45   7.505326543 32.81   1   2   8.05    0   0 
13.4    26.36   7.655497249 32.85   1   2   8.07    0   0 
10  26.84   4.392261535 32.84   1   2   8.09    2   0 
3.3 27.14   1.635868338 32.98   1   2   8.06    0   0 
12  26.97   6.059146718 32.86   1   3   8.07    0   0 
13.1    26.87   7.330404224 32.86   1   2   8.05    0   0 
11  25.75   2.550645674 32.92   1   3   7.9 0   0 
13.8    25.62   7.359628796 32.96   1   2   7.94    0   0 
13.2    25.97   4.204313203 32.87   1   1   7.98    3   0 
16.1    25.98   3.931741914 33  1   3   8.07    1   0 
5.5 26.24   4.419553483 32.87   1   1   7.95    0   0 
11.1    26.16   3.494532097 32.81   1   1   7.98    1   0 
11.3    26.08   3.625707911 32.86   1   2   8.06    3   0 
13.4    26.48   6.967947604 32.8    1   1   8.01    0   0 
13.2    26.55   9.14483713  32.8    1   1   8.05    0   0 
12.2    26.46   4.128193493 32.94   1   1   8.17    0   0 
6.2 26.7    0.839726378 33  1   1   8.18    0   0 
12  26.68   4.989643532 32.98   1   2   8.15    0   0 
11.2    26.55   8.084378239 32.96   1   3   8.1 1   0 
12.4    26.65   8.652134914 33  1   1   8.16    0   0 
10.9    26.34   9.104442941 32.96   1   3   8.13    0   0 
12.9    25.94   4.473138178 32.9    1   1   7.9 0   0 
11.7    26.42   9.166145778 32.67   1   1   7.92    0   0 
11.8    26.51   12.37305389 32.57   1   2   7.97    0   0 
11.7    26.24   7.332765348 32.92   1   1   8.02    0   0 
12.2    26.35   4.396652102 32.88   1   1   8.07    5   0 
12.3    26.12   3.960103363 32.91   1   1   8.1 1   0 
12.3    26.12   3.525125176 32.91   1   1   8.1 1   0 
4.3 26.72   0.686421186 32.91   1   1   8.02    0   0 
11.8    26.51   3.999631548 32.89   1   2   8.01    2   1 
12  26.56   4.29402447  32.71   3   2   7.91    1   0 
10.4    27.18   8.676283115 32.84   1   1   8.04    1   0 
10.2    26.62   9.416393288 32.72   1   2   8.01    2   0 
9.6 27.48   12.49056063 32.52   1   2   8.05    0   0 
9.3 26.96   11.37553511 32.61   1   1   8.14    1   0 
10.8    26.84   6.364116525 32.94   1   2   8.14    0   0 
4.6 26.97   2.928647782 33.07   1   2   8.09    0   0 
3.4 26.46   2.841736021 33.03   1   3   7.72    0   0 
11.5    26.21   6.528943448 32.87   1   2   6.71    0   0 
9.7 26.47   11.65671968 32.76   1   2   7.65    0   0 
9.1 26.81   13.13085241 32.71   1   2   7.73    0   0 
8.9 26.5    10.35085054 32.97   1   1   8.01    2   0 
10.3    26.24   9.428661525 32.94   1   1   7.86    5   0 
10.7    26.21   8.711508391 33.05   1   2   7.88    7   0 
4.5 26.9    5.998816439 33.15   1   2   8   0   0 
10.4    26.83   9.390238203 33.07   1   2   7.72    0   0 
8.6 26.32   10.99214749 33.01   1   2   7.85    2   0 
8.5 26.13   14.53967166 32.93   1   2   7.85    0   0 
9.4 26.91   11.97222959 33.04   1   2   7.88    2   0 
9.1 26.81   10.69169582 32.99   1   2   7.9 2   0 
3.9 27.9    8.712436523 33.08   1   3   7.9 0   0 
6.5 27.21   9.763665166 32.97   1   2   7.88    3   0 
7.1 27.38   10.13856796 33.06   3   2   7.8 7   0 
8.7 27.03   13.03044331 33.04   1   2   7.86    0   0 
8.6 26.71   13.1200947  33.02   1   3   7.75    0   0 
8.5 26.45   13.11099202 33.16   1   2   7.37    0   0 
9.8 26.49   13.93612654 33.07   1   1   7.74    1   0 
9.8 26.72   13.59306787 33.23   1   1   7.7 1   0 
8.4 26.99   12.59045136 32.94   1   1   7.62    2   0 
5.9 26.89   11.78406859 33.05   1   2   7.91    1   0 
2.7 27.92   11.73670573 33.11   1   1   7.7 0   0 
7.1 27.49   13.89237165 32.97   2   2   7.44    0   0 
9.2 26.64   11.54959123 33  1   2   6.81    2   0 
9.5 27.46   10.75675741 33.08   1   1   7.43    1   0 
8.8 27.15   10.29719857 33.05   1   3   7.48    0   0 
7.1 27.3    10.36571776 33.18   1   1   7.64    0   0 
7.9 26.86   9.067479051 32.98   1   3   7.50461 0   0 
6.9 27.35   9.929454709 33.12   1   2   7.55    0   0 
2.5 28.66   12.40081634 33.1    1   1   7.56    0   0 
4.2 26.68051    1.999096419 33.20698    1   1   7.408918    0   0 
1.4 26.62   3.658323174 33.13   2   2   6.98    0   0 
3.7 26.68   2.969692048 33.21   2   2   7.42    0   0 
4.9 26.54   4.541368702 33.2    1   3   7.56    0   0 
5.4 26.39   5.654485707 33.34   1   1   7.72    3   0 
2   27.47   8.003006041 33.14   1   1   7.58    0   0 
6.9 26.88   6.043154453 33.16   1   3   7.26    2   1 
6.9 26.85   5.98216496  33.14   1   3   7.04    1   0 
6.6 26.94   5.985144971 33.24   1   3   7.83    0   0 
7.6 26.89   7.535159504 33.2    1   1   7.46    0   0 
7.4 26.72   7.235677019 33.14   1   1   7.33    0   0 
7.9 27.17   7.212905221 33.21   1   3   6.93    1   0 
5.5 27.38   9.404652742 33.11   1   2   7.55188 0   0 
3.1 26.93   12.40175438 33.15791    1   1   7.554546    0   0 
$\endgroup$
  • $\begingroup$ This is going to be difficult to answer as posted. Can you paste in tour data and your model output? $\endgroup$ – gung - Reinstate Monica Jun 2 '16 at 14:04
  • $\begingroup$ I just added in the data and output. $\endgroup$ – Justine Jun 2 '16 at 16:23
  • $\begingroup$ Why do you have 2 different datasets for the models? $\endgroup$ – gung - Reinstate Monica Jun 2 '16 at 21:34
  • $\begingroup$ @Justine Your questions are not clear. What do you mean by "plot of the results against the original explanatory variables"? And what exactly is "the "optimal" values of the significant environmental variables"? Define "optimal". $\endgroup$ – horaceT Jun 2 '16 at 22:28
  • $\begingroup$ Data collection was performed over several years by different people and there were equipment problems, so I made different datasets depending on data availability for the different years of the study. I then modeled all combinations of variables for each dataset and the resulting best models ended up being from the analyses of different datasets. $\endgroup$ – Justine Jun 3 '16 at 13:54
1
$\begingroup$

I have several comments. I'm not sure whether they qualify for an answer but they might help you get a few steps further.

For exploratory displays you can simply use the hurdle idea and generate plots of (a) the binarized response (=0 vs. >0) against the regressors and (b) the truncated subset positive (log-)count response against the regressors. For your hdata1 and the regressor depth this yields:

plot(factor(sightings == 0) ~ depth, data = hdata1, main = "Zero")
plot(log(sightings) ~ depth, data = hdata1, subset = sightings > 0,
  main = "Count")

exploratory plots

These show that for the binary zero hurdle a quadratic ploy(depth, 2) would probably fit much better. And for the positive counts no particular relationship pops out. In short, the dolphins have been sighted at medium depths but given that there were sightings the depth does not seem to lead to more or less frequent sightings. (Of course, this is just a marginal plot but the formal models seem to support this.)

You can also try to add fitted regression lines into these plots, e.g., by fixing all regressors at their means (or other typical values) and then varying only the current regressor of interest. But I'm not sure whether this is what you're after.

As for the two data sets and two models, I'm still not convinced how you got to your solution. For you hdata1 the zeroinfl() and hurdle() models seem more or less equivalent with the latter being slightly better.

m1 <- zeroinfl(sightings ~ temp + salinity + turbidity + dr + calves +
  depth + chl, data = hdata1, dist = "negbin")
m2 <- hurdle(sightings ~ temp + salinity + turbidity + dr + calves +
  depth + chl, data = hdata1, dist = "negbin")
AIC(m1, m2)
##    df      AIC
## m1 17 786.9758
## m2 17 784.9835

Note also that there is quasi-separation in the data with respect to the calves variable - hence the large coefficient and the even larger standard error. (For the 14 observations with calves > 0 there are no observations with sightings == 0.)

Finally, the two parts of the models may have different regressors. It seems worth exploring this because in your current version many variables are still non-significant. Thus, something like:

m3 <- hurdle(sightings ~ temp + salinity + turbidity + calves |
  poly(depth, 2) + turbidity + calves, data = hdata1, dist = "negbin")
AIC(m3)
## [1] 765.3405

yields an even better AIC. I didn't check a cross-validation, AUC, etc., though.

$\endgroup$
  • $\begingroup$ Thanks so much! To get to the two different models, I used AIC, CV, and LR to compare within types of models (zeroinfl, hurdle), then used AUC to compare between types of models. I had thought that AIC wasn't always comparable for different model types, so chose to use a combination of different tests to choose the best one. So, within the set of hurdle models run, those using hdata2 had a better AIC than m2, but CV and LR test favored the zeroinfl run with hdata1. Using only AIC, models run with hdata2 are quite a bit better. Would you suggest giving more weight to AIC than the other two? $\endgroup$ – Justine Jun 7 '16 at 15:44
  • $\begingroup$ Well, the usual caveats about model selection apply. LR tests can only be applied to nested models and you can create multiple testing problems. AIC and BIC are alternatives then for model selection. CV is particularly useful if the focus is prediction etc. So you need to decide what is most important in your case: significance testing, model selection for explanation, or prediction. $\endgroup$ – Achim Zeileis Jun 7 '16 at 18:33
  • $\begingroup$ Thanks for the insight! And thanks again for the answer! $\endgroup$ – Justine Jun 7 '16 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.