Statistical models
stat cumincstat cumincstat finegraystat finegraystat glmstat glmstat lmmstat lmmstat gamstat gamstat glmmstat glmmstat rm_anovastat rm_anovastat manovastat micestat micestat poolstat tukeystat tukeystat p_adjuststat powerstat sample_sizestat vcastat vca

stat cuminc <json_times> <json_status>


Description

    Competing risks: cumulative incidence of each cause (Aalen-Johansen), status 0 = censored, 1, 2... = the cause of the event; 1 - Kaplan-Meier overestimates the risk when other causes compete

Parameters

    json_times:   The times - String - required
    json_status:   The status: 0 = censored, k = cause k - String - required
admin
stat cuminc "[2, 3, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20]" "[1, 2, 1, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0]"
mentdb
{"n": 16, "causes": 2, "groups": [{"group": "all", "n": 16, "causes": [{"cause": 1, "events": 7, "curve": [[2, 0.0625], [3, 0.125], [6, 0.19270833333333331], [8, 0.26041666666666663], [11, 0.33658854166666663], [14, 0.42799479166666665], [18, 0.5651041666666667]]}, {"cause": 2, "events": 4, "curve": [[3, 0.0625], [7, 0.13020833333333331], [10, 0.20638020833333331], [15, 0.29778645833333334]]}]}]}

stat cuminc <json_times> <json_status> <json_params>


Description

    Cumulative incidence with parameters: groups, times (values at these times), bootstrap (number of resamples for the intervals at these times), level, seed

Parameters

    json_times:   The times - String - required
    json_status:   The status - String - required
    json_params:   The parameters - String - required
admin
stat cuminc "[2, 3, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20]" "[1, 2, 1, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0]" "{\"times\": [5, 10, 15], \"bootstrap\": 200}"
mentdb
{"n": 16, "causes": 2, "groups": [{"group": "all", "n": 16, "causes": [{"cause": 1, "events": 7, "curve": [[2, 0.0625], [3, 0.125], [6, 0.19270833333333331], [8, 0.26041666666666663], [11, 0.33658854166666663], [14, 0.42799479166666665], [18, 0.5651041666666667]], "at": [{"time": 5, "cif": 0.125, "lower": 0, "upper": 0.25}, {"time": 10, "cif": 0.26041666666666663, "lower": 0.0625, "upper": 0.5}, {"time": 15, "cif": 0.42799479166666665, "lower": 0.1875, "upper": 0.7279385653409093}]}, {"cause": 2, "events": 4, "curve": [[3, 0.0625], [7, 0.13020833333333331], [10, 0.20638020833333331], [15, 0.29778645833333334]], "at": [{"time": 5, "cif": 0.0625, "lower": 0, "upper": 0.1875}, {"time": 10, "cif": 0.20638020833333331, "lower": 0, "upper": 0.44571814903846163}, {"time": 15, "cif": 0.29778645833333334, "lower": 0.06873579545454546, "upper": 0.6207897367931549}]}]}]}
Used in use cases (1 recipe)

    Epidemiologist › Relapse when death competes: cumulative incidence and Fine-Gray
Often used with

    stat finegray

stat finegray <json_X> <json_times> <json_status>


Description

    Fine-Gray regression of the subdistribution hazard of a cause (competing risks): the subjects who died of another cause stay at risk with a censoring weight; subdistribution hazard ratios (shr) with robust standard errors (as R survival::finegray + coxph), Breslow ties

Parameters

    json_X:   The covariates - String - required
    json_times:   The times - String - required
    json_status:   The status - String - required
admin
stat finegray "[[1], [1], [0], [1], [1], [0], [1], [0], [0], [1], [0], [0], [1], [0], [0], [1]]" "[2, 3, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20]" "[1, 2, 1, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0]"
mentdb
{"cause": 1, "n": 16, "events": 7, "competing_events": 4, "censored": 5, "coefficients": [{"term": "x0", "estimate": 0.5166722588095912, "shr": 1.676439599954005, "se": 0.7206525964367293, "se_model": 0.7675648345598856, "z": 0.7169505270143757, "p_value": 0.47340462357153257, "shr_lower": 0.4082886514938934, "shr_upper": 6.883487263265213}], "log_partial_likelihood": -15.97204731963594, "lr_test": 0.45925464612328426, "ties": "breslow"}

stat finegray <json_X> <json_times> <json_status> <json_params>


Description

    Fine-Gray with parameters: cause (1), level, max_iter

Parameters

    json_X:   The covariates - String - required
    json_times:   The times - String - required
    json_status:   The status - String - required
    json_params:   The parameters - String - required
admin
stat finegray "[[1], [1], [0], [1], [1], [0], [1], [0], [0], [1], [0], [0], [1], [0], [0], [1]]" "[2, 3, 3, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20]" "[1, 2, 1, 0, 1, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0]" "{\"cause\": 2}"
mentdb
{"cause": 2, "n": 16, "events": 4, "competing_events": 7, "censored": 5, "coefficients": [{"term": "x0", "estimate": 0.006304542292522303, "shr": 1.0063244577498982, "se": 0.9090370242706836, "se_model": 1.005562600508219, "z": 0.006935407606285794, "p_value": 0.9944663897091026, "shr_lower": 0.1694198566855228, "shr_upper": 5.977392107852977}], "log_partial_likelihood": -9.997128618537417, "lr_test": 3.930863886836278E-5, "ties": "breslow"}
Used in use cases (1 recipe)

    Epidemiologist › Relapse when death competes: cumulative incidence and Fine-Gray
Often used with

    stat cuminc

stat glm <json_X> <json_y> <family>


Description

    Generalized linear model (IRLS): gaussian (identity link), binomial (logit), poisson (log), gamma (log), negative_binomial (log, theta estimated by maximum likelihood): coefficients with standard errors, tests and 95 % intervals, deviance, null deviance, dispersion, log-likelihood, AIC, BIC

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    family:   gaussian, binomial, poisson, gamma or negative_binomial - String - required
admin
stat glm "[[0, 0], [1, 0], [0, 1], [0, 0], [1, 0], [0, 1], [0, 0], [1, 0], [0, 1]]" "[18, 17, 15, 20, 10, 20, 25, 13, 12]" "poisson"
mentdb
{"family": "poisson", "link": "log", "n": 9, "coefficients": [{"term": "intercept", "estimate": 3.044522437723423, "se": 0.12598815766974242, "z": 24.16514769351693, "p_value": 0, "lower": 2.797590186212174, "upper": 3.291454689234672}, {"term": "x0", "estimate": -0.45425527227759543, "se": 0.20217075919384547, "z": -2.2468890856864525, "p_value": 0.024647116411295356, "lower": -0.8505026790246526, "upper": -0.05800786553053827}, {"term": "x1", "estimate": -0.29298712468147414, "se": 0.19274234515979285, "z": -1.5200973322109028, "p_value": 0.12848651501350616, "lower": -0.6707551794904562, "upper": 0.08478093012750787}], "deviance": 5.129141077001146, "null_deviance": 10.581445863750867, "df_residual": 6, "dispersion": 1, "log_likelihood": -23.380659200978858, "aic": 52.761318401957716, "bic": 53.352992133966374, "lr_test_p_value": 0.06547071121457348}
Positive skewed values: gamma
admin
stat glm "[[0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [4.5], [5], [5.5], [6]]" "[1.9, 2.2, 2.0, 3.1, 2.9, 4.2, 3.8, 5.6, 5.1, 7.4, 6.8, 9.9]" "gamma"
mentdb
{"family": "gamma", "link": "log", "n": 12, "coefficients": [{"term": "intercept", "estimate": 0.442722610098226, "se": 0.07588610820915279, "t": 5.834040255141563, "p_value": 1.6514227157604644E-4, "lower": 0.27363782407137593, "upper": 0.6118073961250761}, {"term": "x0", "estimate": 0.29277809040495506, "se": 0.02062178340860049, "t": 14.197515539943526, "p_value": 5.9233804750036256E-8, "lower": 0.2468298935950058, "upper": 0.33872628721490433}], "deviance": 0.15683094473134343, "null_deviance": 3.189358020247802, "df_residual": 10, "dispersion": 0.015202971746506491, "log_likelihood": -7.735384699725586, "aic": 21.47076939945117, "bic": 22.925489348815173}
Overdispersed counts: negative binomial
admin
stat glm "[[0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [4.5], [5], [5.5], [6]]" "[0, 2, 1, 3, 2, 6, 3, 9, 4, 12, 7, 15]" "negative_binomial"
mentdb
{"family": "negative_binomial", "link": "log", "n": 12, "coefficients": [{"term": "intercept", "estimate": -0.09502091100518939, "se": 0.40259071684153463, "z": -0.23602360171307912, "p_value": 0.8134143559663964, "lower": -0.8840842165247602, "upper": 0.6940423945143814}, {"term": "x0", "estimate": 0.45480909930790236, "se": 0.085788092677042, "z": 5.301541101048574, "p_value": 1.1482918838012779E-7, "lower": 0.2866675273585157, "upper": 0.622950671257289}], "deviance": 11.458420262356986, "null_deviance": 44.721605350272625, "df_residual": 10, "dispersion": 1, "log_likelihood": -24.173978115336165, "aic": 54.34795623067233, "bic": 55.80267618003633, "theta": 162685.78394500856, "lr_test_p_value": 8.04921362895783E-9}
0 / 1: binomial
admin
stat glm "[[0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [4.5], [5], [5.5], [6]]" "[0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1]" "binomial"
mentdb
{"family": "binomial", "link": "logit", "n": 12, "coefficients": [{"term": "intercept", "estimate": -3.284182187720207, "se": 1.9472553760029747, "z": -1.6865698398848277, "p_value": 0.09168609537642669, "lower": -7.100732593388038, "upper": 0.5323682179476248}, {"term": "x0", "estimate": 1.010517596221602, "se": 0.5534907596759762, "z": 1.8257171932069434, "p_value": 0.0678928720055405, "lower": -0.07430435851902573, "upper": 2.0953395509622297}], "deviance": 11.14818819784174, "null_deviance": 16.63553233343869, "df_residual": 10, "dispersion": 1, "log_likelihood": -5.57409409892087, "aic": 15.14818819784174, "bic": 16.11800149741774, "lr_test_p_value": 0.019154618885591224}

stat glm <json_X> <json_y> <family> <json_params>


Description

    GLM with parameters: max_iter, tol, level, theta (negative binomial: fixed instead of estimated)

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    family:   The family - String - required
    json_params:   The parameters - String - required
admin
stat glm "[[0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [4.5], [5], [5.5], [6]]" "[0, 2, 1, 3, 2, 6, 3, 9, 4, 12, 7, 15]" "negative_binomial" "{\"theta\": 5}"
mentdb
{"family": "negative_binomial", "link": "log", "n": 12, "coefficients": [{"term": "intercept", "estimate": -0.171345824662275, "se": 0.5184947889762064, "z": -0.3304677854151742, "p_value": 0.7410465301191422, "lower": -1.187576937227335, "upper": 0.844885287902785}, {"term": "x0", "estimate": 0.47466200020111193, "se": 0.12153221200908867, "z": 3.9056476661974586, "p_value": 9.39733514804253E-5, "lower": 0.23646324170181188, "upper": 0.712860758700412}], "deviance": 6.313232977216059, "null_deviance": 23.27928504024087, "df_residual": 10, "dispersion": 1, "log_likelihood": -25.530333874546898, "aic": 57.060667749093795, "bic": 58.5153876984578, "theta": 5, "lr_test_p_value": 3.805419819902234E-5}
Used in use cases (2 recipes)

    Industrial quality engineer › Defect counts with overdispersion
    Statistician & biostatistician › Small sample: Bayesian logistic regression and the probability of an effect
Often used with

    math exp  ·  stat bayes_glm

stat lmm <json_X> <json_y> <json_groups>


Description

    Linear mixed model with a random intercept per group (REML): fixed effects, group and residual variances, intraclass correlation (ICC), REML log-likelihood, AIC and the effect of each group (BLUP); repeated measures, subjects, batches, sites

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    json_groups:   The group of each row - String - required
admin
stat lmm "[[1], [2], [3], [1], [2], [3], [1], [2], [3], [1], [2], [3]]" "[10.1, 11.0, 12.2, 7.9, 9.1, 9.8, 12.2, 13.1, 14.0, 9.0, 10.2, 10.9]" "[\"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"c\", \"c\", \"c\", \"d\", \"d\", \"d\"]"
mentdb
{"n": 12, "groups": 4, "fixed_effects": [{"term": "intercept", "estimate": 8.866666666667655, "se": 0.8924025708403864, "t": 9.935725149601268, "p_value": 1.6862781602178245E-6, "lower": 6.878269826965731, "upper": 10.855063506369579}, {"term": "x0", "estimate": 0.9624999999999988, "se": 0.04669110660956083, "t": 20.614204072064336, "p_value": 1.5963546040609344E-9, "lower": 0.8584657313210019, "upper": 1.0665342686789958}], "group_variance": 3.1448349509568465, "residual_variance": 0.017440475491402995, "icc": 0.9944848335013654, "reml_log_likelihood": -5.669524702939175, "aic": 19.33904940587835, "group_effects": {"a": 0.3077644049523845, "b": -1.854904386611825, "c": 2.304074058703963, "d": -0.7569340770484572}}

stat lmm <json_X> <json_y> <json_groups> <json_params>


Description

    Linear mixed model with random slopes: random_slopes = the columns of X that get a slope per group (correlated with the random intercept, REML); variance, sd and correlations of the random effects, the intercept and slopes of each group

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    json_groups:   The group of each row - String - required
    json_params:   The parameters - String - required
admin
stat lmm "[[0], [1], [2], [3], [0], [1], [2], [3], [0], [1], [2], [3], [0], [1], [2], [3], [0], [1], [2], [3]]" "[10.2, 12.1, 13.8, 16.1, 9.5, 10.4, 11.6, 12.3, 11.0, 13.9, 16.8, 19.9, 10.1, 11.2, 12.0, 13.3, 9.8, 12.4, 14.6, 17.2]" "[\"a\", \"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"b\", \"c\", \"c\", \"c\", \"c\", \"d\", \"d\", \"d\", \"d\", \"e\", \"e\", \"e\", \"e\"]" "{\"random_slopes\": [0]}"
mentdb
{"n": 20, "groups": 5, "fixed_effects": [{"term": "intercept", "estimate": 10.107999999999768, "se": 0.2404871987013332, "t": 42.031343267269435, "p_value": 0, "lower": 9.60275514385231, "upper": 10.613244856147226}, {"term": "x0", "estimate": 1.8679999999995367, "se": 0.3895427461986632, "t": 4.795365895600258, "p_value": 1.4485568176092478E-4, "lower": 1.049601058894741, "upper": 2.6863989411043323}], "random_effects": [{"term": "intercept", "variance": 0.2751704664610034, "sd": 0.524566932298447}, {"term": "x0", "variance": 0.7547177563680811, "sd": 0.8687449317078524, "correlation_intercept": 0.746781599370066}], "residual_variance": 0.019999996049304396, "reml_criterion": 21.242841163374052, "reml_log_likelihood": -10.621420581687026, "aic": 33.24284116337405, "group_effects": {"a": {"intercept": 0.03253722166746281, "x0": 0.07163541141250943}, "b": {"intercept": -0.5819611158416329, "x0": -0.9140423325128764}, "c": {"intercept": 0.817127466082864, "x0": 1.1065347830047108}, "d": {"intercept": -0.06524297250381439, "x0": -0.8046548717674722}, "e": {"intercept": -0.2024605994037243, "x0": 0.5405270098654434}}}
Used in use cases (2 recipes)

    Biologist & microbiologist › Growth with a batch effect
    Statistician & biostatistician › Repeated measures: each subject has its own slope

stat gam <json_X> <json_y>


Description

    Generalized additive model (gaussian): y = intercept + s(x0) + s(x1) + ... with cubic P-splines, the smoothness of each term chosen by generalized cross validation; effective degrees of freedom and the curve of each term

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
admin
stat gam "[[0.0], [0.5], [1.0], [1.5], [2.0], [2.5], [3.0], [3.5], [4.0], [4.5], [5.0], [5.5], [6.0]]" "[0.05, 0.52, 0.81, 1.02, 0.88, 0.6, 0.15, -0.33, -0.72, -0.98, -0.93, -0.71, -0.27]"
mentdb
{"n": 13, "intercept": 0.006923076917751537, "r2": 0.999047203745005, "gcv": 0.0020032320650057297, "edf": 6.830785601831141, "residual_variance": 9.506436998697602E-4, "terms": [{"term": "s(x0)", "edf": 5.830785602600372, "lambda": 0.1, "effect": [[0, 0.0645512015335441], [0.6, 0.5734308457671223], [1.2, 0.9082040608055141], [1.8, 0.9453592132301406], [2.4, 0.6552992980587476], [3, 0.14274097861778223], [3.6, -0.4216184321742636], [4.2, -0.8474994415679459], [4.8, -0.9745027988091864], [5.4, -0.759806751592765], [6, -0.30744490274341496]]}]}

stat gam <json_X> <json_y> <json_params>


Description

    GAM with parameters: family (gaussian, binomial for 0 / 1 with the logit link, poisson for counts with the log link; penalized IRLS, smoothness by GCV on the deviance, explained deviance), segments (of the splines, 10), lambda (fixed smoothness instead of GCV), points (of each curve, 11)

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    json_params:   The parameters - String - required
admin
stat gam "[[0.0], [0.5], [1.0], [1.5], [2.0], [2.5], [3.0], [3.5], [4.0], [4.5], [5.0], [5.5], [6.0]]" "[0.05, 0.52, 0.81, 1.02, 0.88, 0.6, 0.15, -0.33, -0.72, -0.98, -0.93, -0.71, -0.27]" "{\"segments\": 6, \"points\": 5}"
mentdb
{"n": 13, "intercept": 0.006923076917751523, "r2": 0.9992096400770096, "gcv": 0.001527500083778456, "edf": 6.565462916956878, "residual_variance": 7.560581487249193E-4, "terms": [{"term": "s(x0)", "edf": 5.565462917726109, "lambda": 0.01, "effect": [[0, 0.05372617086231997], [1.5, 0.9691540027370148], [3, 0.14397082861038832], [4.5, -0.9563267837823627], [6, -0.29412280569887217]]}]}
Counts: poisson family
admin
stat gam "[[0.0], [0.5], [1.0], [1.5], [2.0], [2.5], [3.0], [3.5], [4.0], [4.5], [5.0], [5.5], [6.0]]" "[1, 2, 4, 5, 6, 4, 3, 2, 1, 1, 0, 1, 1]" "{\"family\": \"poisson\", \"segments\": 5, \"points\": 5}"
mentdb
{"family": "poisson", "link": "log", "n": 13, "intercept": 0.5994931034355313, "deviance": 1.7328125135592587, "null_deviance": 18.03270719402035, "explained_deviance": 0.9039072450456103, "gcv": 0.33145867686758723, "edf": 4.756099000147326, "terms": [{"term": "s(x0)", "edf": 3.756099001499024, "lambda": 0.1, "effect": [[0, -0.4985785058668039], [1.5, 1.0337366314272591], [3, 0.4927300269630584], [4.5, -0.8065326092180253], [6, -0.7528839284863434]]}]}
Used in use cases (2 recipes)

    Epidemiologist › Hospital admissions, cold and heat (Poisson GAM)
    Climate & environment scientist › Non linear effects on the temperature
Often used with

    math exp

stat glmm <json_X> <json_y> <json_groups> <family>


Description

    Generalized linear mixed model with a random intercept per group (as R lme4 glmer): binomial (logit) or poisson (log), maximum likelihood by the Laplace approximation; fixed effects with z tests, variance of the groups, log-likelihood, AIC, BIC and the effect of each group

Parameters

    json_X:   The rows - String - required
    json_y:   The response (0 / 1, successes or counts) - String - required
    json_groups:   The group of each row - String - required
    family:   binomial or poisson - String - required
admin
stat glmm "[[0.5], [1.2], [2.0], [0.8], [1.5], [0.3], [1.9], [2.4], [1.1], [0.7], [2.2], [1.6], [0.4], [1.0], [2.6], [1.3], [0.9], [2.1], [1.7], [0.6]]" "[0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1]" "[\"A\", \"A\", \"A\", \"A\", \"A\", \"B\", \"B\", \"B\", \"B\", \"B\", \"C\", \"C\", \"C\", \"C\", \"C\", \"D\", \"D\", \"D\", \"D\", \"D\"]" "binomial"
mentdb
{"family": "binomial", "link": "logit", "method": "Laplace", "n": 20, "groups": 4, "fixed_effects": [{"term": "intercept", "estimate": -3.1890693370282857, "se": 1.4938269661697887, "z": -2.1348318173724916, "p_value": 0.03277475032567967, "lower": -6.116916389855805, "upper": -0.2612222842007661}, {"term": "x0", "estimate": 2.6830107374026593, "se": 1.1517587654977328, "z": 2.3294901829926125, "p_value": 0.019833112470834413, "lower": 0.425605038148789, "upper": 4.9404164366565295}], "group_variance": 2.0991287675939922E-9, "group_sd": 4.5816250038539735E-5, "log_likelihood": -9.09209179227705, "deviance": 18.1841835845541, "aic": 24.1841835845541, "bic": 27.17138040521607, "group_effects": {"A": 1.047265206131707E-9, "B": -1.1964180382222737E-9, "C": -3.148676514023124E-10, "D": 4.639841655143085E-10}}

stat glmm <json_X> <json_y> <json_groups> <family> <json_params>


Description

    GLMM with parameters: trials (binomial: number of trials of each row, y = successes), offset (log of the exposure of each row, poisson rates), quadrature (1 = Laplace, up to 25 points of adaptive Gauss-Hermite), level

Parameters

    json_X:   The rows - String - required
    json_y:   The response - String - required
    json_groups:   The group of each row - String - required
    family:   binomial or poisson - String - required
    json_params:   The parameters - String - required
admin
stat glmm "[[0], [1], [0], [1], [0], [1], [1], [0], [1], [0], [0], [1], [1], [0], [1], [0]]" "[2, 5, 1, 7, 3, 9, 4, 2, 6, 3, 1, 4, 8, 2, 5, 3]" "[\"A\", \"A\", \"A\", \"A\", \"B\", \"B\", \"B\", \"B\", \"C\", \"C\", \"C\", \"C\", \"D\", \"D\", \"D\", \"D\"]" "poisson" "{\"offset\": [0.0, 0.69, 0.0, 0.69, 0.0, 0.69, 0.69, 0.0, 0.69, 0.0, 0.0, 0.69, 0.69, 0.0, 0.69, 0.0], \"quadrature\": 7}"
mentdb
{"family": "poisson", "link": "log", "method": "adaptive Gauss-Hermite (7 points)", "n": 16, "groups": 4, "fixed_effects": [{"term": "intercept", "estimate": 0.7537680805874349, "se": 0.24253608411209335, "z": 3.1078595308690833, "p_value": 0.0018844761412044608, "lower": 0.27840609077635475, "upper": 1.229130070398515}, {"term": "x0", "estimate": 0.3479910359875654, "se": 0.28223588428263185, "z": 1.2329794167459094, "p_value": 0.2175834436736217, "lower": -0.20518113235120727, "upper": 0.9011632043263381}], "group_variance": 2.0706477028278383E-9, "group_sd": 4.550437015087494E-5, "log_likelihood": -28.07807894239743, "deviance": 56.15615788479486, "aic": 62.15615788479486, "bic": 64.4739240515142, "group_effects": {"A": -2.583097850482778E-9, "B": 3.616436428277028E-9, "C": -4.649609276736046E-9, "D": 3.616436428277028E-9}}
Used in use cases (1 recipe)

    Epidemiologist › Did the hygiene program reduce the infections? (Poisson mixed model)
Often used with

    math exp

stat rm_anova <json_measures>


Description

    Repeated measures ANOVA: one row per subject, one column per condition (time, treatment); F test of the conditions, Mauchly test of sphericity, Greenhouse-Geisser and Huynh-Feldt epsilons and corrected p-values

Parameters

    json_measures:   The measures [[c1, c2, ...], ...] - String - required
admin
stat rm_anova "[[45, 50, 55], [42, 46, 51], [50, 53, 60], [38, 44, 47], [47, 49, 57], [44, 48, 52]]"
mentdb
{"n": 6, "conditions": 3, "groups": 1, "anova": [{"source": "subjects", "ss": 231.7777777777778, "df": 5, "ms": 46.35555555555556}, {"source": "within: conditions", "ss": 263.11111111111086, "df": 2, "ms": 131.55555555555543, "f": 128.69565217391212, "p_value": 7.315829930742979E-8}, {"source": "within: error", "ss": 10.222222222222285, "df": 10, "ms": 1.0222222222222286}], "condition_means": [44.333333333333336, 48.333333333333336, 53.666666666666664], "sphericity": {"mauchly_w": 0.3742911153119091, "chi2": 3.9308856046550584, "df": 2, "p_value": 0.14009383900143346, "greenhouse_geisser_epsilon": 0.6151162790697672, "huynh_feldt_epsilon": 0.7137569401603943, "conditions_p_gg": 1.771051921617417E-5, "conditions_p_hf": 4.30605669010653E-6}}

stat rm_anova <json_measures> <json_params>


Description

    Mixed (split-plot) ANOVA with parameters: groups (a between-subjects factor): effect of the groups, of the conditions and their interaction

Parameters

    json_measures:   The measures - String - required
    json_params:   The parameters - String - required
admin
stat rm_anova "[[45, 50, 55], [42, 46, 51], [50, 53, 60], [38, 44, 47], [47, 49, 57], [44, 48, 52]]" "{\"groups\": [\"a\", \"a\", \"a\", \"b\", \"b\", \"b\"]}"
mentdb
{"n": 6, "conditions": 3, "groups": 2, "anova": [{"source": "between: groups", "ss": 37.55555555555547, "df": 1, "ms": 37.55555555555547, "f": 0.7734553775743686, "p_value": 0.42881261785410174}, {"source": "between: subjects (error)", "ss": 194.22222222222234, "df": 4, "ms": 48.555555555555586}, {"source": "within: conditions", "ss": 263.11111111111086, "df": 2, "ms": 131.55555555555543, "f": 107.6363636363627, "p_value": 1.6482278143437057E-6}, {"source": "within: conditions x groups", "ss": 0.4444444444444318, "df": 2, "ms": 0.2222222222222159, "f": 0.18181818181817525, "p_value": 0.8371039268727651}, {"source": "within: error", "ss": 9.777777777777853, "df": 8, "ms": 1.2222222222222316}], "condition_means": [44.333333333333336, 48.333333333333336, 53.666666666666664], "sphericity": {"mauchly_w": 0.31611570247933857, "chi2": 3.4549409559725914, "df": 2, "p_value": 0.17773342244163282, "greenhouse_geisser_epsilon": 0.5938650306748465, "huynh_feldt_epsilon": 0.7002617801047119, "conditions_p_gg": 1.6553725635337635E-4, "conditions_p_hf": 4.9071697542979464E-5, "interaction_p_gg": 0.7293952602517799, "interaction_p_hf": 0.7648414596109334}}
Used in use cases (1 recipe)

    Statistician & biostatistician › Repeated measures: time, group and their interaction

stat manova <json_Y> <json_groups>


Description

    MANOVA: do the groups differ on several variables together? Pillai, Wilks, Hotelling-Lawley and Roy tests with their F approximations (as R summary.manova), eigenvalues and the univariate ANOVA of each variable

Parameters

    json_Y:   The dependent variables (one row per observation) - String - required
    json_groups:   The group of each row - String - required
admin
stat manova "[[2.1, 30], [2.4, 32], [1.9, 29], [3.0, 35], [3.2, 37], [2.8, 34], [3.9, 36], [4.1, 39], [3.7, 35]]" "[\"a\", \"a\", \"a\", \"b\", \"b\", \"b\", \"c\", \"c\", \"c\"]"
mentdb
{"n": 9, "groups": 3, "variables": 2, "tests": [{"test": "pillai", "statistic": 1.5089782152948703, "approx_f": 9.219417115277569, "df1": 4, "df2": 12, "p_value": 0.0012103442691063782}, {"test": "wilks", "statistic": 0.00716092425485369, "approx_f": 27.04305946865521, "df1": 4, "df2": 10, "p_value": 2.4199961953352833E-5}, {"test": "hotelling_lawley", "statistic": 66.56961018297523, "approx_f": 66.56961018297523, "df1": 4, "df2": 8, "p_value": 3.534348378519958E-6}, {"test": "roy", "statistic": 65.46866878306969, "approx_f": 196.40600634920906, "df1": 2, "df2": 6, "p_value": 3.4052504360726488E-6}], "eigenvalues": [65.46866878306969, 1.1009413999055342], "univariate": [{"variable": "y0", "f": 49.00000000000001, "p_value": 1.9202321347289164E-4}, {"variable": "y1", "f": 11.148148148148161, "p_value": 0.00953377652944487}]}

stat mice <json_X>


Description

    Multiple imputation by chained equations (MICE): the missing values (null) of each column are drawn from a regression on the other columns, m times; predictive mean matching by default

Parameters

    json_X:   The rows, missing values = null - String - required
admin
stat mice "[[5.1, 1.2, 20], [6.3, null, 25], [4.8, 1.0, 19], [7.0, 2.1, null], [5.9, 1.6, 23], [6.6, 1.9, 27], [null, 1.4, 22], [5.5, 1.3, 21], [6.9, 2.0, 28], [6.1, 1.7, 24]]"
mentdb
{"n": 10, "m": 5, "method": "pmm", "missing_by_column": [1, 1, 1], "missing_cells": [[1, 1], [3, 2], [6, 0]], "imputed_values": [[1.7, 24, 6.1], [1.6, 28, 6.3], [2.1, 28, 6.3], [1.6, 24, 6.3], [1.6, 27, 5.1]]}

stat mice <json_X> <json_params>


Description

    MICE with parameters: m (imputations, 5), iterations (10), method (pmm or norm), donors (5), seed, return_data (the completed tables), analysis {"y": column, "family": "gaussian" / "binomial" / "poisson"} = a GLM on each completed table pooled by Rubin's rules (Barnard-Rubin df, fraction of missing information)

Parameters

    json_X:   The rows - String - required
    json_params:   The parameters - String - required
admin
stat mice "[[5.1, 1.2, 20], [6.3, null, 25], [4.8, 1.0, 19], [7.0, 2.1, null], [5.9, 1.6, 23], [6.6, 1.9, 27], [null, 1.4, 22], [5.5, 1.3, 21], [6.9, 2.0, 28], [6.1, 1.7, 24]]" "{\"m\": 10, \"analysis\": {\"y\": 0}}"
mentdb
{"n": 10, "m": 10, "method": "pmm", "missing_by_column": [1, 1, 1], "missing_cells": [[1, 1], [3, 2], [6, 0]], "imputed_values": [[1.7, 24, 6.1], [1.6, 28, 6.3], [2.1, 28, 6.3], [1.6, 24, 6.3], [1.6, 27, 5.1], [1.9, 28, 5.5], [2, 27, 5.5], [1.7, 24, 6.1], [2, 28, 5.9], [2.1, 23, 5.1]], "pooled": [{"term": "intercept", "estimate": 1.786870637162372, "se": 1.0813323522447411, "t": 1.652471262376458, "df": 3.1748258076365667, "p_value": 0.19198341994893942, "lower": -1.5496528519356982, "upper": 5.123394126260442, "within_variance": 0.7024061834224281, "between_variance": 0.4244304296261059, "fmi": 0.5938526897729032}, {"term": "x1", "estimate": 1.0403494492995264, "se": 0.9063491024437134, "t": 1.1478462840582278, "df": 2.485956754182692, "p_value": 0.34942982651133736, "lower": -2.2126679037111825, "upper": 4.293366802310235, "within_variance": 0.39412854390186997, "between_variance": 0.38849104690786807, "fmi": 0.6951287396465271}, {"term": "x2", "estimate": 0.10807325114458237, "se": 0.10211673204080071, "t": 1.0583304908484708, "df": 2.6668945916096605, "p_value": 0.3762232282243647, "lower": -0.24112281404588704, "upper": 0.4572693163350518, "within_variance": 0.00534254664022596, "between_variance": 0.004622982111333396, "fmi": 0.6684814778882213}]}
Used in use cases (1 recipe)

    Statistician & biostatistician › Missing values: multiple imputation instead of deleting the rows

stat pool <json_results> <json_params>


Description

    Rubin's rules: pool the estimates of m analyses of imputed data [{"estimate": [...], "se": [...]}, ...]: total variance, Barnard-Rubin degrees of freedom (df_complete), t test, interval, fraction of missing information

Parameters

    json_results:   The results of the m analyses - String - required
    json_params:   The parameters: df_complete, level - String - required
admin
stat pool "[{\"estimate\": [1.0, 2.0], \"se\": [0.5, 0.2]}, {\"estimate\": [1.2, 2.1], \"se\": [0.5, 0.25]}, {\"estimate\": [0.8, 1.9], \"se\": [0.6, 0.2]}]" "{\"df_complete\": 50}"
mentdb
{"m": 3, "pooled": [{"term": "b0", "estimate": 1, "se": 0.58309518948453, "t": 1.7149858514250886, "df": 27.060579812536, "p_value": 0.09777952827282221, "lower": -0.19628719240239256, "upper": 2.1962871924023926, "within_variance": 0.2866666666666666, "between_variance": 0.03999999999999998, "fmi": 0.21295861950631334}, {"term": "b1", "estimate": 2, "se": 0.24664414311581243, "t": 8.10884854079383, "df": 19.74800639048287, "p_value": 1.03652224359152E-7, "lower": 1.4850881353776346, "upper": 2.5149118646223654, "within_variance": 0.0475, "between_variance": 0.010000000000000018, "fmi": 0.2878277831286415}]}

stat tukey <json_values> <json_groups>


Description

    Tukey HSD: every pair of groups after an ANOVA, the difference of the means, its 95 % simultaneous interval and the adjusted p-value (studentized range)

Parameters

    json_values:   The values - String - required
    json_groups:   The group of each value - String - required
admin
stat tukey "[4.17, 5.58, 5.18, 6.11, 4.5, 4.61, 5.17, 4.53, 5.33, 5.14, 4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69, 6.31, 5.12, 5.54, 5.5, 5.37, 5.29, 4.92, 6.15, 5.8, 5.26]" "[\"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\"]"
mentdb
{"means": {"ctrl": 5.032, "trt1": 4.661, "trt2": 5.526}, "mse": 0.3885959259259259, "df": 27, "q_critical": 3.5064261233541822, "comparisons": [{"pair": "trt1 - ctrl", "difference": -0.37100000000000044, "lower": -1.062216051402869, "upper": 0.3202160514028679, "q": 1.8820223996884526, "p_value": 0.3908711442021068, "significant": false}, {"pair": "trt2 - ctrl", "difference": 0.4939999999999998, "lower": -0.19721605140286858, "upper": 1.1852160514028682, "q": 2.5059813084800378, "p_value": 0.19799599129957413, "significant": false}, {"pair": "trt2 - trt1", "difference": 0.8650000000000002, "lower": 0.17378394859713187, "upper": 1.5562160514028687, "q": 4.38800370816849, "p_value": 0.012006423979495806, "significant": true}]}

stat tukey <json_values> <json_groups> <level>


Description

    Tukey HSD at a confidence level

Parameters

    json_values:   The values - String - required
    json_groups:   The groups - String - required
    level:   The level, ex: 0.99 - Number - required
admin
stat tukey "[4.17, 5.58, 5.18, 6.11, 4.5, 4.61, 5.17, 4.53, 5.33, 5.14, 4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69, 6.31, 5.12, 5.54, 5.5, 5.37, 5.29, 4.92, 6.15, 5.8, 5.26]" "[\"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"ctrl\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt1\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\", \"trt2\"]" 0.99
mentdb
{"means": {"ctrl": 5.032, "trt1": 4.661, "trt2": 5.526}, "mse": 0.3885959259259259, "df": 27, "q_critical": 4.494842245526604, "comparisons": [{"pair": "trt1 - ctrl", "difference": -0.37100000000000044, "lower": -1.2570609062710534, "upper": 0.5150609062710524, "q": 1.8820223996884526, "p_value": 0.3908711442021068, "significant": false}, {"pair": "trt2 - ctrl", "difference": 0.4939999999999998, "lower": -0.39206090627105306, "upper": 1.3800609062710527, "q": 2.5059813084800378, "p_value": 0.19799599129957413, "significant": false}, {"pair": "trt2 - trt1", "difference": 0.8650000000000002, "lower": -0.021060906271052615, "upper": 1.7510609062710532, "q": 4.38800370816849, "p_value": 0.012006423979495806, "significant": false}]}
Used in use cases (1 recipe)

    Agronomist › Which varieties really differ?
Often used with

    equal

stat p_adjust <json_p_values> <method>


Description

    Adjust p-values for multiple tests: bonferroni, holm, hochberg, bh (Benjamini-Hochberg false discovery rate), by (Benjamini-Yekutieli)

Parameters

    json_p_values:   The p-values - String - required
    method:   bonferroni, holm, hochberg, bh or by - String - required
admin
stat p_adjust "[0.01, 0.02, 0.03, 0.04, 0.05]" "holm"
mentdb
[0.05, 0.08, 0.09, 0.09, 0.09]
False discovery rate
admin
stat p_adjust "[0.001, 0.008, 0.039, 0.041, 0.042, 0.06, 0.074, 0.205]" "bh"
mentdb
[0.008, 0.032, 0.0672, 0.0672, 0.0672, 0.08, 0.0845714285714286, 0.205]

stat power <test> <json_params>


Description

    Power of a test: t_two (two groups, d = Cohen effect size, n per group), t_one or t_paired (d, n), prop_two (p1, p2, n per group), anova (f, k groups, n per group), correlation (r, n), logrank (hr = hazard ratio, n total, p_event = probability of an event during the study, ratio = share of the first group; Schoenfeld); alpha (0.05), alternative (two_sided or greater)

Parameters

    test:   t_two, t_one, t_paired, prop_two, anova, correlation or logrank - String - required
    json_params:   The parameters - String - required
admin
stat power "t_two" "{\"d\": 0.5, \"n\": 64}"
mentdb
{"test": "t_two", "n": 64, "power": 0.8014595579857691}
admin
stat power "anova" "{\"f\": 0.25, \"k\": 4, \"n\": 30}"
mentdb
{"test": "anova", "n": 30, "power": 0.6065227867507059}
Survival: hazard ratio 0.7, 300 patients, 60 % with an event
admin
stat power "logrank" "{\"hr\": 0.7, \"n\": 300, \"p_event\": 0.6}"
mentdb
{"test": "logrank", "n": 300, "power": 0.6673846493083025}
Used in use cases (3 recipes)

    Statistician & biostatistician › How many subjects for the study?
    Statistician & biostatistician › Decide an A/B test
    Statistician & biostatistician › Size of a survival trial: events, patients and power
Often used with

    stat sample_size  ·  analytics abtest

stat sample_size <test> <json_params>


Description

    Smallest sample size that reaches a power (0.8 by default): per group for t_two, prop_two and anova, total for t_one, t_paired, correlation and logrank (with the number of events)

Parameters

    test:   The test - String - required
    json_params:   The parameters (without n), power - String - required
admin
stat sample_size "t_two" "{\"d\": 0.5}"
mentdb
{"test": "t_two", "n": 64, "power": 0.8014595579857691, "per": "group"}
Two proportions, 90 %
admin
stat sample_size "prop_two" "{\"p1\": 0.65, \"p2\": 0.45, \"power\": 0.9}"
mentdb
{"test": "prop_two", "n": 129, "power": 0.9017425187642312, "per": "group"}
Correlation
admin
stat sample_size "correlation" "{\"r\": 0.3}"
mentdb
{"test": "correlation", "n": 85, "power": 0.8003462498997719, "per": "total"}
Survival trial: hazard ratio 0.7, 40 % of events (247 events, Schoenfeld)
admin
stat sample_size "logrank" "{\"hr\": 0.7, \"p_event\": 0.4}"
mentdb
{"test": "logrank", "n": 617, "power": 0.8000214514370037, "per": "total", "events": 247}
Used in use cases (2 recipes)

    Statistician & biostatistician › How many subjects for the study?
    Statistician & biostatistician › Size of a survival trial: events, patients and power
Often used with

    stat power

stat vca <json_y> <json_factors>


Description

    Variance components of several random factors, crossed or nested (REML, as lme4 lmer with (1|a) + (1|b)): variance, sd and % of each factor and of the residual; nested factors: give the labels of the inner factor unique inside the outer one, ex: "B1/S2"

Parameters

    json_y:   The values - String - required
    json_factors:   The factors: a list of label lists - String - required
admin
stat vca "[20.1, 20.4, 21.3, 21.0, 19.2, 19.6, 23.4, 23.1, 22.0, 22.5, 24.1, 23.8]" "[[\"B1\", \"B1\", \"B1\", \"B1\", \"B1\", \"B1\", \"B2\", \"B2\", \"B2\", \"B2\", \"B2\", \"B2\"], [\"B1/S1\", \"B1/S1\", \"B1/S2\", \"B1/S2\", \"B1/S3\", \"B1/S3\", \"B2/S1\", \"B2/S1\", \"B2/S2\", \"B2/S2\", \"B2/S3\", \"B2/S3\"]]"
mentdb
{"n": 12, "components": [{"factor": "factor0", "levels": 2, "variance": 3.9074668588800217, "sd": 1.9767313572865741, "percent": 83.35989877676434}, {"factor": "factor1", "levels": 6, "variance": 0.7158322667506899, "sd": 0.8460687127832407, "percent": 15.271199335157686}, {"factor": "residual", "variance": 0.06416680969163915, "sd": 0.25331168486992295, "percent": 1.3689018880779662}], "total_variance": 4.687465935322351, "total_sd": 2.1650556425464798, "reml_criterion": 22.051166109915854, "aic": 28.051166109915854, "mean": 21.708333333399548}

stat vca <json_y> <json_factors> <json_params>


Description

    Variance components with parameters: names (of the factors), X (fixed covariates)

Parameters

    json_y:   The values - String - required
    json_factors:   The factors - String - required
    json_params:   The parameters - String - required
admin
stat vca "[17.29, 17.27, 17.84, 17.79, 18.19, 18.08, 20.72, 20.68, 21.41, 20.84, 20.93, 20.86, 21.99, 22.0, 22.06, 22.12, 22.37, 22.46, 19.17, 19.0, 18.76, 19.26, 19.02, 19.27, 17.03, 17.32, 17.33, 17.53, 18.33, 17.66]" "[[\"P1\", \"P1\", \"P1\", \"P1\", \"P1\", \"P1\", \"P2\", \"P2\", \"P2\", \"P2\", \"P2\", \"P2\", \"P3\", \"P3\", \"P3\", \"P3\", \"P3\", \"P3\", \"P4\", \"P4\", \"P4\", \"P4\", \"P4\", \"P4\", \"P5\", \"P5\", \"P5\", \"P5\", \"P5\", \"P5\"], [\"Op1\", \"Op1\", \"Op2\", \"Op2\", \"Op3\", \"Op3\", \"Op1\", \"Op1\", \"Op2\", \"Op2\", \"Op3\", \"Op3\", \"Op1\", \"Op1\", \"Op2\", \"Op2\", \"Op3\", \"Op3\", \"Op1\", \"Op1\", \"Op2\", \"Op2\", \"Op3\", \"Op3\", \"Op1\", \"Op1\", \"Op2\", \"Op2\", \"Op3\", \"Op3\"]]" "{\"names\": [\"part\", \"operator\"]}"
mentdb
{"n": 30, "components": [{"factor": "part", "levels": 5, "variance": 4.044760218904852, "sd": 2.0111589243281727, "percent": 97.37400095313826}, {"factor": "operator", "levels": 3, "variance": 0.04929395945092271, "sd": 0.22202243006264638, "percent": 1.1867081841152323}, {"factor": "residual", "variance": 0.05978583983492632, "sd": 0.24451143088805954, "percent": 1.4392908627465002}], "total_variance": 4.153840018190701, "total_sd": 2.038097156219669, "reml_criterion": 32.48972530489439, "aic": 38.48972530489439, "mean": 19.48600000002864}