| apa_parameters | R Documentation |
format model parameters in APA style
apa_parameters(
fit,
predictor_parameters = c("Coefficient", "SE", "Std_Coefficient", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'glm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "t", "z",
"df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
...
)
## S3 method for class 'aov'
apa_parameters(
fit,
predictor_parameters = NULL,
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'aovlist'
apa_parameters(
fit,
predictor_parameters = NULL,
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'afex_aov'
apa_parameters(
fit,
predictor_parameters = NULL,
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'betareg'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
component_headings = TRUE,
...
)
## S3 method for class 'clmm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
thresholds = TRUE,
random = TRUE,
effect_headings = TRUE,
random_scale = c("sd", "variance"),
...
)
## S3 method for class 'gam'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "t", "z",
"df_error", "edf", "F", "Chi2", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
terms = c("all", "parametric", "smooth"),
...
)
## S3 method for class 'bam'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "t", "z",
"df_error", "edf", "F", "Chi2", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
terms = c("all", "parametric", "smooth"),
...
)
## S3 method for class 'geeglm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
ci = 0.95,
correlation_rows = NULL,
...
)
## S3 method for class 'lavaan'
apa_parameters(
fit,
predictor_parameters = NULL,
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
standardize = TRUE,
variances = FALSE,
intercepts = FALSE,
thresholds = FALSE,
ci = 0.95,
groups = c("columns", "rows"),
...
)
## S3 method for class 'rma'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "CI", "Exp_Coefficient",
"z", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
studies = NULL,
weights = TRUE,
transform = TRUE,
...
)
## S3 method for class 'mlm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Std_Coefficient", "t",
"df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
outcomes = c("rows", "columns"),
...
)
## S3 method for class 'multinom'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = TRUE,
category_headings = TRUE,
...
)
## S3 method for class 'zeroinfl'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = TRUE,
component_headings = TRUE,
...
)
## S3 method for class 'hurdle'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = TRUE,
component_headings = TRUE,
...
)
## S3 method for class 'rq'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
se = c("nid", "iid", "ker", "boot"),
ci = 0.95,
...
)
## S3 method for class 'rqs'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
se = c("nid", "iid", "ker", "boot"),
ci = 0.95,
quantiles = c("columns", "rows"),
...
)
## S3 method for class 'rlm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'lmrob'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'coxph'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = TRUE,
...
)
## S3 method for class 'survreg'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
...
)
## S3 method for class 'lm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Std_Coefficient", "t",
"df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
...
)
## S3 method for class 'polr'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
thresholds = TRUE,
...
)
## S3 method for class 'clm'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "z", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
thresholds = TRUE,
...
)
## S3 method for class 'merMod'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "t", "z",
"df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
random = TRUE,
effect_headings = TRUE,
random_scale = c("sd", "variance"),
...
)
## S3 method for class 'glmmTMB'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "Exp_Coefficient", "t", "z",
"df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
exponentiate = NULL,
random = TRUE,
effect_headings = TRUE,
random_scale = c("sd", "variance"),
...
)
## S3 method for class 'lme'
apa_parameters(
fit,
predictor_parameters = c("Parameter", "Coefficient", "SE", "t", "df_error", "p"),
starred = NA,
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
random = TRUE,
effect_headings = TRUE,
random_scale = c("sd", "variance"),
...
)
## S3 method for class 'list'
apa_parameters(
fit,
predictor_parameters = NULL,
starred = "deltaR2",
bolded = NA,
column_formats = NULL,
t_with_df = TRUE,
performance_parameters = c("R2", "deltaR2"),
performance_layout = c("rows", "columns"),
...
)
fit |
a fitted model: |
predictor_parameters |
columns to display, in order, named as in
|
starred |
columns to which significance stars are added (e.g., |
bolded |
columns whose values are bolded when p |
column_formats |
|
t_with_df |
if |
... |
arguments passed to methods. For |
exponentiate |
if |
component_headings |
for models with two components, if |
thresholds |
for ordinal models, if |
random |
for mixed models, if |
effect_headings |
for mixed models, if |
random_scale |
for mixed models, |
terms |
for generalized additive models ( |
ci |
for quantile regression ( |
correlation_rows |
for generalized estimating equations
( |
standardize |
for |
variances, intercepts |
for |
groups |
for multiple-group |
studies |
for meta-analyses ( |
weights |
for the study rows of meta-analyses, if |
transform |
for meta-analyses, if |
outcomes |
for multivariate linear models ( |
category_headings |
for multinomial models, if |
se |
for quantile regression models, the method of computing standard
errors, passed to |
quantiles |
for quantile regression models with several quantiles
( |
performance_parameters |
for lists of models, model comparison metrics passed to |
performance_layout |
for lists of models, where the model comparison metrics go: |
For lists of models in rows (the default layout), each model's statistics follow its parameters, and the first model is tested against a model with only a constant (and the random effects of mixed models). The test row is starred, and the note defines it. The defaults by kind of model are:
| Models | Fit | Test of the change | Also |
lm; glm with an estimated dispersion | R^2^ and \Delta R^2 | F | |
glm with a fixed dispersion (e.g., binomial, Poisson) | pseudo-R^2^ | likelihood ratio \chi^2 | AIC |
polr, clm, multinom, betareg | pseudo-R^2^ | likelihood ratio \chi^2 | AIC |
zeroinfl, hurdle | likelihood ratio \chi^2 | AIC | |
Mixed models (lme4, glmmTMB, nlme, clmm) | marginal and conditional R^2^ | likelihood ratio \chi^2 | AIC |
coxph, survreg | Nagelkerke's R^2^ and C | likelihood ratio \chi^2 | AIC |
lmrob | robust R^2^ and its change | robust Wald \chi^2 | |
rlm | robust residual scale | none | |
rq | R^1^ | none | AIC |
GEE (geeglm) | QIC | Wald \chi^2 of the added terms | |
GAMs (mgcv) | R^2^ and \Delta R^2 | none | AIC |
Lists of different kinds of models get R^2^ and \Delta R^2. Give
performance_parameters to choose the statistics yourself.
For glm objects (including MASS::glm.nb), the test statistic is z for families with a fixed dispersion parameter (binomial, Poisson, negative binomial) and t for families with an estimated dispersion parameter (Gaussian, Gamma, inverse Gaussian, quasi families). Whichever statistic applies is displayed. The exponentiated coefficient column (Exp_Coefficient) is labeled OR for logit links, IRR for log links in count models (Poisson, quasi-Poisson, negative binomial), RR for log links in binomial models, and Exp(B) otherwise.
For aov models (including repeated-measures models with an Error() term) and afex models, apa_parameters() returns the ANOVA table from apa_anova(). predictor_parameters and t_with_df are ignored, and other arguments in ... (e.g., effect_size, type) are passed to apa_anova(). To display regression coefficients instead, refit the model with stats::lm().
For beta regression models (betareg::betareg), which model outcomes
between 0 and 1 (e.g., proportions), the mean model and the precision
model (\phi) are each introduced by a heading row ("Mean model"
and "Precision model"). Coefficients are tested with Wald z tests. With
a logit link for the mean (the default), mean coefficients are log odds of
the mean proportion, and their exponentiated values (shown by default) are
odds ratios, labeled OR. Precision coefficients are not exponentiated.
Higher precision means less variability around the mean. A constant
precision (a model without a | part, as in y ~ x) is shown as one
\phi row with its estimate and standard error, without a test.
apa_note() names the links and gives the number of cases.
For ordinal mixed models (cumulative link mixed models fit with
ordinal::clmm()), the predictors and thresholds are displayed as for
ordinal::clm() models: Wald z tests, cumulative odds ratios (OR) for
logit links, and thresholds (cutpoints) below the predictors, without
tests. The random effects are displayed as for lme4 models, under a
"Random effects" heading (see random, effect_headings, and
random_scale). Models fit with the older ordinal::clmm2() are not
supported.
For generalized additive models fit with mgcv::gam() or mgcv::bam(),
the table has the parametric terms (coefficients, standard errors, and
their t or z tests) and the smooth terms (effective degrees of freedom
and their approximate F or \chi^2 tests), as reported
by summary(), under the headings "Parametric terms" and "Smooth terms".
Smooth terms are labeled by their type and variables (e.g., "s(Age)" or
"te(Longitude, Latitude)"), and smooths of a factor-by variable are labeled
by level (e.g., "s(Age): Group = Treatment"). Coefficients of log and logit
links are exponentiated by default, as for stats::glm() models.
apa_note() names the method used to estimate the smoothing parameters.
For generalized estimating equations fit with geepack::geeglm(),
coefficients are shown as for glm models, with exponentiated
coefficients for logit and log links, and tested with Wald z tests
(z^2^ is geepack's Wald statistic). Standard errors are geepack's
robust (sandwich) estimates, or its jackknife estimates if the model was
fit with them (std.err). The estimated parameters of the working
correlation are shown below the coefficients, with their standard errors
but no tests (correlation_rows; when they are not shown, a single
\alpha is given in the note). apa_note() names the link, the
working correlation, the kind of standard errors, and the numbers of
observations and clusters. Lists of models are compared with Wald tests
of the terms added to the previous model (from geepack's anova()) and
by QIC, because GEE models have no likelihood.
For structural equation models and confirmatory factor analyses fit with lavaan, estimates come from lavaan::standardizedSolution() (standardize = TRUE, default) or lavaan::parameterEstimates() (standardize = FALSE). Each kind of parameter is introduced by a heading row: "Factor loadings" (e.g., Visual \rightarrow x1), "Regressions" (e.g., Speed \leftarrow Visual), "Correlations" (or "Covariances", if unstandardized; e.g., Visual \leftrightarrow Textual), and "Defined parameters" (e.g., indirect effects defined with :=), followed, if requested, by variances, intercepts, and thresholds. The default columns are the estimate, its standard error, and its p-value; "z", "CI", and (with standardize = TRUE) "Coefficient" for unstandardized estimates can be added to predictor_parameters. Unstandardized parameters fixed to set the scale of a factor (e.g., marker loadings fixed at 1) are not tested. Variable names are shown as written in the model, with the first letter capitalized and underscores replaced by spaces.
For multiple-group models (e.g., group = "school"), the groups are shown side by side by default, with one row for each parameter and a column spanner for each group, so that the groups can be compared row by row. With groups = "rows", each group has a heading row, with the kinds of parameters indented below it. A defined parameter that uses the labels of one group is shown with that group. One that combines groups (e.g., the difference between two groups' paths) is shown in the first group's columns, or under an "Across groups" heading. apa_note() gives the size of each group and names the parameters constrained to be equal across groups (group.equal), and any exceptions (group.partial). Standardized estimates of equal parameters can still differ across groups, because standardization uses each group's variances.
For meta-analyses fit with metafor::rma() (random-effects or
equal-effects models, without or with moderators), the table of a model
without moderators has a row for each study, labeled by the study labels
(slab), with its effect size, confidence interval, and percentage of the
total weight, followed by the pooled estimate under a rule. The column of
effect sizes is named by the measure given to metafor::escalc() (e.g.,
g for standardized mean differences, r for correlations, and OR for
odds ratios). apa_note() names the measure and the model (including the
estimator of \tau^2), and gives the test of the pooled
estimate, its prediction interval, and the test of heterogeneity. The
table of a meta-regression has the intercept and moderators, as for other
regression models. apa_performance() gives the heterogeneity statistics.
Multilevel meta-analyses fit with metafor::rma.mv() (e.g., several effect
sizes nested in studies, with random = ~ 1 | study / effect) get the
same tables, with a row for each effect size. apa_note() names the
levels and their numbers of units, and gives each level's variance
component (\sigma^2) and the multilevel I^2
(Cheung, 2014). Random effects with an ~ inner | outer structure (e.g.,
correlated outcomes within studies) are not yet supported.
For multivariate linear models, fit with stats::lm() and several outcomes
(lm(cbind(y1, y2) ~ x), class mlm), each outcome's coefficients are
shown as for an lm model, under a heading row for each outcome (or side
by side, with outcomes = "columns"). The coefficients and their tests
are those of a separate regression of each outcome on the same
predictors, so they do not take the correlations among the outcomes into
account. For multivariate tests of each predictor, use apa_anova().
Lists of multivariate models are not supported yet.
For multinomial logistic regression models (nnet::multinom), each outcome
category except the reference category (the first level of the response)
has its own block of coefficients, introduced by a heading row such as
"Part time vs. Not working". Coefficients are log odds of the category
relative to the reference category, tested with Wald z tests, and their
exponentiated values (shown by default) are odds ratios relative to the
reference category (sometimes called relative risk ratios), labeled OR.
To compare the categories with a different reference, relevel the response
(e.g., with stats::relevel()) before fitting the model. apa_note() names
the reference category.
For zero-inflated and hurdle count models fit with pscl::zeroinfl() and
pscl::hurdle(), the count model and the zero model are each introduced by
a heading row ("Count model" and "Zero-inflation model" or "Zero hurdle
model"); with component_headings = FALSE, the zero model's coefficients
are labeled "Zero-inflation: " or "Zero hurdle: " instead. Coefficients are tested with Wald z tests. Only the count model's
coefficients are exponentiated (by default), giving incidence rate ratios
(IRR), because the zero model has a different link and meaning. In a
zero-inflated model, the zero model predicts excess zeros (zeros not
produced by the count model); in a hurdle model, it predicts whether the
count is greater than zero. apa_note() says which, names the count
distribution, and gives the negative binomial dispersion parameter
(\theta).
For quantile regression models (quantreg::rq), coefficients are the
change in a quantile of the outcome (e.g., the median, with tau = .5)
per unit of the predictor, tested with t tests of the coefficient
divided by its standard error (see se). apa_note() names the quantile
and the kind of standard errors. Models with several quantiles show the
estimates of each quantile side by side (see quantiles).
For robust regression models (MASS::rlm and robustbase::lmrob),
coefficients are tested with t tests, as in linear regression, but
cases with large residuals get less weight. Standardized coefficients are
not shown by default, because standardizing with the ordinary standard
deviations does not match a robust fit. apa_note() names the estimator
and its weight function (e.g., MM-estimation with bisquare weights), says
how the standard errors were computed, and gives N and the number of
cases whose weights are below .10, which have almost no influence on the
estimates. For rlm, the p-values are computed by the parameters
package, because MASS gives none.
For Cox proportional hazards models (survival::coxph), coefficients are
log hazard ratios, tested with Wald z tests, and their exponentiated
values (shown by default) are hazard ratios, labeled HR. A hazard ratio
above 1 means that the event happens sooner (at a higher rate) as the
predictor increases. The model has no intercept. apa_note() names the
model and gives the number of cases and of events.
For parametric survival models (survival::survreg), which are
accelerated failure time models for distributions of log time (e.g., the
default Weibull, exponential, log-normal, and log-logistic), coefficients
are changes in log survival time, tested with Wald z tests, and their
exponentiated values (shown by default) are time ratios, labeled TR. A
time ratio above 1 means that the event happens later as the predictor
increases, the opposite of a hazard ratio above 1. The constant and the
log of the scale parameter, Log(scale), are not exponentiated. The scale
is tested only for Weibull models, where a scale of 1 is the exponential
model. apa_note() names the distribution and gives the number of cases
and of events.
For ordinal regression models (MASS::polr and ordinal::clm), coefficients are tested with Wald z tests. (parameters reports t for polr, but the test is asymptotically normal, and clm reports z for the same model.) With a logit link, exponentiated coefficients are cumulative odds ratios, labeled OR. Threshold rows show only the estimate, its standard error, and its confidence interval, because their exponentiated values are not odds ratios, and testing whether a threshold equals 0 is not meaningful. Confidence intervals ("CI", "Exp_CI") are Wald z intervals, consistent with the z tests.
For mixed models fit with lme4 (lmer and glmer), fixed effects are displayed as for lm and glm models. For linear mixed models, t tests and confidence intervals use Kenward-Roger degrees of freedom by default (ci_method = "kenward", which requires the pbkrtest package); pass another ci_method (e.g., "satterthwaite", which requires lmerTest, or "wald") to change this. When the degrees of freedom differ across fixed effects, they are shown in a df column rather than in the t column header. Random-effect rows show only the estimated standard deviation (SD) or correlation (r), or with random_scale = "variance", the variance (Var) or covariance (Cov), grouped by cluster (grouping factor) under a subheading for each cluster, with nested clusters named, e.g., "Classroom in School". The fixed and random effects are introduced by heading rows (effect_headings = TRUE). The random-effects heading names the statistic of the SD or variance rows (e.g., "Random effects (SD)"), and correlation or covariance rows name their own (e.g., "r (Constant, Days)"). apa_note() defines the symbols.
For mixed models fit with glmmTMB::glmmTMB(), fixed effects are tested with z tests, and random effects are displayed as for lme4 models. Coefficients of log and logit links are exponentiated by default (e.g., IRR for Poisson and negative binomial models). When the model has a zero-inflation part (ziformula) or a dispersion part (dispformula), each part is introduced by a heading row ("Conditional model", "Zero-inflation model", or "Dispersion model"), and only the conditional model's coefficients are exponentiated. A dispersion parameter that is not modeled (i.e., without a dispformula) is not displayed.
For linear mixed models fit with nlme::lme(), fixed effects are tested with t tests whose degrees of freedom are computed by nlme from the grouping levels at which each effect varies, and random effects are displayed as for lme4 models. Parameters of residual correlation structures (correlation, e.g., nlme::corAR1()) and variance functions (weights, e.g., nlme::varIdent()) are displayed below the residual SD, and apa_note() names the structures.
apa7_tbl (tibble)
Ferrari, S. L. P., & Cribari-Neto, F. (2004). Beta regression for modelling rates and proportions. Journal of Applied Statistics, 31(7), 799–815. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/0266476042000214501")}
Smithson, M., & Verkuilen, J. (2006). A better lemon squeezer? Maximum-likelihood regression with beta-distributed dependent variables. Psychological Methods, 11(1), 54–71. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/1082-989X.11.1.54")}
Halekoh, U., Højsgaard, S., & Yan, J. (2006). The R package geepack for generalized estimating equations. Journal of Statistical Software, 15(2). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v015.i02")}
Liang, K.-Y., & Zeger, S. L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73(1), 13–22. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/73.1.13")}
Pan, W. (2001). Akaike's information criterion in generalized estimating equations. Biometrics, 57(1), 120–125. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.0006-341X.2001.00120.x")}
Cheung, M. W.-L. (2014). Modeling dependent effect sizes with three-level meta-analyses: A structural equation modeling approach. Psychological Methods, 19(2), 211–229. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/a0032968")}
DerSimonian, R., & Laird, N. (1986). Meta-analysis in clinical trials. Controlled Clinical Trials, 7(3), 177–188. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/0197-2456(86)90046-2")}
Knapp, G., & Hartung, J. (2003). Improved tests for a random effects meta-regression with a single covariate. Statistics in Medicine, 22(17), 2693–2710. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.1482")}
Hendricks, W., & Koenker, R. (1992). Hierarchical spline models for conditional quantiles and the demand for electricity. Journal of the American Statistical Association, 87(417), 58–68. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.1992.10475175")}
Koenker, R., & Bassett, G. (1978). Regression quantiles. Econometrica, 46(1), 33–50. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/1913643")}
Koenker, R., & Machado, J. A. F. (1999). Goodness of fit and related inference processes for quantile regression. Journal of the American Statistical Association, 94(448), 1296–1310. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.1999.10473882")}
Huber, P. J. (1964). Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35(1), 73–101. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aoms/1177703732")}
Renaud, O., & Victoria-Feser, M.-P. (2010). A robust coefficient of determination for regression. Journal of Statistical Planning and Inference, 140(7), 1852–1862. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jspi.2010.01.008")}
Yohai, V. J. (1987). High breakdown-point and high efficiency robust estimates for regression. The Annals of Statistics, 15(2), 642–656. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1176350366")}
Cox, D. R. (1972). Regression models and life-tables. Journal of the Royal Statistical Society: Series B (Methodological), 34(2), 187–202. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.2517-6161.1972.tb00899.x")}
Harrell, F. E., Califf, R. M., Pryor, D. B., Lee, K. L., & Rosati, R. A. (1982). Evaluating the yield of medical tests. JAMA, 247(18), 2543–2546. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1001/jama.1982.03320430047030")}
Wei, L. J. (1992). The accelerated failure time model: A useful alternative to the Cox regression model in survival analysis. Statistics in Medicine, 11(14–15), 1871–1879. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.4780111409")}
lm(mpg ~ cyl + wt, data = mtcars) |>
apa_parameters() |>
apa_flextable()
# Confidence intervals with robust (HC3) standard errors
if (requireNamespace("sandwich", quietly = TRUE)) {
lm(mpg ~ cyl + wt, data = mtcars) |>
apa_parameters(
predictor_parameters = c("Parameter", "Coefficient", "SE", "CI", "t", "df_error", "p"),
vcov = "HC3"
) |>
apa_flextable()
}
# Hierarchical regression: a list of models, with R-squared and its
# change in rows below each model's parameters
models <- list(
`Model 1` = lm(mpg ~ cyl, data = mtcars),
`Model 2` = lm(mpg ~ cyl + wt, data = mtcars)
)
apa_parameters(models)
# The same statistics in columns
apa_parameters(models, performance_layout = "columns")
# Logistic regression, with odds ratios
glm(am ~ wt + hp, data = mtcars, family = binomial) |>
apa_parameters()
if (requireNamespace("betareg", quietly = TRUE)) {
data("ReadingSkills", package = "betareg")
d <- ReadingSkills
d$dyslexia <- factor(d$dyslexia, levels = c("no", "yes"))
# Reading accuracy, with the precision depending on dyslexia and IQ
betareg::betareg(accuracy ~ dyslexia * iq | dyslexia + iq, data = d) |>
apa_parameters()
}
if (requireNamespace("ordinal", quietly = TRUE)) {
# Bitterness ratings of wine, with judges as a random factor
data("wine", package = "ordinal")
ordinal::clmm(rating ~ temp + contact + (1 | judge), data = wine) |>
apa_parameters()
}
if (requireNamespace("mgcv", quietly = TRUE)) {
mgcv::gam(mpg ~ am + s(hp, k = 5) + s(wt, k = 5), data = mtcars,
method = "REML") |>
apa_parameters()
}
# Generalized estimating equations
if (requireNamespace("geepack", quietly = TRUE)) {
data(ohio, package = "geepack")
fit_gee <- geepack::geeglm(
resp ~ age + smoke,
id = id,
data = ohio,
family = binomial,
corstr = "exchangeable"
)
apa_parameters(fit_gee)
}
if (requireNamespace("lavaan", quietly = TRUE)) {
model <- "visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9
speed ~ visual + textual"
lavaan::sem(model, data = lavaan::HolzingerSwineford1939) |>
apa_parameters()
# Multiple groups, side by side
lavaan::cfa(
"visual =~ x1 + x2 + x3",
data = lavaan::HolzingerSwineford1939,
group = "school",
group.equal = "loadings"
) |>
apa_parameters()
}
if (requireNamespace("metafor", quietly = TRUE) &&
requireNamespace("metadat", quietly = TRUE)) {
d_bcg <- metafor::escalc(
measure = "RR",
ai = tpos, bi = tneg, ci = cpos, di = cneg,
data = metadat::dat.bcg,
slab = paste(author, year)
)
fit_meta <- metafor::rma(yi, vi, data = d_bcg)
apa_parameters(fit_meta)
apa_performance(fit_meta)
# Meta-regression
metafor::rma(yi, vi, mods = ~ ablat, data = d_bcg) |>
apa_parameters()
}
# Multivariate regression: the coefficients of each outcome
fit_mlm <- lm(cbind(mpg, qsec) ~ wt + hp, data = mtcars)
apa_parameters(fit_mlm)
apa_parameters(fit_mlm, outcomes = "columns")
if (requireNamespace("nnet", quietly = TRUE) &&
requireNamespace("carData", quietly = TRUE)) {
d <- carData::Womenlf
d$partic <- relevel(d$partic, ref = "not.work")
nnet::multinom(partic ~ hincome + children, data = d, trace = FALSE) |>
apa_parameters()
}
if (requireNamespace("pscl", quietly = TRUE)) {
data("bioChemists", package = "pscl")
pscl::zeroinfl(art ~ fem + kid5 + ment | ment,
data = bioChemists, dist = "negbin") |>
apa_parameters()
}
if (requireNamespace("quantreg", quietly = TRUE) &&
requireNamespace("psych", quietly = TRUE)) {
d <- psych::sat.act
d$female <- as.integer(d$gender == 2)
# ACT scores at the 25th, 50th, and 75th percentiles
quantreg::rq(ACT ~ education + female, tau = c(.25, .5, .75), data = d) |>
suppressWarnings() |>
apa_parameters()
}
if (requireNamespace("robustbase", quietly = TRUE) &&
requireNamespace("carData", quietly = TRUE)) {
# Reported weight by measured weight; one measured weight is a data
# entry error (weight and height swapped)
d <- carData::Davis
robustbase::lmrob(repwt ~ weight * sex, data = d) |>
apa_parameters()
}
if (requireNamespace("survival", quietly = TRUE) &&
requireNamespace("carData", quietly = TRUE)) {
# Time to rearrest after release from prison
survival::coxph(
survival::Surv(week, arrest) ~ fin + age + prio,
data = carData::Rossi
) |>
apa_parameters()
}
if (requireNamespace("MASS", quietly = TRUE) &&
requireNamespace("carData", quietly = TRUE)) {
MASS::polr(poverty ~ gender + age, data = carData::WVS, Hess = TRUE) |>
apa_parameters()
}
if (requireNamespace("lme4", quietly = TRUE) &&
requireNamespace("pbkrtest", quietly = TRUE)) {
lme4::lmer(Reaction ~ Days + (Days | Subject), data = lme4::sleepstudy) |>
apa_parameters()
}
if (requireNamespace("glmmTMB", quietly = TRUE)) {
data(Salamanders, package = "glmmTMB")
glmmTMB::glmmTMB(
count ~ mined + (1 | site),
ziformula = ~ mined,
family = poisson,
data = Salamanders
) |>
apa_parameters()
}
if (requireNamespace("nlme", quietly = TRUE)) {
nlme::lme(
distance ~ age + Sex,
random = ~ 1 | Subject,
correlation = nlme::corAR1(),
data = nlme::Orthodont
) |>
apa_parameters()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.