Skip to content

Commit 022d509

Browse files
authored
v0.2.14
2 parents 288a372 + de16a7b commit 022d509

File tree

12 files changed

+509
-427
lines changed

12 files changed

+509
-427
lines changed

DESCRIPTION

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Package: dgo
22
Title: Dynamic Estimation of Group-Level Opinion
3-
Version: 0.2.13
4-
Date: 2017-12-01
5-
Description: Fit dynamic group-level IRT and MRP models from individual or
6-
aggregated item response data. This package handles common preprocessing
7-
tasks and extends functions for inspecting results, poststratification, and
8-
quick iteration over alternative models.
3+
Version: 0.2.14
4+
Date: 2017-12-20
5+
Description: Fit dynamic group-level item response theory (IRT) and multilevel
6+
regression and poststratification (MRP) models from item response data. dgo
7+
models latent traits at the level of demographic and geographic groups,
8+
rather than individuals, in a Bayesian group-level IRT approach developed by
9+
Caughey and Warshaw (2015) <doi:10.1093/pan/mpu021>. The package also
10+
estimates subpopulations' average responses to single survey items with a
11+
dynamic MRP model proposed by Park, Gelman, and Bafumi (2004)
12+
<doi:10.11126/stanford/9780804753005.003.0011>.
913
Maintainer: James Dunham <james@jdunham.io>
1014
Authors@R: c(
1115
person("James", "Dunham", email = "james@jdunham.io", role = c("aut", "cre")),

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
66
R_ARGS := --no-site-file --no-environ --no-save \
77
--no-restore --no-resave-data --no-manual --quiet
88
ifneq (, $(findstring r-devel,$(CURRENT_DIR)))
9-
R := R_devel.sh
9+
R := Rdevel.sh
1010
else
1111
R := R
1212
endif

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## dgo 0.2.14
2+
3+
* Avoid an error during testing, on R built `--without-long-double`.
4+
15
## dgo 0.2.13
26

37
* Fix an issue introduced in v0.2.12 that led to an unexpected error in

README.md

Lines changed: 40 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,41 @@
11
dgo: Dynamic Estimation of Group-Level Opinion
22
================
33

4-
[![Build
5-
Status](https://travis-ci.org/jamesdunham/dgo.svg?branch=master)](https://travis-ci.org/jamesdunham/dgo)
6-
[![Build
7-
status](https://ci.appveyor.com/api/projects/status/1ta36kmoqen98k87?svg=true)](https://ci.appveyor.com/project/jamesdunham/dgo)
8-
[![codecov](https://codecov.io/gh/jamesdunham/dgo/branch/master/graph/badge.svg)](https://codecov.io/gh/jamesdunham/dgo)
9-
10-
# Introduction
11-
12-
dgo is an R package for the dynamic estimation of group-level public
13-
opinion. You can use the package to estimate latent trait means in
14-
subpopulations from survey data. For example, dgo can estimate the
15-
average policy liberalism in each American state over time among
16-
Democrats, Independents, and Republicans, given their answers to survey
17-
questions about policy proposals.
18-
19-
dgo accomplishes this using a Bayesian group-level IRT approach
20-
developed by [Caughey and Warshaw
21-
2015](http://pan.oxfordjournals.org/content/early/2015/02/04/pan.mpu021.full.pdf+html).
22-
It models latent traits at the level of demographic and geographic
23-
groups rather than individuals. It uses a hierarchical model to borrow
24-
strength cross-sectionally and dynamic linear models to do so across
25-
time.
26-
27-
The package can also be used to estimate smoothed estimates of
28-
subpopulations’ average responses to single survey items, using a
29-
dynamic multi-level regression and poststratification (MRP) model
30-
([Park, Gelman, and Bafumi
31-
2004](http://stat.columbia.edu/~gelman/research/published/StateOpinionsNationalPolls.050712.dkp.pdf)).
32-
For instance, you can use dgo to estimate public opinion in each state
33-
on same-sex marriage or the Affordable Care Act.
34-
35-
This model opens up new areas of research on historical public opinion
36-
in the United States at the subnational level. It also allows scholars
37-
of comparative politics to estimate dynamic cross-national models of
38-
public opinion.
39-
40-
# Installation
41-
42-
dgo can be installed from
43-
[CRAN](https://CRAN.R-project.org/package=dgo):
4+
[![Build Status](https://travis-ci.org/jamesdunham/dgo.svg?branch=master)](https://travis-ci.org/jamesdunham/dgo) [![Build status](https://ci.appveyor.com/api/projects/status/1ta36kmoqen98k87?svg=true)](https://ci.appveyor.com/project/jamesdunham/dgo) [![codecov](https://codecov.io/gh/jamesdunham/dgo/branch/master/graph/badge.svg)](https://codecov.io/gh/jamesdunham/dgo)
5+
6+
Introduction
7+
============
8+
9+
dgo is an R package for the dynamic estimation of group-level public opinion. You can use the package to estimate latent trait means in subpopulations from survey data. For example, dgo can estimate the average policy liberalism in each American state over time among Democrats, Independents, and Republicans, given their answers to survey questions about policy proposals.
10+
11+
dgo accomplishes this using a Bayesian group-level IRT approach developed by [Caughey and Warshaw 2015](http://pan.oxfordjournals.org/content/early/2015/02/04/pan.mpu021.full.pdf+html). It models latent traits at the level of demographic and geographic groups rather than individuals. It uses a hierarchical model to borrow strength cross-sectionally and dynamic linear models to do so across time.
12+
13+
The package can also be used to estimate smoothed estimates of subpopulations' average responses to single survey items, using a dynamic multi-level regression and poststratification (MRP) model ([Park, Gelman, and Bafumi 2004](http://stat.columbia.edu/~gelman/research/published/StateOpinionsNationalPolls.050712.dkp.pdf)). For instance, you can use dgo to estimate public opinion in each state on same-sex marriage or the Affordable Care Act.
14+
15+
This model opens up new areas of research on historical public opinion in the United States at the subnational level. It also allows scholars of comparative politics to estimate dynamic cross-national models of public opinion.
16+
17+
Installation
18+
============
19+
20+
dgo can be installed from [CRAN](https://CRAN.R-project.org/package=dgo):
4421

4522
``` r
4623
install.packages("dgo")
4724
```
4825

49-
Or get the latest version from
50-
[GitHub](https://github.com/jamesdunham/dgo) using
51-
[devtools](https://github.com/hadley/devtools/):
26+
Or get the latest version from [GitHub](https://github.com/jamesdunham/dgo) using [devtools](https://github.com/hadley/devtools/):
5227

5328
``` r
5429
if (!require(devtools, quietly = TRUE)) install.packages("devtools")
5530
devtools::install_github("jamesdunham/dgo")
5631
```
5732

58-
dgo requires a working installation of
59-
[RStan](http://mc-stan.org/interfaces/rstan.html). If you don’t have
60-
already have RStan, follow its “[Getting
61-
Started](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started)
62-
guide.
33+
dgo requires a working installation of [RStan](http://mc-stan.org/interfaces/rstan.html). If you don't have already have RStan, follow its "[Getting Started](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started)" guide.
6334

64-
# Usage
35+
Usage
36+
=====
6537

66-
Load the package and set RStan’s recommended options for a local,
67-
multicore machine with excess RAM:
38+
Load the package and set RStan's recommended options for a local, multicore machine with excess RAM:
6839

6940
``` r
7041
library(dgo)
@@ -75,44 +46,24 @@ options(mc.cores = parallel::detectCores())
7546
The minimal workflow from raw data to estimation is:
7647

7748
1. shape input data using the `shape()` function; and
78-
2. pass the result to the `dgirt()` function to estimate a latent trait
79-
(e.g., conservatism) or `dgmrp()` function to estimate opinion on a
80-
single survey question.
81-
82-
# Troubleshooting
83-
84-
Please [report issues](https://github.com/jamesdunham/dgo/issues) that
85-
you encounter.
86-
87-
- OS X only: RStan creates temporary files during estimation in a
88-
location given by `tempdir()`, typically an arbitrary location in
89-
`/var/folders`. If a model runs for days, these files can be cleaned
90-
up while still needed, which induces an error. A good solution is to
91-
set a safer path for temporary files, using an environment variable
92-
checked at session startup. For help setting environment variables,
93-
see the Stack Overflow question
94-
[here](https://stackoverflow.com/questions/17107206/change-temporary-directory).
95-
Confirm the new path before starting your model run by restarting R
96-
and checking the output from `tempdir()`.
97-
98-
- Models fitted before October 2016 (specifically \<
99-
[\#8e6a2cf](https://github.com/jamesdunham/dgo/commit/8e6a2cfbe00b2cd4a908b3067241e06124d143cd))
100-
using dgirt are not fully compatible with dgo. Their contents can be
101-
extracted without using dgo, however, with the `$` indexing
102-
operator. For example: `as.data.frame(dgirtfit_object$stan.cmb)`.
103-
104-
- Calling `dgirt()` or `dgmrp()` can generate
105-
[warnings](http://mc-stan.org/misc/warnings#compiler-warnings)
106-
during model compilation. These are safe to ignore, or can be
107-
suppressed by following the linked instructions.
108-
109-
# Contributing and citing
110-
111-
dgo is under development and we welcome
112-
[suggestions](https://github.com/jamesdunham/dgo/issues).
49+
2. pass the result to the `dgirt()` function to estimate a latent trait (e.g., conservatism) or `dgmrp()` function to estimate opinion on a single survey question.
50+
51+
Troubleshooting
52+
===============
53+
54+
Please [report issues](https://github.com/jamesdunham/dgo/issues) that you encounter.
55+
56+
- OS X only: RStan creates temporary files during estimation in a location given by `tempdir()`, typically an arbitrary location in `/var/folders`. If a model runs for days, these files can be cleaned up while still needed, which induces an error. A good solution is to set a safer path for temporary files, using an environment variable checked at session startup. For help setting environment variables, see the Stack Overflow question [here](https://stackoverflow.com/questions/17107206/change-temporary-directory). Confirm the new path before starting your model run by restarting R and checking the output from `tempdir()`.
57+
58+
- Models fitted before October 2016 (specifically &lt; [\#8e6a2cf](https://github.com/jamesdunham/dgo/commit/8e6a2cfbe00b2cd4a908b3067241e06124d143cd)) using dgirt are not fully compatible with dgo. Their contents can be extracted without using dgo, however, with the `$` indexing operator. For example: `as.data.frame(dgirtfit_object$stan.cmb)`.
59+
60+
- Calling `dgirt()` or `dgmrp()` can generate [warnings](http://mc-stan.org/misc/warnings#compiler-warnings) during model compilation. These are safe to ignore, or can be suppressed by following the linked instructions.
61+
62+
Contributing and citing
63+
=======================
64+
65+
dgo is under development and we welcome [suggestions](https://github.com/jamesdunham/dgo/issues).
11366

11467
The package citation is:
11568

116-
Dunham, James, Devin Caughey, and Christopher Warshaw. 2017. dgo:
117-
Dynamic Estimation of Group-level Opinion. R package.
118-
<https://jdunham.io/dgo/>.
69+
Dunham, James, Devin Caughey, and Christopher Warshaw. 2017. dgo: Dynamic Estimation of Group-level Opinion. R package. <https://jdunham.io/dgo/>.

cran-comments.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
## Test environments
22

3-
* Ubuntu 14.04.5 LTS (on travis-ci), R 3.4.2 (devel, release) and R 3.3.3
4-
* macOS 10.12.5 and 10.11.6 (on travis-ci), R 3.4.2 (devel, release) and R 3.3.3
5-
* Windows Server 2012 R2 x64 (on appveyor), R 3.4.2 (release) i386 and x64
6-
3+
* Ubuntu 14.04.5 LTS (on travis-ci), R 3.4.2 and R 3.3.3
4+
* macOS 10.12.6 and 10.11.6 (on travis-ci), R 3.4.3 and R 3.3.3
5+
* Windows Server 2012 R2 x64 (on appveyor), R 3.4.3 (release) i386 and x64
6+
* Fedora 27 (local), R 3.4.3 and R-devel 2017-12-20 r73933 with --disable-long-double
77

88
## R CMD check results
99

10-
There were no ERRORs or WARNINGs. There was one NOTE. (Days since last update:
11-
1). This update fixes a bug introduced in the most recent version and undetected
12-
until today.
13-
10+
There were no ERRORs or WARNINGs; there was one NOTE. This submission resolves a
11+
failing noLD check. Confirmed using a local build of R-devel with
12+
--disable-long-double.

0 commit comments

Comments
 (0)