MyNixOS website logo
Description

Methods for the Office of Evaluation Sciences.

Methods for statistical analysis and reporting preferred by the US Office of Evaluation Sciences (OES). This package prepares data from standard model output objects (such as from \code{lm()} and \code{estimatr::lm_robust()}) and creates visualizations of treatment effects from the prepared quantities, according to the standards of the US Office of Evaluation Sciences.

oesr

Distributing OES Functions

Overview

This package divides the work of plotting treatment and control outcomes into two steps:

  1. use oes_prep() to create a tidy data table of results to be plotted;
  2. use oes_plot() to plot the tidy data object created by oes_prep().

Example Session

The sample session below installs and uses the package functions.

You only need to install the package once (per update).

First, provide the path to the tar.gz:

# Try installing straight from the web:
tar.gz_path <- "https://github.com/gsa-oes/oesr/blob/main/oesr_0.0.1.tar.gz"

# If this fails, download the tar.gz, and provide the path to the tar.gz:
# (This must be specific to where you downloaded/saved the file.)
# (If the .gz extension is removed, just use .tar.)

tar.gz_path <- "~/Desktop/oesr_0.0.1.tar.gz"

Then, install the package:

install.packages(tar.gz_path, repos = NULL, type = "source")

Then, load and attach the package (and, for now, needed tidyverse):

library(oesr)
library(tidyverse)

Then, use it to plot a simulated treatment effect:

# Simulate some data yourself:
df <- tibble(tr = rbinom(100, 1, 0.4), y = rnorm(100) + tr)
lm_out <- lm(y ~ tr, data = df)

# Plot with OES style, specifying treatment `vars`:
lm_out %>% 
  oes_prep() %>%
  oes_plot(treatment_vars = "tr")

# Use data included in the package:
data("df_oes")
fit <- lm(y1 ~ x1, df_oes)

# Plot with OES style, specifying treatment `arms`:
fit %>% 
  oes_prep() %>%
  oes_plot(treatment_arms = 1)

# View the help file in R:
help(oes_plot)

FAQ

  1. How do I deal with this grid.Call() Lato font error?

If you get an error like

1: In grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  no font could be found for family "Lato"

then install the Lato font.

  1. How do I install the Lato font?

To get the Lato font, download it from https://fontmeme.com/fonts/lato-font/.

Then, on macOS,

  • open Pages, and in the menus go to Format - Font - Show Fonts.
  • Then open Manage Fonts in the three-dot menu at the upper left of the Fonts window.
  • Then click the + sign to add a font, and point the selection dialogue to the "lato" folder you downloaded.
  1. How do I deal with this grid.Call() polygon error?

If you get an error that says grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, polygon edge not found, try reinstalling X11 from https://www.xquartz.org/, then reinstalling the ggplot2 package.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows