Skip to content

Commit 70ecbe2

Browse files
committed
Rename Farrington example to oxford
1 parent 5bc6028 commit 70ecbe2

10 files changed

+62
-18
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Depends:
1717
BH (>= 1.51.0),
1818
RcppEigen (>= 0.3.2),
1919
Matrix
20-
Imports:
20+
Imports:
2121
ff,
2222
ffbase
2323
LinkingTo: Rcpp,

R/ExampleData.R

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#' Self-controlled case series example
2+
#'
3+
#' A dataset containing the MMR vaccination / meningitis in Oxford example from
4+
#' Farrington and Whitaker. There are 10 patients comprising 38 unique exposure intervals.
5+
#'
6+
#' @format A data frame with 38 rows and 6 variables:
7+
#' \describe{
8+
#' \item{indiv}{patient identifier}
9+
#' \item{event}{number of events in interval}
10+
#' \item{interval}{interval length in days}
11+
#' \item{agegr}{age group}
12+
#' \item{exgr}{exposure group}
13+
#' \item{loginterval}{log interval length}
14+
#' ...
15+
#' }
16+
#' @source \url{http://statistics.open.ac.uk/sccs/r.htm}
17+
"oxford"

data-raw/chopdat.R data-raw/oxford.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ constructOxfordDataFrame <- function() {
6565
loginterval = log(interval[interval!=0]))
6666
}
6767

68-
chopdat <- constructOxfordDataFrame()
68+
oxford <- constructOxfordDataFrame()

data/chopdat.rda

-575 Bytes
Binary file not shown.

data/oxford.rda

572 Bytes
Binary file not shown.

inst/tests/test-conditionalPoisson.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ test_that("Check simple SCCS as conditional logistic regression", {
66
source("helper-conditionalPoisson.R")
77
tolerance <- 1E-6
88
gold.clogit <- clogit(event ~ exgr + agegr + strata(indiv) + offset(loginterval),
9-
data = chopdat)
9+
data = oxford)
1010

1111
dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv) + offset(loginterval),
12-
data = chopdat,
12+
data = oxford,
1313
modelType = "clr")
1414
cyclopsFit <- fitCyclopsModel(dataPtr,
1515
prior = createPrior("none"))
@@ -22,10 +22,10 @@ test_that("Check simple SCCS as conditional Poisson regression", {
2222
tolerance <- 1E-3
2323
gold.cp <- gnm(event ~ exgr + agegr + offset(loginterval),
2424
family = poisson, eliminate = indiv,
25-
data = chopdat)
25+
data = oxford)
2626

2727
dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv) + offset(loginterval),
28-
data = chopdat,
28+
data = oxford,
2929
modelType = "cpr")
3030
cyclopsFit <- fitCyclopsModel(dataPtr,
3131
prior = createPrior("none"))
@@ -39,10 +39,10 @@ test_that("Check simple SCCS as SCCS", {
3939
source("helper-conditionalPoisson.R")
4040
tolerance <- 1E-6
4141
gold.clogit <- clogit(event ~ exgr + agegr + strata(indiv) + offset(loginterval),
42-
data = chopdat)
42+
data = oxford)
4343

44-
dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv), time = chopdat$interval,
45-
data = chopdat,
44+
dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv), time = oxford$interval,
45+
data = oxford,
4646
modelType = "sccs")
4747
cyclopsFit <- fitCyclopsModel(dataPtr,
4848
prior = createPrior("none"))

inst/tests/test-multitypePoisson.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ test_that("Check multitype SCCS", {
149149
# source("helper-conditionalPoisson.R")
150150
# tolerance <- 1E-6
151151
# gold.clogit <- clogit(event ~ exgr + agegr + strata(indiv) + offset(loginterval),
152-
# data = chopdat)
152+
# data = oxford)
153153
#
154-
# dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv), time = chopdat$interval,
155-
# data = chopdat,
154+
# dataPtr <- createCyclopsDataFrame(event ~ exgr + agegr + strata(indiv), time = oxford$interval,
155+
# data = oxford,
156156
# modelType = "sccs")
157157
# cyclopsFit <- fitCyclopsModel(dataPtr,
158158
# prior = createPrior("none"))

man-roxygen/cyclopsData.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#' @return
22
#'
3-
#' Returns an \code{\link{environment}} of class inheriting from \code{"ccdData"} that
3+
#' Returns an \code{\link{environment}} of class inheriting from \code{"cyclopsData"} that
44
#' contains at least the following objects:
55
#' \tabular{ll}{
6-
#' \code{ ccdDataPtr} \tab An Rcpp \code{externalptr} to the C++ object that holds the data.
6+
#' \code{ cyclopsDataPtr} \tab An Rcpp \code{externalptr} to the C++ object that holds the data.
77
#' The object contents does not get written to \code{.Rdata}, so
88
#' \code{ccdData} are not reusable across restarts of \code{R}. \cr
9-
#' \code{ ccdInterfacePtr} \tab An Rcpp \code{externalptr} to the C++ object that fits the data.
9+
#' \code{ cyclopsInterfacePtr} \tab An Rcpp \code{externalptr} to the C++ object that fits the data.
1010
#' Again, this is not reusable across \code{R} invokations. \cr
1111
#' \code{ timeLoad} \tab Amount of time (in seconds) taken to load the data. \cr
1212
#' }

man/oxford.Rd

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
% Generated by roxygen2 (4.0.1): do not edit by hand
2+
\docType{data}
3+
\name{oxford}
4+
\alias{oxford}
5+
\title{Self-controlled case series example}
6+
\format{A data frame with 38 rows and 6 variables:
7+
\describe{
8+
\item{indiv}{patient identifier}
9+
\item{event}{number of events in interval}
10+
\item{interval}{interval length in days}
11+
\item{agegr}{age group}
12+
\item{exgr}{exposure group}
13+
\item{loginterval}{log interval length}
14+
...
15+
}}
16+
\source{
17+
\url{http://statistics.open.ac.uk/sccs/r.htm}
18+
}
19+
\usage{
20+
oxford
21+
}
22+
\description{
23+
A dataset containing the MMR vaccination / meningitis in Oxford example from
24+
Farrington and Whitaker. There are 10 patients comprising 38 unique exposure intervals.
25+
}
26+
\keyword{datasets}
27+

man/readCyclopsData.Rd

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ readCyclopsData(fileName, modelType)
1212
the name is relative to the current working directory, \code{\link{getwd}}.}
1313
}
1414
\value{
15-
Returns an \code{\link{environment}} of class inheriting from \code{"ccdData"} that
15+
Returns an \code{\link{environment}} of class inheriting from \code{"cyclopsData"} that
1616
contains at least the following objects:
1717
\tabular{ll}{
18-
\code{ ccdDataPtr} \tab An Rcpp \code{externalptr} to the C++ object that holds the data.
18+
\code{ cyclopsDataPtr} \tab An Rcpp \code{externalptr} to the C++ object that holds the data.
1919
The object contents does not get written to \code{.Rdata}, so
2020
\code{ccdData} are not reusable across restarts of \code{R}. \cr
21-
\code{ ccdInterfacePtr} \tab An Rcpp \code{externalptr} to the C++ object that fits the data.
21+
\code{ cyclopsInterfacePtr} \tab An Rcpp \code{externalptr} to the C++ object that fits the data.
2222
Again, this is not reusable across \code{R} invokations. \cr
2323
\code{ timeLoad} \tab Amount of time (in seconds) taken to load the data. \cr
2424
}

0 commit comments

Comments
 (0)