Learn R Programming

papaja (version 0.1.0.9479)

apa_print.list: Format statistics from ANOVA (APA 6th edition)

Description

This methods performs comparisons of lm-objects and creates formatted chraracter strings and a model comparison table to report the results in accordance with APA manuscript guidelines.

Usage

"apa_print"(x, anova_fun = stats::anova, ci = 0.9, boot_samples = 10000, observed_predictors = TRUE, in_paren = FALSE, ...)

Arguments

x
List. List containing to be compared lm-objects. If the list is completely named, element names are used as model names in the ouptut object.
anova_fun
Function. Function to compare model-objects contained in x.
ci
Numeric. Confidence level for the bootstrap confidence interval for $\Delta R^2$ (range [0, 1]); ignored if boot_samples = 0.
boot_samples
Numeric. Number of bootstrap samples to estimate confidence intervals for $\Delta R^2$.
observed_predictors
Logical. Indicates whether predictor variables were observed. See details.
in_paren
Logical. Indicates if the formated string will be reported inside parentheses. See details.
...
Additional arguments passed to anova_fun

Value

apa_print.list returns a named list containing the following components according to the input:

Details

As demonstrated by Algina, Keselman & Penfield (2007), asymptotic confidence intervals for $\Delta R^2$ are often unreliable. Confidence intervals for model comparisons of lm-objects are, therefore, estimated using their modified percentile bootstrap method. Note that the accuracy of the confidence intervals depends on the number of predictors $p$, their distribution, and the sample size $n$:

"When the predictor distribution is multivariate normal, one can obtain accurate CIs for $\rho^2$ with $n \geq~50$ when $p = 3$. For $p = 6$ and for $p = 9$, $n \geq~100$ is advisable. When the predictor distribution is nonnormal in form, sample size requirements vary with type of nonnormality." (p. 939, Algina, Keselman & Penfield, 2010)

If MBESS is available, confidence intervals for $R^2$ are computed using ci.R2 to obtain a confidence region that corresponds to the confidence level ci, the default being a 90% CI (see Steiger, 2004). If observed_predictors = FALSE, it is assumed that predictors are fixed variables, i.e., "the values of the [predictors] were selected a priori as part of the research design" (p. 15, Kelly, 2007); put differently, it is assumed that predictors are not random. The confidence intervals for the regression coefficients in the model comparison table correspond to the $\alpha$-level chosen for $R^2$ and $\Delta R^2$ (e.g., 90% CI or $\alpha = 0.10$ for $R^2$ and $\Delta R^2$ yields a 95% CI for regression coefficients, Steiger, 2004).

If in_paren is TRUE parentheses in the formatted string, such as those surrounding degrees of freedom, are replaced with brackets.

References

Algina, J., Keselman, H. J., & Penfield, R. D. (2007). Confidence Intervals for an Effect Size Measure in Multiple Linear Regression. Educational and Psychological Measurement, 67(2), 207--218. doi:10.1177/0013164406292030

Algina, J., Keselman, H. J., & Penfield, R. D. (2010). Confidence Intervals for Squared Semipartial Correlation Coefficients: The Effect of Nonnormality. Educational and Psychological Measurement, 70(6), 926--940. doi:10.1177/0013164410379335

Steiger (2004). Beyond the F Test: Effect Size Confidence Intervals and Tests of Close Fit in the Analysis of Variance and Contrast Analysis. Psychological Methods, 9(2), 164-182. doi:10.1037/1082-989X.9.2.164

Kelley, K. (2007). Confidence intervals for standardized effect sizes: Theory, application, and implementation. Journal of Statistical Software, 20(8), 1-24. doi:10.18637/jss.v020.i08

See Also

anova

Other apa_print: apa_print.aov, apa_print.glht, apa_print.htest, apa_print.lm, apa_print

Examples

Run this code
   mod1 <- lm(Sepal.Length ~ Sepal.Width, data = iris)
   mod2 <- update(mod1, formula = . ~ . + Petal.Length)
   mod3 <- update(mod2, formula = . ~ . + Petal.Width)

   # No bootstrapped Delta R^2 CI
   apa_print(list(Baseline = mod1, Length = mod2, Both = mod3), boot_samples = 0)

Run the code above in your browser using DataLab