You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 263b758
Browse filesBrowse the repository at this point in the historyBrowse files
Fix the README title, three help-page titles, and the reference index blurbs
README.md was titled 'randomizr: Tools for random assignment and random
sampling': README.Rmd had the right title and had not been re-knit. It now also
says how to install rdss and 'interference', and shows one helper in use.
conjoint_measurement's title called it an assignment handler, copied from
conjoint_assignment; it now says what it does. Typos fixed in tidy_stan
(regresion, the the), foos_etal (from from), and lag_by_group (withing). The
pkgdown section blurbs for Tidiers, Data, and Utilities were copied from
DeclareDesign's site and described none of their contents; tidy_stan moves to
Tidiers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: R/helpers-bayesian-regression.R
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
2
2
3
-
#' Tidy results from a stanreg regresion and exponentiate the estimated coefficient
3
+
#' Tidy results from a stanreg regression, optionally exponentiating the coefficients
4
4
#'
5
5
#' Note no standard errors or other summary statistics are provided
6
6
#'
@@ -9,7 +9,7 @@
9
9
#' @param x A stanreg fit from stan_glm
10
10
#' @param conf.int Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.
11
11
#' @param conf.level The confidence level to use for the confidence interval if conf.int = TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.
12
-
#' @param exponentiate Logical indicating whether or not to exponentiate the the coefficient estimates. Defaults to FALSE. Note that standard errors are not included when \code{exponentiate = TRUE}.
12
+
#' @param exponentiate Logical indicating whether or not to exponentiate the coefficient estimates. Defaults to FALSE. Note that standard errors are not included when \code{exponentiate = TRUE}.
13
13
#' @param ... Other arguments to broom.mixed::tidy
Copy file name to clipboardExpand all lines: R/helpers-conjoint-experiments.R
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,9 @@ conjoint_assignment <-
85
85
data
86
86
}
87
87
88
-
#' Conjoint experiment assignment handler: conducts complete random assignment of all attribute levels
88
+
#' Conjoint experiment measurement handler: records which profile in each task is chosen
89
+
#'
90
+
#' Applies `utility_fn` and, within each subject and task, compares the two profiles and sets `choice` to 1 for the one with the higher utility `U` (the second profile on a tie).
89
91
#'
90
92
#' See https://book.declaredesign.org/experimental-descriptive.html#conjoint-experiments
Copy file name to clipboardExpand all lines: README.Rmd
+39Lines changed: 39 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,42 @@ title: "rdss: Helper functions for Research Design in the Social Sciences book"
9
9
[](https://app.codecov.io/gh/DeclareDesign/rdss)
10
10
11
11
Helper functions for using the book [*Research Design in the Social Sciences: Declaration, Diagnosis, Redesign*](https://book.declaredesign.org/) by Blair, Coppock, and Humphreys 2023 (Princeton University Press).
12
+
13
+
## Installation
14
+
15
+
Install the released version from CRAN:
16
+
17
+
```{r, eval = FALSE}
18
+
install.packages("rdss")
19
+
```
20
+
21
+
or the development version from GitHub:
22
+
23
+
```{r, eval = FALSE}
24
+
remotes::install_github("DeclareDesign/rdss")
25
+
```
26
+
27
+
`estimator_AS_tidy()`, used in the book's section on experiments over networks, also needs the 'interference' package, which is not on CRAN:
28
+
29
+
```{r, eval = FALSE}
30
+
remotes::install_github("szonszein/interference")
31
+
```
32
+
33
+
## Example
34
+
35
+
Each helper fills one step of a declaration in the book, and its help page links to the section that uses it. `lag_by_group()`, for instance, builds the lagged treatment indicator in the difference-in-differences design:
36
+
37
+
```{r, message = FALSE}
38
+
library(rdss)
39
+
library(dplyr)
40
+
41
+
panel <-
42
+
tibble(
43
+
unit = rep(c("a", "b"), each = 3),
44
+
period = rep(1:3, times = 2),
45
+
D = c(0, 1, 1, 0, 0, 1)
46
+
) |>
47
+
mutate(D_lag = lag_by_group(D, groups = unit, n = 1, order_by = period))
0 commit comments