Skip to content

Commit

Permalink
merge vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
bquast committed Apr 2, 2015
1 parent d2d1bdd commit 8724a77
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 161 deletions.
4 changes: 4 additions & 0 deletions vignettes/estimation.R → vignettes/RDDtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ data(Lee2008)
## ------------------------------------------------------------------------
Lee2008_rdd <- RDDdata(y=Lee2008$y, x=Lee2008$x, cutpoint=0)

## ----dataPlot------------------------------------------------------------
summary(Lee2008_rdd)
plot(Lee2008_rdd)

## ----reg_para------------------------------------------------------------
reg_para <- RDDreg_lm(RDDobject=Lee2008_rdd, order=4)
reg_para
Expand Down
21 changes: 17 additions & 4 deletions vignettes/estimation.Rmd → vignettes/RDDtools.Rmd
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
---
title: "Estimation"
title: "RDDtools"
author: "Matthieu Stigler"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Estimation}
%\VignetteIndexEntry{Data entry}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---


```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(collapse = T, comment = "#>")
```

**RDDtools** works in an object-oriented way: the user has to define once the characteristic of the data, creating a *RDDdata* object, on which different anaylsis tools can be applied.

# Data Preparation and Visualisation
Load the package, and load the built-in dataset from [Lee 2008]:

```{r}
Expand All @@ -26,7 +30,16 @@ Declare the data to be a *RDDdata* object:
Lee2008_rdd <- RDDdata(y=Lee2008$y, x=Lee2008$x, cutpoint=0)
```

# Parametric

You can now directly summarise and visualise this data:

```{r dataPlot}
summary(Lee2008_rdd)
plot(Lee2008_rdd)
```


# Parametric Estimation

Estimate parametrically, by fitting a 4th order polynomial.

Expand All @@ -38,7 +51,7 @@ plot(reg_para)
```


# Non-parametric
# Non-parametric Estimation

Run a simple local regression, using the [Imbens and Kalyanaraman 2012] bandwidth.

Expand Down
34 changes: 25 additions & 9 deletions vignettes/estimation.html → vignettes/RDDtools.html

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions vignettes/data_entry.R

This file was deleted.

38 changes: 0 additions & 38 deletions vignettes/data_entry.Rmd

This file was deleted.

Loading

0 comments on commit 8724a77

Please sign in to comment.