![]() If you don’t have it already, it’s free to downloada and install, just like R. The code here can be adapted for pretty much any formatting you need, though, so feel free to take what works for you and leave the rest. APA style is also particularly demanding and nit-picky, so conforming to APA standards is a good exercise for showing customization options. Although these are excellent packages, I find they don’t work consistently (or at all) for Word output, which is a deal breaker for a lot of people.Ĭreating an APA style ANOVA table from R outputĪ quick note: I’m using APA style results for the examples here because that’s my background. For example, if you’re creating pdf documents, you may prefer pander, xtable or stargazer, all of which are much more powerful and elegant. ![]() Depending on your desired output, though, you may find other packages better suited to your needs. Enjoy.) I recommend knitr and kable for people just getting into writing dynamic documents (also called literate statistical programming) because they’re the easiest and most flexible tools, especially since they can be used to create Word documents (not just pdfs or html pages). (Side note to the fiber enthusiasts: Yes, you’re not imagining it - pretty much all of this stuff is playfully named after yarn, knitting, and textile references. We’ll use one of the most basic functions for creating tables, kable, which is from one of the most user-friendly packages for combining R code and output together, knitr. In this tutorial, I’ll cover examples for one common model (an analysis of variance, or ANOVA) and show you how you can get table and in-line output automatically. I’m writing this post in R Studio as an R-markdown document.Įven if you’ve never used markdown or R-markdown before, you can jump right in and start getting properly formatted output from R. I wrote my entire dissertation in R Studio, in fact, using sweave to integrate my R code with LaTeX typesetting. I almost never type out my results anymore I let R do it for me. These are called dynamic documents, and they’re awesome. Happily, R integrates beautifully with output documents, allowing you to ask the computer to fill in the numbers in your tables and text for you, so you never have to wake up in a cold sweat panicking about a typo in your correlation matrix. Through the years, I’ve learned that the only sure way to reduce human error is to give humans (including myself) as little opportunity to interfere in the process as possible. ![]() No matter how carefully I check my work, there’s always the nagging suspicion that I could have confused the contrasts for two different factors, or missed a decimal point or a negative sign.Īlthough I’m usually overreacting, I think my paranoia isn’t completely misplaced - little errors are much too easy to make, and they can have horrifying consequences. I don’t know what fears keep you up at night, but for me it’s worrying that I might have copy-pasted the wrong values over from my output.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |