Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nonprobsvy
Type: Package
Title: Inference Based on Non-Probability Samples
Version: 0.2.2
Version: 0.2.3
Authors@R:
c(person(given = "Łukasz",
family = "Chrostowski",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ nonprobsvy News and Updates

# nonprobsvy (development version)

# nonprobsvy 0.2.3

+ changes to the documentation to meet the JSS requirements
+ documentation polishing

------------------------------------------------------------------------

# nonprobsvy 0.2.2
Expand Down
2 changes: 1 addition & 1 deletion R/check_balance.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Checks the variable balance between the probability and non-probability samples
#' @title Checks Variable Balance Between the Probability and Non-Probability Samples
#'
#' @description
#' Function compares totals for auxiliary variables specified in the `x` argument for an `object` that
Expand Down
2 changes: 1 addition & 1 deletion R/control_inference.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Control parameters for inference
#' @title Control Parameters for Inference
#'
#' @description \code{control_inf} constructs a `list` with all necessary control parameters
#' for statistical inference.
Expand Down
2 changes: 1 addition & 1 deletion R/control_outcome.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Control parameters for outcome model
#' @title Control Parameters for Outcome Model
#'
#' @importFrom stats loess.control
#' @description \code{control_out} constructs a list with all necessary control parameters
Expand Down
2 changes: 1 addition & 1 deletion R/control_selection.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Control parameters for the selection model
#' @title Control Parameters for the Selection Model
#'
#' @description \code{control_sel} constructs a list with all necessary control parameters
#' for selection model.
Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Job vacancy survey
#' @title Job Vacancy Survey
#'
#' @description
#' This is a subset of the Job Vacancy Survey from Poland (for one quarter).
Expand Down Expand Up @@ -29,7 +29,7 @@
#'
"jvs"

#' Admin data (non-probability survey)
#' @title Admin Data (Non-Probability Survey)
#'
#' @description
#' This is a subset of the Central Job Offers Database, a voluntary administrative data set (non-probability sample).
Expand Down
2 changes: 1 addition & 1 deletion R/method_glm.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Mass imputation using the generalized linear model method
#' @title Mass Imputation Using the Generalized Linear Model Method
#'
#' @importFrom stats glm.fit
#' @importFrom stats update
Expand Down
2 changes: 1 addition & 1 deletion R/method_nn.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Mass imputation using nearest neighbours matching method
#' @title Mass Imputation Using Nearest Neighbours Matching Method
#'
#' @importFrom stats update
#' @importFrom survey svymean
Expand Down
2 changes: 1 addition & 1 deletion R/method_npar.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Mass imputation using non-parametric model method
#' @title Mass Imputation Using Non-Parametric Model Method
#'
#' @importFrom stats update
#' @importFrom survey svymean
Expand Down
3 changes: 1 addition & 2 deletions R/method_pmm.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' Mass imputation using predictive mean matching method
#'
#' @title Mass Imputation Using Predictive Mean Matching Method
#'
#' @description
#' Model for the outcome for the mass imputation estimator. The implementation is currently based on [RANN::nn2] function and thus it uses Euclidean distance for matching units from \eqn{S_A} (non-probability) to \eqn{S_B} (probability) based on predicted values from model \eqn{\boldsymbol{x}_i} based
Expand Down
14 changes: 7 additions & 7 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extract.nonprob <- function(object, what=c("all", "mean", "se")) {

return(ext)
}
#' @title Extracts estimates from the nonprob class object
#' @title Extracts Estimates from the Nonprob Class Object
#' @description Returns a \code{data.frame} of estimated mean(s) or standard error(s)
#' @param object object of of the \code{nonprob} class
#' @param what what to extract: all estimates (mean(s), SE(s) and CI(s); \code{"all"}; default), estimated mean(s) (\code{"mean"}) or their standard error(s) (\code{"se"})
Expand Down Expand Up @@ -50,7 +50,7 @@ pop_size.nonprob <- function(object) {
object$pop_size
}

#' @title Returns population size (estimated or fixed)
#' @title Returns Population Size (Estimated or Fixed)
#' @description Returns population size that is assumed to be
#'\itemize{
#' \item{\code{fixed} -- if it is based on the `pop_size` argument,}
Expand Down Expand Up @@ -94,7 +94,7 @@ pop_size <- function(object) {

# base R methods ----------------------------------------------------------

#' @title Returns the number of rows in samples
#' @title Returns the Number of Rows in Samples
#' @description
#' Returns information on the number of rows of the probability sample (if provided)
#' and non-probability sample.
Expand All @@ -110,7 +110,7 @@ nobs.nonprob <- function(object,
c("prob" = object$prob_size, "nonprob" = object$nonprob_size)
}

#' @title Extracts the inverse probability weights
#' @title Extracts the Inverse Probability (Propensity Score) Weights
#' @description A generic function `weights` that returns inverse probability weights (if present)
#'
#' @param object a \code{nonprob} class object
Expand Down Expand Up @@ -142,7 +142,7 @@ weights.nonprob <- function(object,
object$ipw_weights
}

#' @title The update method for the nonprob object with changed arguments or parameters
#' @title Update Method for the Nonprob Object with Changed Arguments or Parameters
#' @author Maciej Beręsewicz
#'
#' @description
Expand Down Expand Up @@ -202,7 +202,7 @@ update.nonprob <- function(object, ..., evaluate=TRUE) {
}
}

#' @title Returns confidence intervals for estimated mean
#' @title Returns Confidence Intervals for Estimated Mean
#'
#' @description A generic function that returns the confidence interval
#' for the estimated mean. If standard errors have not been estimated, the function
Expand Down Expand Up @@ -277,7 +277,7 @@ confint.nonprob <- function(object,
}


#' @title Returns coefficients of the underlying models
#' @title Returns Coefficients of the Underlying Models
#' @description
#' Returns a \code{list} of coefficients for the selection and the outcome models
#'
Expand Down
6 changes: 3 additions & 3 deletions R/nonprob_documentation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Inference with non-probability survey samples
#' @title Inference with Non-Probability Survey Samples
#' @author Łukasz Chrostowski, Maciej Beręsewicz, Piotr Chlebicki
#'
#' @description \code{nonprob} function provides an access to the various methods for inference based on non-probability surveys (including big data). The function allows to estimate the population mean based on the access to a reference probability sample (via the `survey` package), as well as totals or means of covariates.
Expand Down Expand Up @@ -36,8 +36,8 @@
#' @param start_selection an optional `vector` with starting values for the parameters of the selection equation
#' @param start_outcome an optional `vector` with starting values for the parameters of the outcome equation
#' @param verbose a numerical value (default `TRUE`) whether detailed information on the fitting should be presented
#' @param se Logical value (default `TRUE`) indicating whether to calculate and return standard error of estimated mean.
#' @param ... Additional, optional arguments
#' @param se Logical value (default `TRUE`) indicating whether to calculate and return standard error of estimated mean
#' @param ... Additional, optional arguments (not yet supported)
#'
#' @details Let \eqn{y} be the response variable for which we want to estimate the population mean,
#' given by \deqn{\mu_{y} = \frac{1}{N} \sum_{i=1}^N y_{i}.} For this purpose we consider data integration
Expand Down
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Plots the estimated mean(s) and their confidence interval(s)
#' @title Plots the Estimated Mean(s) and Their Confidence Interval(s)
#' @description
#' Simple plotting method that compares the estimated mean(s) and CI(s) with the naive (uncorrected) estimates.
#'
Expand Down
9 changes: 1 addition & 8 deletions R/prints.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# no print doccumentation


# general printing --------------------------------------------------------

#' @method print nonprob
Expand All @@ -13,8 +10,6 @@ print.nonprob <- function(x, digits=4,...) {
"ipw" = "inverse probability weighting",
"dr" = "doubly robust")))

## here we should have more information when the doubly robust estimator is applied

cat(sprintf(" - method: %s\n", x$estimator_method))
cat(sprintf(" - auxiliary variables source: %s\n", ifelse(!is.null(x$svydesign), "survey", "population")))
cat(sprintf(" - vars selection: %s\n", tolower(x$control$control_inference$vars_selection)))
Expand Down Expand Up @@ -66,11 +61,9 @@ print.nonprob <- function(x, digits=4,...) {
cat(" - caution: since `pop_size' is provided, the variance is estimated assuming that `pop_size' is known (not estimated). If this assumption is wrong, specify the appropriate `var_method' in the `control_inf()` function.\n")
}

#cat("Estimated population mean with overall std.err and confidence interval:\n\n")
#print(cbind(mean = x$output$mean, SE = x$output$SE, x$confidence_interval))
invisible(x)
}
#' @title Print method for the nonprob_summary object
#' @title Print Method for the Nonprob_summary Object
#'
#' @description
#' Print method for the `nonprob_summary` object which allows for specification
Expand Down
2 changes: 1 addition & 1 deletion R/summary.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title Summary statistics for model of the nonprob class
#' @title Summary Statistics for Models of the Nonprob Class
#'
#' @description
#' Summarises the `nonprob` class object. The summary depends on the type of
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ svydesign
’Dplyr’
Chrostowski
chrostowski
JSS
2 changes: 1 addition & 1 deletion man/admin.Rd

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

2 changes: 1 addition & 1 deletion man/check_balance.Rd

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

2 changes: 1 addition & 1 deletion man/coef.nonprob.Rd

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

2 changes: 1 addition & 1 deletion man/confint.nonprob.Rd

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

2 changes: 1 addition & 1 deletion man/control_inf.Rd

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

2 changes: 1 addition & 1 deletion man/control_out.Rd

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

2 changes: 1 addition & 1 deletion man/control_sel.Rd

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

2 changes: 1 addition & 1 deletion man/extract.Rd

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

2 changes: 1 addition & 1 deletion man/jvs.Rd

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

2 changes: 1 addition & 1 deletion man/method_glm.Rd

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

2 changes: 1 addition & 1 deletion man/method_nn.Rd

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

2 changes: 1 addition & 1 deletion man/method_npar.Rd

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

2 changes: 1 addition & 1 deletion man/method_pmm.Rd

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

2 changes: 1 addition & 1 deletion man/nobs.nonprob.Rd

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

6 changes: 3 additions & 3 deletions man/nonprob.Rd

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

2 changes: 1 addition & 1 deletion man/plot.nonprob.Rd

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

2 changes: 1 addition & 1 deletion man/pop_size.Rd

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

2 changes: 1 addition & 1 deletion man/print.nonprob_summary.Rd

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

2 changes: 1 addition & 1 deletion man/summary.nonprob.Rd

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

Loading
Loading