|
23 | 23 | % -- Function File: [STATS, BOOTSTAT] = bootlm (...)
|
24 | 24 | % -- Function File: [STATS, BOOTSTAT, AOVSTAT] = bootlm (...)
|
25 | 25 | % -- Function File: [STATS, BOOTSTAT, AOVSTAT, PRED_ERR] = bootlm (...)
|
| 26 | +% -- Function File: [STATS, BOOTSTAT, AOVSTAT, PRED_ERR, X] = bootlm (...) |
26 | 27 | %
|
27 | 28 | % Fits a linear model with categorical and/or continuous predictors (i.e.
|
28 | 29 | % independent variables) on a continuous outcome (i.e. dependent variable)
|
|
479 | 480 | % installed and loaded, then these computations will be automatically
|
480 | 481 | % accelerated by parallel processing on platforms with multiple processors
|
481 | 482 | %
|
482 |
| -% bootlm (version 2024.05.17) |
| 483 | +% '[STATS, BOOTSTAT, AOVSTAT, PRED_ERR, MAT] = bootlm (...)' also returns |
| 484 | +% a structure containing the design matrix of the predictors (X), the |
| 485 | +% regression coefficients (b), the hypothesis matrix (L) and the outcome (Y) |
| 486 | +% for the linear model. |
| 487 | +% |
| 488 | +% bootlm (version 2024.07.08) |
483 | 489 | % Author: Andrew Charles Penn
|
484 | 490 | % https://www.researchgate.net/profile/Andrew_Penn/
|
485 | 491 | %
|
|
497 | 503 | % You should have received a copy of the GNU General Public License
|
498 | 504 | % along with this program. If not, see http://www.gnu.org/licenses/
|
499 | 505 |
|
500 |
| -function [STATS, BOOTSTAT, AOVSTAT, PRED_ERR] = bootlm (Y, GROUP, varargin) |
| 506 | +function [STATS, BOOTSTAT, AOVSTAT, PRED_ERR, MAT] = bootlm (Y, GROUP, varargin) |
501 | 507 |
|
502 | 508 | if (nargin < 2)
|
503 | 509 | error (cat (2, 'bootlm usage: ''bootlm (Y, GROUP)''; ', ...
|
|
1275 | 1281 | else
|
1276 | 1282 | STATS.prior = cat (2, PRIOR(pairs(:, 1)), PRIOR(pairs(:, 2)));
|
1277 | 1283 | end
|
| 1284 | + % Modifying the hypothesis matrix (L) to represent the desired tests |
| 1285 | + L = make_test_matrix (L, pairs); % In case it is requested |
1278 | 1286 | otherwise
|
1279 | 1287 | error (cat (2, 'bootlm: unrecignised bootstrap method.', ...
|
1280 | 1288 | ' Use ''wild'' or ''bayesian''.'))
|
|
1377 | 1385 | 'CI_upper', 'pval', 'fpr', 'N', 'prior'});
|
1378 | 1386 | end
|
1379 | 1387 |
|
| 1388 | + % Create MAT return value |
| 1389 | + if (nargout > 4) |
| 1390 | + MAT = struct ('X', X, 'b', b, 'L', L, 'Y', Y); |
| 1391 | + end |
| 1392 | + |
1380 | 1393 | % Print table of model coefficients and make figure of diagnostic plots
|
1381 | 1394 | switch (lower (DISPLAY))
|
1382 | 1395 |
|
|
0 commit comments