Desktop version

Home arrow Economics

  • Increase font
  • Decrease font


<<   CONTENTS   >>

The R Package Surrogate

Introduction

This chapter explains how the case studies that were considered in the earlier chapters can be analyzed using the R package Surrogate. It is assumed that a recent version of the Surrogate package is installed (at least version 0.1-7.3). The package can be installed by entering the command install. packages("Surrogate") in R. In the current chapter, only a part of the available functions in the Surrogate package are illustrated. A comprehensive listing of all available functions, their arguments, and output components is available in the package manual which can be downloaded at the CRAN (via https://cran.r-project.org/web/packages/Surrogate/Surrogate. pdf).

Loading the package and the datasets

In the analyses below, the surrogate methodology is illustrated based on the ARMD, Schizo and Ovarian datasets (for details, see Chapter 2.1). These datasets are included in the Surrogate package. The following commands can be used to load the Surrogate package and the datasets into memory:

> library(Surrogate) # load the Surrogate library

> data(ARMD) # load the ARMD dataset

> data(Schizo) # load the Schizophrenia dataset

> data (Ovarian) # load the ovarian cancer dataset

# Have a look at the first observations of the ARMD dataset:

> head(ARMD)

# Generated output:

Id Center Treat Diff24 Diff52

  • 1 1 13395 1 0 -10
  • 2 2 13395 -1 -3 1
  • 3 3 13396 1 -6 -17
  • 4 4 13396 -181
  • 5 5 13396 -1 -2 -2
  • 6 6 13396 1 -5 -1
 
<<   CONTENTS   >>

Related topics