Assumptions & Ground Rules

Since you have already completed Project Assignments #1 and #2, I assume you have found an article on a topic of interest to you that either 1) uses NYS data (direct reproduction) or 2) does not use NYS data but uses measures similar to or related to those found in the NYS (conceptual replication). Moreover, since you have already completed R Assignments #1 through #4, I assume that you are familiar with: (1) RStudio; (2) creating organized, descriptive, and reproducible R Markdown (RMD) files; and (3) creating and working within a reproducible file structure. If not, please review R Assignments 1-4.

Unlike your previous assignments, this assignment will not be as explicitly directed or organized as previous assignments. While I will provide you with basic guidelines and things to include, this is your chance to demonstrate your own creativity and show what you have learned by crafting your own RMD file as you see fit. The final knitted file should contain the following parts:

Part 1

Describe Article and Specific Findigs

  1. Provide a full citation and link to the article you are reproducing or conceptually replicating (see Project Phase 2 Instructions for details).

  2. Describe the article’s main purpose (e.g. key research questions and/or hypotheses) and findings.

    • Note: Be sure to use propper in-text citations and quotes when drawing explicitly from the text in the article. However, the bulk of this should be your own words (i.e. you should be paraphrasing and summarizing the article’s purpose in your own words).
    • Note: In “R Assignment #3” I included a couple of block quotes from Warr’s (1993) article (e.g. I included the abstract and a sentence from the “Data and Methods” section). To include block quotes, you simiply place a “greater than sign” (>) prior to the passage you want to quote. Here is what it looks like in my RMD file and the knitted html file:

RMD Block Quote:

HTML Block Quote:

  1. Justify your choice to reproduce and/or conceptually replicate the article. - This could be based on the number of times it has been cited, theoretical importance, practical importance, etc. You simply want to have a clearly articulated rationale for why this particular article should be reproduced or conceptually replicated.
    • I recommend going back to the Janz and Freese (2021) optional reading from Week #4. They have a good discussion about the importanc of having a “clarifying purpose” for engaging in a replication attempt.
    • Daniel Laken’s has a somewhat more technical formula/discussion for choosing what to replicate based on its “replication value” (see his blog entry and an expanded treatment with co-authors in a pre-print by Isager et al.).
    • See justification on pg. 1810 (section: “Example: Walking the Talk”) from our own work (Brauer et al., 2021) for one example of how this is done in practice.

Part 2

Insert Image and Description of Key Table(s) and/or Figure(s)

  1. Insert images of and describe the results presented in the table(s) and/or figure(s) found in the original study that you plan to reproduce. You have not yet learned how to do this in R Markdown, so I will give a brief and very basic tutorial below.

Brief Tutorial: Save & Load Simple Image in RMD

Getting a basic image into R Markdown is relatively easy. The steps involve: (1) creating an “Images” subfolder within your working directory or root folder of whatever project you are working on (e.g., “work” folder or “LastName_RR-Project-Phase-3” folder); (2) getting the image(s) you want; (3) editing the image(s) and saving it in your new “Images” sub-folder within your working directory; (4) Inserting a code chunk to load the image(s) in R Markdown. We will briefly go through each of these steps below.

  1. Before getting your image from the published article you selected, you will need a directory in which you can save the image and from which you can load the image in R Markdown. Once you have a subfolder within your working directory, you can easily load an image within this folder by using an R code chunk in R Markdown (process similar to saving and loading a dataset). We recommend creating a new directory (i.e., folder) entitled “Images” within your root “work” folder. Recall, if you opened R Studio directly from an RMD file in your working directory (i.e., in your “work” folder or “LastName_RR-Project-Phase-3” folder), then you can easily add an “Images” subfolder to your root folder like you did in “R Assignment #4.”

  2. We assume you know how to take and crop a screenshot, or to copy-and-paste, the image(s) or table(s) that you wish to reproduce from the original published article that you have chosen.

  3. As for editing the image, one easy way to do this is simply to paste the image into a new PowerPoint slide. From here, you can edit the image however you wish, then PowerPoint’s “save as picture” option should result in a saved image that retains your edits. Of course there are lots of different software packages for editing images and you can use whatever you prefer. - When editing, I (Jon) like to use subtle effects such as the “center shadow rectangle,” which gives some depth to your image without being overly distracting.

  • After editing the image, right-click and select “Save as Picture.” We strongly recommend naming the file without any spaces (e.g., “ProjAssign1-ppt-saveimage”) and selecting the JPEG format (“.jpg”).

  1. Now that you have a JPEG image saved in your “Images” sub-folder within your working directory, you are ready to insert it.
  • You can insert a image with an R code chunk. This allows you to provide a caption for the image and control the size of the image using the code chunk options. Here is an example with Warr’s (1993) Figure 1 from R Assignment #3.
Warr (1993) Figure 1, pg. 22

Warr (1993) Figure 1, pg. 22

  • Here is a screenshot of the R code that I used to load the image above:
R code chunk for including images in R Markdown

R code chunk for including images in R Markdown

  • Note: the "R code options line has some things that you may be unfamiliar with.
    • First, the R code chunk is named–in this case, it is named “image-Warr-fig1p22.” Up to this point, you have not been naming your R code chunks, and that is fine. However, as you become more familiar with and regularly use R Markdown, you may wish to start naming your code chunks. If you do, note that each code chunk must have a unique name or you will encounter those dreaded knitting errors! For more on naming R code chunks, see here, here, here, and here.
    • Second, the chunk includes the text “out.width = ‘80%’, which instructs R to reduce the size of the image to 80% of its size during the knitting process. Use”out.width" and “out.height” to control the size of non-R figures and images; for figures generated by R, other options are recommended (e.g., to control their size and associated text scaling).
    • Third, you may have noticed that this screenshot contains a caption, whereas the previous ones did not. I included the caption by putting a comma after the out.width command and then adding the following text to the R code chunk options: fig.cap = "Warr (1993) Figure 1, pg. 22"
  • The R code line itself starts by calling the “knitr” package (knitr::) (this means you would need the “knitr” package installed), then calling the include_graphics function from that package. This is followed by our familiar here() function to point to the “Images” sub-folder within our working directory, followed by the name of the file (including its .jpg extension).

That’s it. Now you should be able to load an image containing the table(s) or figure(s) you are reproducing into R Markdown!

Part 3

Write Conclusion and Submit Knitted File and File Structure

Upon completing the tasks in the previous sections:

  1. Create a "Conclusion section where you discuss the limitations of your proposed reproduction or replication and any issues or problems you anticipate in trying to replicate or reproduce the results in the table(s) and/or figure(s) you identified.
    • Note: You may also want to include another paragraph or section where you write about what you learned in this assignment and any problems or issues you had in completing it.
  2. “knit” your final RMD file to html format and save it using an informative file name (e.g., “LastName_CRM495_RR-Project-Phase3_YEAR_MO_DY”) within a file structure you create for this assignment (e.g., “LastName_CRM495_RR-Phase3”).
    • Note: See “R Assignment #3” for details on creating a reproducible file structure.
  3. Submit your knitted html file on Canvas.
  4. Place a copy of your root folder your LastName_495_commit folder on OneDrive.
    • Note: The root folder should contain your reproducible file structure for this assignment. This means it should include your image files and anything else necessary to reproduce your knitted html document with “one click.”