morph_mature: Estimate morphometric mature

Description Usage Arguments Details Value Examples

View source: R/morphMat-main.R

Description

Estimate size at morphometric maturity (L50).

Usage

1
morph_mature(data, method = "fq", niter = 999, seed = 70388)

Arguments

data

an object of class 'classify' with the allometric variables (X", "Y") and classification of maturity (juveniles = 0, adults = 1).

method

a character string indicating the method to be applied, "fq" frecuentist GLM, or "bayes" Bayes GLM (MCMClogit function).

niter

number of iterations (bootstrap resampling).

seed

a single value, interpreted as an integer.

Details

Estimate the size at morphometric maturity using a logistic regression with X variable and maturity classification (two categories: juveniles and adults).

The function requires an object of class "classify" with the X, Y (allometric variables) and classification of maturity (juveniles = 0, adults = 1).

The argument method requires a character string indicanting which regression will be used for the test. If method = "fq" the logistic regression is based on GLM (frequentist) and if method = "bayes" a sample from the posterior distribution of a logistic regression model using a random walk Metropolis algorithm is generated (see MCMClogit function).

The argument niter requires a number. For the GLM regression (method = "fq"), a non-parametric bootstrap method consists in generate B bootstrap samples, by resampling with replacement the original data. Then all statistics for each parameter can be calculated from each bootstrap sample (median and confidence intervals). For the method = "bayes", the argument 'niter' is related to the number of Metropolis iterations for the sampler.

Value

An object of class 'morphMat'.

model the summary statistics of the model.

A_boot the 'n iter' values of parameter A.

B_boot the 'n iter' values of parameter B.

L50 the 'n iter' values of parameter L50 (size at morphometric maturity).

out a dataframe with the allometric variables "X" and "Y", classification of maturity, the fitted values for logistic regression and confidence intervals (95%). Also the summary statistics of the model is provided.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(crabdata)

classify_data = classify_mature(crabdata, varNames = c("carapace_width", "chela_heigth"),
varSex = "sex_category", selectSex = NULL, method = "ld")

my_mature = morph_mature(classify_data, method = "fq", niter = 50)

# 'niter' parameters:
my_mature$A_boot
my_mature$B_boot
my_mature$L50_boot
my_mature$out

Example output

all individuals were used in the analysis 

 [1] -24.13558 -20.45993 -20.37518 -18.76622 -18.62390 -22.26832 -18.96877
 [8] -17.60592 -23.53690 -23.32754 -22.01717 -23.51505 -18.62596 -20.18197
[15] -23.66189 -21.17715 -19.91048 -26.52669 -25.84803 -18.73386 -22.00171
[22] -21.57044 -19.44992 -20.03090 -18.82698 -19.98365 -23.40844 -22.39302
[29] -17.16856 -20.14904 -18.51362 -20.57331 -21.95599 -21.91991 -25.64062
[36] -21.57254 -20.08713 -23.82826 -22.11090 -32.30255 -27.26060 -19.19004
[43] -18.75694 -21.41558 -22.95883 -16.45187 -21.65628 -23.71992 -22.46683
[50] -24.67100
 [1] 0.2021687 0.1721560 0.1718479 0.1566037 0.1571180 0.1905417 0.1615432
 [8] 0.1469851 0.1987730 0.1965563 0.1805896 0.1975528 0.1586003 0.1713449
[15] 0.1972462 0.1776301 0.1682797 0.2184586 0.2131618 0.1562298 0.1835099
[22] 0.1804256 0.1659272 0.1664436 0.1620909 0.1675230 0.1968614 0.1883394
[29] 0.1460865 0.1657128 0.1562467 0.1772941 0.1837239 0.1814460 0.2170858
[36] 0.1825339 0.1667409 0.2034000 0.1870389 0.2721795 0.2271221 0.1610714
[43] 0.1586804 0.1827236 0.1928935 0.1383181 0.1845637 0.1992634 0.1871627
[50] 0.2067695
 [1] 119.3833 118.8453 118.5652 119.8326 118.5345 116.8685 117.4223 119.7804
 [9] 118.4109 118.6812 121.9182 119.0317 117.4397 117.7856 119.9612 119.2205
[17] 118.3178 121.4266 121.2602 119.9122 119.8938 119.5531 117.2196 120.3465
[25] 116.1507 119.2890 118.9083 118.8972 117.5233 121.5901 118.4897 116.0406
[33] 119.5053 120.8068 118.1128 118.1838 120.4691 117.1497 118.2155 118.6811
[41] 120.0262 119.1400 118.2058 117.2021 119.0233 118.9423 117.3377 119.0380
[49] 120.0390 119.3164
      x    y mature CIlower fitted CIupper
1   106 14.0      0   0.034  0.090   0.154
2   129 27.0      1   0.785  0.858   0.917
3   119 14.6      0   0.374  0.503   0.610
4   115 18.6      1   0.212  0.327   0.444
5    97 11.0      0   0.005  0.019   0.045
6    94 10.0      0   0.003  0.012   0.030
7   158 30.5      1   0.997  0.999   1.000
8   149 29.3      1   0.987  0.995   0.999
9   132 23.4      1   0.858  0.910   0.953
10  135 24.5      1   0.903  0.947   0.975
11  147 32.0      1   0.983  0.993   0.998
12  141 26.2      1   0.959  0.981   0.993
13  128 23.2      1   0.754  0.836   0.900
14  156 32.8      1   0.995  0.999   1.000
15  121 21.4      1   0.476  0.596   0.687
16  135 25.0      1   0.903  0.947   0.975
17  138 25.2      1   0.936  0.968   0.987
18  148 29.5      1   0.985  0.994   0.998
19  137 26.7      1   0.927  0.963   0.983
20  124 22.0      1   0.607  0.718   0.803
21  119 22.0      1   0.374  0.503   0.610
22  147 29.3      1   0.983  0.993   0.998
23   93 11.2      0   0.002  0.010   0.026
24  124 16.8      0   0.607  0.718   0.803
25  132 23.0      1   0.858  0.910   0.953
26  121 20.7      1   0.476  0.596   0.687
27  111 12.5      0   0.103  0.194   0.288
28  100 11.2      0   0.009  0.032   0.068
29   57  5.9      0   0.000  0.000   0.000
30   63  7.0      0   0.000  0.000   0.000
31   50  5.1      0   0.000  0.000   0.000
32   55  6.1      0   0.000  0.000   0.000
33  153 32.2      1   0.993  0.998   0.999
34  134 28.3      1   0.889  0.937   0.969
35  143 29.0      1   0.969  0.987   0.995
36  118 21.0      1   0.331  0.455   0.570
37  115 14.7      0   0.212  0.327   0.444
38  122 21.2      1   0.520  0.637   0.728
39  114 15.2      0   0.179  0.288   0.402
40  122 21.2      1   0.520  0.637   0.728
41  154 30.2      1   0.994  0.998   1.000
42  155 33.0      1   0.995  0.998   1.000
43  154 34.2      1   0.994  0.998   1.000
44  145 27.3      1   0.977  0.991   0.997
45  153 31.0      1   0.993  0.998   0.999
46  162 36.0      1   0.998  1.000   1.000
47  163 34.8      1   0.998  1.000   1.000
48  158 33.3      1   0.997  0.999   1.000
49  134 26.2      1   0.889  0.937   0.969
50  135 25.3      1   0.903  0.947   0.975
51  162 33.3      1   0.998  1.000   1.000
52  145 28.4      1   0.977  0.991   0.997
53  116 22.0      1   0.248  0.366   0.486
54  118 21.6      1   0.331  0.455   0.570
55  118 21.0      1   0.331  0.455   0.570
56  135 26.5      1   0.903  0.947   0.975
57  157 33.2      1   0.996  0.999   1.000
58  138 27.5      1   0.936  0.968   0.987
59  143 27.2      1   0.969  0.987   0.995
60  136 23.6      1   0.916  0.956   0.980
61  136 26.3      1   0.916  0.956   0.980
62  133 27.2      1   0.875  0.925   0.962
63  137 27.0      1   0.927  0.963   0.983
64  118 22.2      1   0.331  0.455   0.570
65   89 10.3      0   0.001  0.005   0.015
66  134 25.5      1   0.889  0.937   0.969
67   87 10.5      0   0.001  0.003   0.011
68  142 26.5      1   0.964  0.984   0.994
69  124 22.0      1   0.607  0.718   0.803
70  120 20.0      1   0.425  0.549   0.650
71  120 24.2      1   0.425  0.549   0.650
72  158 33.8      1   0.997  0.999   1.000
73  151 29.4      1   0.990  0.997   0.999
74  150 29.0      1   0.989  0.996   0.999
75  150 27.4      1   0.989  0.996   0.999
76  139 27.3      1   0.945  0.973   0.989
77  117 15.3      0   0.288  0.409   0.528
78  161 32.6      1   0.998  0.999   1.000
79   93 10.3      0   0.002  0.010   0.026
80  114 14.5      0   0.179  0.288   0.402
81   67  7.4      0   0.000  0.000   0.001
82  118 15.2      0   0.331  0.455   0.570
83  130 22.2      1   0.813  0.878   0.931
84  115 14.0      0   0.212  0.327   0.444
85  150 30.6      1   0.989  0.996   0.999
86  100 11.2      0   0.009  0.032   0.068
87  115 14.4      0   0.212  0.327   0.444
88  115 14.8      0   0.212  0.327   0.444
89  115 15.3      0   0.212  0.327   0.444
90  116 22.0      1   0.248  0.366   0.486
91   97 12.0      0   0.005  0.019   0.045
92  114 15.0      0   0.179  0.288   0.402
93  117 22.3      1   0.288  0.409   0.528
94  106 19.0      1   0.034  0.090   0.154
95  138 27.0      1   0.936  0.968   0.987
96  120 15.8      0   0.425  0.549   0.650
97  144 26.0      1   0.973  0.989   0.996
98  127 23.0      1   0.721  0.811   0.880
99  131 26.1      1   0.838  0.895   0.943
100 158 32.0      1   0.997  0.999   1.000
101 145 26.4      1   0.977  0.991   0.997
102 111 14.2      0   0.103  0.194   0.288
103 118 24.3      1   0.331  0.455   0.570
104 131 24.0      1   0.838  0.895   0.943
105 123 17.0      0   0.564  0.682   0.766
106 103 13.0      0   0.018  0.053   0.105
107 145 27.3      1   0.977  0.991   0.997
108 142 26.2      1   0.964  0.984   0.994
109 126 18.0      0   0.685  0.783   0.857
110 124 18.2      0   0.607  0.718   0.803
111 123 20.5      1   0.564  0.682   0.766
112  84  9.8      0   0.000  0.002   0.007
113 146 26.3      1   0.980  0.992   0.998
114 146 31.2      1   0.980  0.992   0.998
115 111 20.4      1   0.103  0.194   0.288
116 127 17.4      0   0.721  0.811   0.880
117 155 30.2      1   0.995  0.998   1.000
118 120 17.2      0   0.425  0.549   0.650
119 137 27.0      1   0.927  0.963   0.983
120 138 25.0      1   0.936  0.968   0.987
121 114 14.0      0   0.179  0.288   0.402
122 142 30.0      1   0.964  0.984   0.994
123 120 15.4      0   0.425  0.549   0.650
124 136 23.4      1   0.916  0.956   0.980
125 116 14.0      0   0.248  0.366   0.486
126 152 29.0      1   0.992  0.997   0.999
127 134 24.8      1   0.889  0.937   0.969
128 125 22.0      1   0.647  0.753   0.831
129 133 25.0      1   0.875  0.925   0.962
130 110 14.1      0   0.084  0.168   0.254
131 157 31.8      1   0.996  0.999   1.000
132 117 15.3      0   0.288  0.409   0.528
133 168 34.0      1   0.999  1.000   1.000
134 158 29.0      1   0.997  0.999   1.000
135  93 10.0      0   0.002  0.010   0.026
136  85  9.0      0   0.000  0.002   0.008
137 122 17.0      0   0.520  0.637   0.728
138 134 17.8      0   0.889  0.937   0.969
139 138 25.2      1   0.936  0.968   0.987
140 114 15.5      0   0.179  0.288   0.402
141 113 14.6      0   0.151  0.254   0.362
142 107 14.0      0   0.042  0.106   0.175
143 108 12.5      0   0.053  0.124   0.198
144  99 13.0      0   0.008  0.027   0.059
145 137 24.0      1   0.927  0.963   0.983
146 115 15.7      0   0.212  0.327   0.444
147 112 18.2      1   0.126  0.222   0.324
148  88  9.2      0   0.001  0.004   0.013
149 114 13.2      0   0.179  0.288   0.402
150  88 10.6      0   0.001  0.004   0.013
151 170 32.0      1   0.999  1.000   1.000
152 143 25.2      1   0.969  0.987   0.995
153 169 35.0      1   0.999  1.000   1.000
154 136 25.5      1   0.916  0.956   0.980
155 146 26.0      1   0.980  0.992   0.998
156 162 35.0      1   0.998  1.000   1.000
157  42  4.0      0   0.000  0.000   0.000
158 149 28.7      1   0.987  0.995   0.999
159  53  5.2      0   0.000  0.000   0.000
160 136 26.5      1   0.916  0.956   0.980
161 137 27.0      1   0.927  0.963   0.983
162 138 28.2      1   0.936  0.968   0.987
163 108 12.8      0   0.053  0.124   0.198
164 137 25.2      1   0.927  0.963   0.983
165 143 27.4      1   0.969  0.987   0.995
166 113 19.6      1   0.151  0.254   0.362
167 117 14.0      0   0.288  0.409   0.528
168 102 12.5      0   0.015  0.045   0.091
169 109 14.4      0   0.067  0.146   0.223
170 141 27.5      1   0.959  0.981   0.993
171 141 27.8      1   0.959  0.981   0.993
172 126 25.4      1   0.685  0.783   0.857
173 121 21.2      1   0.476  0.596   0.687
174 109 13.0      0   0.067  0.146   0.223
175 117 14.7      0   0.288  0.409   0.528
176 118 15.7      0   0.331  0.455   0.570
177 116 22.0      1   0.248  0.366   0.486
178 118 15.4      0   0.331  0.455   0.570
179  90 10.2      0   0.001  0.006   0.017
180 141 28.0      1   0.959  0.981   0.993
181 106 13.0      0   0.034  0.090   0.154
182 137 25.0      1   0.927  0.963   0.983
183 146 28.0      1   0.980  0.992   0.998
184 112 14.5      0   0.126  0.222   0.324
185 106 13.4      0   0.034  0.090   0.154
186 140 27.1      1   0.952  0.978   0.991
187 159 31.0      1   0.997  0.999   1.000
188 155 31.7      1   0.995  0.998   1.000
189 138 27.7      1   0.936  0.968   0.987
190 117 14.7      0   0.288  0.409   0.528
191 106 17.3      1   0.034  0.090   0.154
192  88 10.0      0   0.001  0.004   0.013
193 138 27.0      1   0.936  0.968   0.987
194 121 23.0      1   0.476  0.596   0.687
195 133 28.2      1   0.875  0.925   0.962
196 113 13.0      0   0.151  0.254   0.362
197 140 27.8      1   0.952  0.978   0.991
198 127 22.6      1   0.721  0.811   0.880
199 118 19.5      1   0.331  0.455   0.570
200 110 13.4      0   0.084  0.168   0.254
201 117 17.0      0   0.288  0.409   0.528
202 106 12.5      0   0.034  0.090   0.154
203  94  8.6      0   0.003  0.012   0.030
204 141 26.9      1   0.959  0.981   0.993
205 108 13.4      0   0.053  0.124   0.198
206 134 28.6      1   0.889  0.937   0.969
207 134 23.0      1   0.889  0.937   0.969
208 131 18.2      0   0.838  0.895   0.943
209  56  6.2      0   0.000  0.000   0.000
210 134 26.5      1   0.889  0.937   0.969
211 117 23.0      1   0.288  0.409   0.528
212 120 16.0      0   0.425  0.549   0.650
213 108 16.0      1   0.053  0.124   0.198
214  67  7.0      0   0.000  0.000   0.001
215 157 32.0      1   0.996  0.999   1.000
216 156 32.8      1   0.995  0.999   1.000
217 142 28.4      1   0.964  0.984   0.994
218 165 35.8      1   0.999  1.000   1.000
219 126 16.9      0   0.685  0.783   0.857
220 108 14.5      0   0.053  0.124   0.198
221 129 23.0      1   0.785  0.858   0.917
222 111 19.0      1   0.103  0.194   0.288
223 153 32.0      1   0.993  0.998   0.999

sizeMat documentation built on Aug. 1, 2019, 1:05 a.m.