* using log directory ‘/data/gannet/ripley/R/packages/tests-noLD/mlmodels.Rcheck’ * using R Under development (unstable) (2026-05-11 r90037) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) GNU Fortran (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7) * running under: Fedora Linux 42 (Workstation Edition) * using session charset: UTF-8 * current time: 2026-05-11 08:58:51 UTC * using option ‘--no-stop-on-test-error’ * checking for file ‘mlmodels/DESCRIPTION’ ... OK * this is package ‘mlmodels’ version ‘0.1.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘mlmodels’ can be installed ... [28s/64s] OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking whether startup messages can be suppressed ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [62s/141s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... ERROR Running examples in ‘mlmodels-Ex.R’ failed The error most likely occurred in: > ### Name: GOFtest > ### Title: Goodness-of-Fit Test for Count Models > ### Aliases: GOFtest GOFtest.mlmodel > > ### ** Examples > > > # Poisson model > fit_pois <- ml_poisson(docvis ~ private + medicaid + age + I(age^2) + + educyr + actlim + totchr, data = docvis) ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. ℹ Returning model without fitted/residual values. Use coef() to inspect parameters. > > GOFtest(fit_pois, bins = 0:5) Error in UseMethod("GOFtest") : no applicable method for 'GOFtest' applied to an object of class "c('maxLik', 'maxim', 'list')" Calls: GOFtest Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ [6m/14m] [6m/14m] ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(mlmodels) > > test_check("mlmodels") i Improving initial values by scaling (factor = 0.5). i Initial log-likelihood: -311.974 i Final scaled log-likelihood: 79.945 i Improving initial values by scaling (factor = 0.5). i Initial log-likelihood: -555.841 i Final scaled log-likelihood: -537.617 i Equality constraints detected => using Nelder-Mead optimizer. i Equality constraints detected => using Nelder-Mead optimizer. i Improving initial values by scaling (factor = 0.5). i Initial log-likelihood: -555.841 i Final scaled log-likelihood: -537.617 i Equality constraints detected => using Nelder-Mead optimizer. i Equality constraints detected => using Nelder-Mead optimizer. ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. i Returning model without fitted/residual values. Use coef() to inspect parameters. Saving _problems/test-counts-single-23.R Saving _problems/test-counts-single-28.R ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. i Returning model without fitted/residual values. Use coef() to inspect parameters. Saving _problems/test-counts-single-42.R ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. i Returning model without fitted/residual values. Use coef() to inspect parameters. ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. i Returning model without fitted/residual values. Use coef() to inspect parameters. Saving _problems/test-counts-single-77.R ! Estimation did not converge (code 3). Message: Last step could not find a value above the current. Boundary of parameter space? Consider switching to a more robust optimisation method temporarily. i Returning model without fitted/residual values. Use coef() to inspect parameters. Saving _problems/test-counts-single-93.R i Equality constraints detected => using Nelder-Mead optimizer. i Equality constraints detected => using Nelder-Mead optimizer. i Equality constraints detected => using Nelder-Mead optimizer. i `object_1` is the restricted model (nested in `object_2`). i `object_1` is the restricted model (nested in `object_2`). i `object_1` is the restricted model (nested in `object_2`). i `object_1` is the restricted model (nested in `object_2`). i Equality constraints detected => using Nelder-Mead optimizer. Saving _problems/test-predict-216.R [ FAIL 7 | WARN 0 | SKIP 1 | PASS 1130 ] ══ Skipped tests (1) ═══════════════════════════════════════════════════════════ • On CRAN (1): 'test-counts-single.R:130:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-counts-single.R:23:3'): ml_poisson and ml_negbin fit homoskedastic and heteroskedastic models ── Expected `fit_pois` to inherit from "ml_poisson". Actual class: "maxLik"/"maxim"/"list". ── Failure ('test-counts-single.R:28:3'): ml_poisson and ml_negbin fit homoskedastic and heteroskedastic models ── Expected `fit_pois` to inherit from "mlmodel". Actual class: "maxLik"/"maxim"/"list". ── Error ('test-counts-single.R:42:5'): predict() works for Poisson and Negative Binomial models ── Error in `UseMethod("predict")`: no applicable method for 'predict' applied to an object of class "c('maxLik', 'maxim', 'list')" Backtrace: ▆ 1. └─stats::predict(fit_pois, type = typ) at test-counts-single.R:42:5 ── Error ('test-counts-single.R:62:3'): Count models work with marginaleffects ── Error: Models of class "maxLik" are not supported. Supported model classes include: DirichletRegModel, Gam, Gls, Learner, MCMCglmm, Rchoice, afex_aov, aft, amest, bart, betareg, bglmerMod, bigglm, biglm, blmerMod, bracl, brglmFit, brmsfit, brnb, clm, clmm2, clogit, coxph, coxph_weightit, crch, fixest, flac, flexsurvreg, flic, gam, gamlss, geeglm, glimML, glm, glm_weightit, glmerMod, glmgee, glmmPQL, glmmTMB, glmrob, glmtree, glmx, gls, gsm, hetprob, hurdle, hxlr, iv_robust, ivpml, ivreg, lda, lm, lmRob, lm_robust, lme, lmerMod, lmerModLmerTest, lmrob, lmtree, loess, logistf, lrm, marginaleffects_internal, mblogit, mclogit, mhurdle, mira, mlmodel, mlogit, model_fit, multinom, multinom_weightit, mvgam, negbin, nls, ols, oohbchoice, ordinal_weightit, orm, phyloglm, phylolm, plm, polr, pstpm2, rendo.base, rlmerMod, rq, scam, selection, speedglm, speedlm, stanreg, stpm2, survreg, svyolr, systemfit, tobit, tobit1, truncreg, workflow, zeroinfl. Request support for new models on the issue tracker: https://github.com/vincentarelbundock/marginaleffects Backtrace: ▆ 1. ├─testthat::expect_silent(predictions(fit_pois)) at test-counts-single.R:62:3 2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise) 3. │ ├─testthat (local) .capture(...) 4. │ │ ├─withr::with_output_sink(...) 5. │ │ │ └─base::force(code) 6. │ │ ├─base::withCallingHandlers(...) 7. │ │ └─base::withVisible(code) 8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 9. └─marginaleffects::predictions(fit_pois) 10. └─marginaleffects:::sanitize_model(...) 11. └─marginaleffects:::sanity_model_supported_class(model) ── Error ('test-counts-single.R:77:3'): IMtest and GOF tests work on count models ── Error in `UseMethod("IMtest")`: no applicable method for 'IMtest' applied to an object of class "c('maxLik', 'maxim', 'list')" Backtrace: ▆ 1. ├─testthat::expect_s3_class(IMtest(fit_pois), "IMtest.mlmodel") at test-counts-single.R:77:3 2. │ └─testthat::quasi_label(enquo(object)) 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─mlmodels::IMtest(fit_pois) ── Error ('test-counts-single.R:93:3'): Vuong test works between Poisson and NB2 ── Error in `UseMethod("vuongtest")`: no applicable method for 'vuongtest' applied to an object of class "c('maxLik', 'maxim', 'list')" Backtrace: ▆ 1. └─mlmodels::vuongtest(fit_pois, fit_nb2) at test-counts-single.R:93:3 ── Error ('test-predict.R:214:5'): All predictions types for ml_poisson work ─── Error in `UseMethod("predict")`: no applicable method for 'predict' applied to an object of class "c('maxLik', 'maxim', 'list')" Backtrace: ▆ 1. ├─base::suppressWarnings(pred <- predict(pois, type = typ, se.fit = TRUE)) at test-predict.R:214:5 2. │ └─base::withCallingHandlers(...) 3. └─stats::predict(pois, type = typ, se.fit = TRUE) [ FAIL 7 | WARN 0 | SKIP 1 | PASS 1130 ] Error: ! Test failures. Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [143s/351s] ERROR Error(s) in re-building vignettes: --- re-building ‘mlmodels-basics.Rmd’ using rmarkdown --- finished re-building ‘mlmodels-basics.Rmd’ --- re-building ‘mlmodels-countintro.Rmd’ using rmarkdown Quitting from mlmodels-countintro.Rmd:82-84 [overdispersion-test] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: ! `object` needs to be of class 'mlmodel.count' --- Backtrace: ▆ 1. └─mlmodels::OVDtest(pois) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: processing vignette 'mlmodels-countintro.Rmd' failed with diagnostics: `object` needs to be of class 'mlmodel.count' --- failed re-building ‘mlmodels-countintro.Rmd’ --- re-building ‘mlmodels-diagnostics.Rmd’ using rmarkdown Quitting from mlmodels-diagnostics.Rmd:229-235 [poisson] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: ! `object` needs to be of class 'mlmodel.count' --- Backtrace: ▆ 1. └─mlmodels::OVDtest(fit_poi) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: processing vignette 'mlmodels-diagnostics.Rmd' failed with diagnostics: `object` needs to be of class 'mlmodel.count' --- failed re-building ‘mlmodels-diagnostics.Rmd’ --- re-building ‘mlmodels-fractional.Rmd’ using rmarkdown --- finished re-building ‘mlmodels-fractional.Rmd’ --- re-building ‘mlmodels-gamma-lognormal.Rmd’ using rmarkdown --- finished re-building ‘mlmodels-gamma-lognormal.Rmd’ --- re-building ‘mlmodels-predictions.Rmd’ using rmarkdown predict.ml_beta package:mlmodels R Documentation _P_r_e_d_i_c_t_i_o_n_s _f_o_r _m_l_m_o_d_e_l _m_o_d_e_l_s _D_e_s_c_r_i_p_t_i_o_n: Methods for computing predictions from models fitted with the 'mlmodels' package. _U_s_a_g_e: ## S3 method for class 'ml_beta' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'ml_gamma' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'ml_lm' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'ml_logit' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'mlmodel' predict(object, ...) ## S3 method for class 'ml_negbin' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'ml_poisson' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) ## S3 method for class 'ml_probit' predict( object, newdata = NULL, type = "response", se.fit = FALSE, vcov = NULL, vcov.type = "oim", cl_var = NULL, repetitions = 999, seed = NULL, progress = FALSE, ... ) _A_r_g_u_m_e_n_t_s: object: An object from an estimation with one of our models. newdata: Optional data frame for out-of-sample predictions. type: Character string indicating what to predict. See *Details*. se.fit: Logical. If 'TRUE', also return standard errors (delta method). vcov: Optional user-supplied variance-covariance matrix. vcov.type: Type of variance-covariance matrix. See vcov. cl_var: Clustering variable (name or vector). repetitions: Number of bootstrap replications when 'vcov.type = "boot"'. seed: Random seed for bootstrapping, for reproducibility. progress: Logical. Show bootstrap/jackknife progress bar? Default is 'FALSE' in higher-level functions. ...: Additional arguments passed to methods. _D_e_t_a_i_l_s: _m_l__b_e_t_a _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. Type Description Notes '"link"' Linear mean predictor ( xb ) logit-mean '"response"' Expected proportion (outcome) Default '"mean"' Alias for '"response"' - '"fitted"' Alias for '"response"' - '"odds"' Odds ratio exp(xb) '"zd"' Linear precision predictor log-phi '"phi"' Dispersion parameter - '"shape1"' Shape parameter of the beta distribution mu * phi '"shape2"' Shape parameter of the beta distribution (1 - mu) * phi '"mode"' Mode prediction (See below) (shape1 - 1) / (shape1 + shape2 - 2) '"variance"' Variance of the outcome variable mu * (1 - mu) / (1 + phi) '"var"' Alias for '"variance"' - '"sigma"' Standard deviation of outcome variable sqrt('"variance"') '"sd"' Alias for '"sigma"' - When 'se.fit = TRUE', standard errors are computed using the delta method for all supported types. *Mode Indeterminations* The mode is only defined if 'shape1 > 1' *and* 'shape2 > 1' *and* 'shape1 + shape2 != 2'. If these conditions are not met the prediction and standard error will be 'NA'. _m_l__g_a_m_m_a _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. Type Description Notes '"link"' Linear mean predictor ( xb ) log-mean '"response"' Expected outcome Default '"mean"' Alias for '"response"' - '"fitted"' Alias for '"response"' - '"zd"' Linear shape predictor log-nu '"nu"' Shape parameter - '"variance"' Variance of the outcome variable - '"var"' Alias for '"variance"' - '"sigma"' Standard deviation of outcome variable sqrt('"variance"') '"sd"' Alias for '"sigma"' - When 'se.fit = TRUE', standard errors are computed using the delta method for all supported types. _m_l__l_m _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. Behavior differs depending on whether the outcome was modeled in logs ('log(y)'). Type Normal (linear) case Lognormal case ('log(y)') Notes 'link' Linear predictor for scale (zd) Linear predictor on log scale (mu-log) Scale equation 'fitted' xb (mean predictor) xb (original log-scale predictor) Mean equation 'response', 'mean', 'mu' xb (E'[y]') E'[y]' = exp(mu-log + sigma^2/2) - shift Proper expected value on original scale 'median' xb (same as mean) exp(mu-log) - shift Median of y 'sigma', 'sd' sd of y sd of 'log(y)' On log scale 'sigma_y', 'sd_y' same as 'sigma' sd of y Only meaningful in lognormal case 'variance', 'var' sigma^2 sigma^2 (variance of 'log(y)') On log scale 'variance_y', 'var_y' same as 'variance' Var(y) = exp(2 mu-log + sigma^2)(exp(sigma^2) - 1) Only meaningful in lognormal case 'zd' Linear predictor for scale (zd) Linear predictor for scale (zd) Alias for 'link' When the outcome is log-transformed, 'response' (or 'mean') returns the correct lognormal expected value on the original scale of y. The 'median' is the simple exponential back-transform. _m_l__l_o_g_i_t _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. Behavior differs depending on whether the model is homoskedastic or heteroskedastic. Type Homoskedastic case Heteroskedastic case Notes '"xb"' Linear predictor xb Linear predictor xb Linear predictor for value '"response"' P(y=1 | x) P(y=1 | x) Prob. of success (default) '"prob"' Alias for '"response"' Alias for '"response"' - '"fitted"' Alias for '"response"' Alias for '"response"' - '"prob0"' P(y=0 | x) P(y=0 | x) Prob. of failure '"link"' Linear predictor xb xb / exp(zd) Log-odds '"odds"' Odds = exp(xb) Odds = exp(xb / exp(zd)) - '"sigma"' 1 (constant) Std. Deviation: exp(zd) Only available if heteroskedastic '"variance"' 1 (constant) Variance: exp(2*zd) Only available if heteroskedastic '"zd"' 0 (constant) Linear predictor zd Linear predictor for scale In binary logit models, the *overall scale* of the latent error term is not identified and is normalized to 1. In the homoskedastic case there is no scale equation, so sigma is fixed at 1. In the heteroskedastic case, the scale equation has no intercept. Therefore, the predicted '"sigma"' and '"variance"' represent *individual-level deviations* from the normalized overall scale, not the absolute standard deviation or variance. When 'se.fit = TRUE', standard errors are computed using the delta method. Standard errors are not available (and will return 'NA') for '"sigma"', '"variance"', and '"zd"' in homoskedastic models. _m_l__n_e_g_b_i_n _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. In addition to standard types, Negative Binomial models support flexible probability requests using the 'P(...)' syntax. Type Description Notes '"link"' Linear mean predictor ( xb ) log-mean '"response"' Expected count ( 'mu' = 'exp(xb)' ) Default '"mean"' Alias for '"response"' - '"fitted"' Alias for '"response"' - '"zd"' Linear dispersion predictor log-alpha '"alpha"' Dispersion parameter - '"variance"' Variance of the outcome variable - '"var"' Alias for '"variance"' - '"sigma"' Standard deviation of outcome variable sqrt('"variance"') '"sd"' Alias for '"sigma"' - 'P(k)' P(Y = k) Exact probability, k integer >= 0 'P(,k)' P(Y <= k) Cumulative (lower tail) 'P(k,)' P(Y >= k) Survival (upper tail) 'P(a,b)' P(a <= Y <= b) Interval probability, a <= b, a >= 0 When 'se.fit = TRUE', standard errors are computed using the delta method for all supported types. _m_l__p_o_i_s_s_o_n _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. In addition to standard types, Poisson models support flexible probability requests using the 'P(...)' syntax. Type Description Notes '"link"' Linear predictor ( xb ) log-mean '"response"' Expected count ( 'mu' = 'exp(xb)' ) Default '"mean"' Alias for '"response"' - '"mu"' Alias for '"response"' - '"fitted"' Alias for '"response"' - 'P(k)' P(Y = k) Exact probability, k integer >= 0 'P(,k)' P(Y <= k) Cumulative (lower tail) 'P(k,)' P(Y >= k) Survival (upper tail) 'P(a,b)' P(a <= Y <= b) Interval probability, a <= b, a >= 0 When 'se.fit = TRUE', standard errors are computed using the delta method for all supported types. _m_l__p_r_o_b_i_t _p_r_e_d_i_c_t_i_o_n _t_y_p_e_s: The 'type' argument controls what quantity is returned. Behavior differs depending on whether the model is homoskedastic or heteroskedastic. Type Homoskedastic case Heteroskedastic case Notes '"xb"' Linear predictor xb Linear predictor xb Linear predictor for value '"response"' P(y=1 | x) P(y=1 | x) Prob. of success (default) '"prob"' Alias for '"response"' Alias for '"response"' - '"fitted"' Alias for '"response"' Alias for '"response"' - '"prob0"' P(y=0 | x) P(y=0 | x) Prob. of failure '"link"' Linear predictor xb xb / exp(zd) Probit index '"odds"' Odds = prob / prob0 Odds = prob / prob0. - '"sigma"' 1 (constant) Std. Deviation: exp(zd) Only available if heteroskedastic '"variance"' 1 (constant) Variance: exp(2*zd) Only available if heteroskedastic '"zd"' 0 (constant) Linear predictor zd Linear predictor for scale In binary probit models, the *overall scale* of the latent error term is not identified and is normalized to 1. In the homoskedastic case there is no scale equation, so sigma is fixed at 1. In the heteroskedastic case, the scale equation has no intercept. Therefore, the predicted '"sigma"' and '"variance"' represent *individual-level deviations* from the normalized overall scale, not the absolute standard deviation or variance. The '"link"' type returns the value on the *probit scale*, which is the inverse of the standard normal cumulative distribution function (p = Phi^(-1)(p)). This is the linear prediction (p = xb) ih homoskedastic models, and the standardized linear predictor (p = xb / sigma) in heteroskedastic models. When 'se.fit = TRUE', standard errors are computed using the delta method. Standard errors are not available (and will return 'NA') for '"sigma"', '"variance"', and '"zd"' in homoskedastic models. _V_a_l_u_e: An object that inherits from 'predict.mlmodel' and has two elements: fit Vector with the predictions. se.fit If 'se.fit' is 'TRUE' a vector with the delta-method standard errors, using analytical gradients. If 'se.fit' is 'FALSE', it is set to 'NULL'. _A_u_t_h_o_r(_s): Alfonso Sanchez-Penalver _E_x_a_m_p_l_e_s: # Basic usage and different predict types data(docvis) fit_pois <- ml_poisson(docvis ~ age + educyr + totchr, data = docvis) head(predict(fit_pois, type = "response")$fit) # Expected count head(predict(fit_pois, type = "P(3)")$fit) # Prob of exactly 3 # Prediction at the mean (typical case) typical <- data.frame(age = mean(docvis$age), educyr = mean(docvis$educyr), totchr = mean(docvis$totchr)) predict(fit_pois, newdata = typical, type = "response") # In-sample vs full-data prediction with subset / boundary dropping data(pw401k) fit_beta <- ml_beta(prate ~ mrate + I(mrate^2) + log(totemp) + I(log(totemp)^2) + age + I(age^2) + sole, data = pw401k, subset = prate < 1) # In-sample prediction (NAs for dropped observations) head(predict(fit_beta, type = "response")$fit) # Full-data prediction (predicts for all rows, including dropped ones) head(predict(fit_beta, newdata = pw401k, type = "response")$fit) --- finished re-building ‘mlmodels-predictions.Rmd’ --- re-building ‘mlmodels-variance.Rmd’ using rmarkdown --- finished re-building ‘mlmodels-variance.Rmd’ SUMMARY: processing the following files failed: ‘mlmodels-countintro.Rmd’ ‘mlmodels-diagnostics.Rmd’ Error: Vignette re-building failed. Execution halted * checking PDF version of manual ... [11s/38s] OK * checking HTML version of manual ... [9s/22s] OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 3 ERRORs See ‘/data/gannet/ripley/R/packages/tests-noLD/mlmodels.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 27:13.80, 657.22 + 22.94