Skip to content

Commit

Permalink
documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saudiwin committed Nov 22, 2024
1 parent 013629e commit 775aa62
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 16 deletions.
12 changes: 6 additions & 6 deletions R/Estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
#' data as ignorable missing data that will be removed (list-wise deletion) before estimating a
#' model.
#'
#' @section Time-Varying Models
#' @section Time-Varying Models:
#'
#' To run a time-varying model, you need to include the name of a column with dates (or integers) that is passed
#' to the \code{time_id} option.
#'
#' @section Continuous Outcomes
#' @section Continuous Outcomes:
#'
#' If the outcome is unbounded i.e. a continuous or an unbounded
#' discrete variable like Poisson, simply set \code{unbounded} to \code{TRUE}. You can ignore the
Expand All @@ -48,7 +48,7 @@
#' missing values (\code{NA}) will be recoded to a specific value out of the range of the outcome to use
#' for modeling the missingness.
#'
#' @section Hierarchical Covariates
#' @section Hierarchical Covariates:
#'
#' Covariates can be fit on the person-level ideal point parameters as well as
#' item discrimination parameters for either the inflated (missing) or non-inflated (observed)
Expand Down Expand Up @@ -533,7 +533,7 @@ id_make <- function(score_data=NULL,
#' \item Ordered Beta (proportion/percentage) with missing-data inflation
#' }
#'
#' @section Time-Varying Inferece
#' @section Time-Varying Inference:
#'
#' In addition, each of these models can have time-varying ideal point (person) parameters if
#' a column of dates is fed to the \code{\link{id_make}} function. If the option \code{vary_ideal_pts} is
Expand All @@ -546,7 +546,7 @@ id_make <- function(score_data=NULL,
#' Please see the package vignette and associated paper for more detail
#' about these time-varying models.
#'
#' @section Missing Data
#' @section Missing Data:
#'
#' The inflation model used to account for missing data assumes that missingness is a
#' function of the persons' (legislators')
Expand All @@ -566,7 +566,7 @@ id_make <- function(score_data=NULL,
#' Models can be either fit on the person/legislator IDs or on group-level IDs (as specified to the
#' \code{id_make} function). If group-level parameters should be fit, set \code{use_groups} to \code{TRUE}.
#'
#' @section Covariates
#' @section Covariates:
#'
#' Covariates are included in the model if they were specified as options to the
#' \code{\link{id_make}} function. The covariate plots can be accessed with
Expand Down
2 changes: 1 addition & 1 deletion R/Generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ setMethod(id_plot, signature(object='idealstan'),

#' Generic Method for Extracting Posterior Samples
#'
#' This generic will extract the full \code{\link[rstan]{stan}}} posterior samples from \code{idealstan} objects.
#' This generic will extract the full \code{\link[rstan]{stan}} posterior samples from \code{idealstan} objects.
#'
#' See the corresponding method definition for more information about what you can acccess with this generic.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/Helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3752,8 +3752,8 @@ return(as.vector(idx))
return(all_time)
}

#' @noRd
#' Function to add in time-varying covariates to person time-varying ideal points
#' @noRd
.add_person_cov <- function(all_time,
obj,
legis_x,
Expand Down
7 changes: 3 additions & 4 deletions R/idealstan.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
#' See the README on
#' \href{https://github.com/saudiwin/idealstan/blob/master/README.md}{GitHub}
#'
#' @docType package
#' @name idealstan
#' @keywords internal
#' @aliases idealstan-package
#' @import methods
#' @references \enumerate{
#' \item Kubinec, Robert. Generalized Ideal Point Models for Time-Varying and Missing-Data Inference. Working Paper.
#' \item Kubinec, Robert. (2024). Generalized Ideal Point Models for Robust Measurement with Dirty Data in the Social Sciences. SocArchiv Preprint. doi.org:10.31219/osf.io/8j2bt
#' \item Clinton, J., Jackman, S., & Rivers, D. (2004). The Statistical Analysis of Roll Call Data. \emph{The American Political Science Review}, 98(2), 355-370. doi:10.1017/S0003055404001194
#' \item Bafumi, J., Gelman, A., Park, D., & Kaplan, N. (2005). Practical Issues in Implementing and Understanding Bayesian Ideal Point Estimation. \emph{Political Analysis}, 13(2), 171-187. doi:10.1093/pan/mpi010
#' }
NULL
"_PACKAGE"

## quiets concerns of R CMD check with dplyr and NSE
## temporary fix, will use standard evaluation in future versions
Expand Down
4 changes: 2 additions & 2 deletions R/rstan_generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ setMethod('id_post_pred',signature(object='idealstan'),function(object,draws=100
#'
#' This function is a wrapper around \code{\link[bayesplot]{ppc_bars}},
#' \code{\link[bayesplot]{ppc_dens_overlay}} and
#' \code{\link[bayesplot]{ppc_violin_grouped} that plots the posterior predictive distribution
#' \code{\link[bayesplot]{ppc_violin_grouped}} that plots the posterior predictive distribution
#' derived from \code{\link{id_post_pred}} against the original data. You can also subset the
#' posterior predictions over
#' legislators/persons or
Expand All @@ -592,7 +592,7 @@ setGeneric('id_plot_ppc',signature='object',
#'
#' This function is a wrapper around \code{\link[bayesplot]{ppc_bars}},
#' \code{\link[bayesplot]{ppc_dens_overlay}} and
#' \code{\link[bayesplot]{ppc_violin_grouped} that plots the posterior predictive distribution
#' \code{\link[bayesplot]{ppc_violin_grouped}} that plots the posterior predictive distribution
#' derived from \code{\link{id_post_pred}} against the original data.
#' Because \code{idealstan} allows for different distributions for each item,
#' this function can either produce one predictive distribution for all items
Expand Down
45 changes: 45 additions & 0 deletions man/id_estimate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/id_extract.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions man/id_make.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/id_plot_ppc-idealstan-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/id_plot_ppc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/idealstan.Rd → man/idealstan-package.Rd
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 775aa62

Please sign in to comment.