From 7cf7803b3d236cf53ec62eec5a2cf7d14f87dc47 Mon Sep 17 00:00:00 2001 From: LukaszChrostowski Date: Wed, 3 Apr 2024 15:57:21 +0100 Subject: [PATCH] Correction for CRAN resubmission --- DESCRIPTION | 4 ++-- R/cloglogModel.R | 2 ++ R/simple_methods.R | 1 + R/summary.R | 24 ++++++++++++++++++++++++ man/cloglog_model_nonprobsvy.Rd | 3 +++ man/pop.size.Rd | 3 +++ man/summary.nonprobsvy.Rd | 25 +++++++++++++++++++++++++ src/Makevars | 4 ++-- 8 files changed, 62 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4718a51..34b80db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: nonprobsvy Type: Package -Title: Package for Inference Based on Non-Probability Samples +Title: Inference Based on Non-Probability Samples Version: 0.1.0 Authors@R: c(person(given = "Ɓukasz", @@ -16,7 +16,7 @@ Authors@R: family = "Chlebicki", role = "ctb", email = "piochl@st.amu.edu.pl")) -Description: An R package for statistical inference with non-probability samples when auxiliary information from external sources such as probability samples or population totals or means is available. Details can be found in: Wu et al. (2020) , Kim et al. (2021) , Wu et al. (2023) , Kim et al. (2021) , Kim et al. (2020) . +Description: Statistical inference with non-probability samples when auxiliary information from external sources such as probability samples or population totals or means is available. Details can be found in: Wu et al. (2020) , Kim et al. (2021) , Wu et al. (2023) , Kim et al. (2021) , Kim et al. (2020) . License: MIT + file LICENSE Encoding: UTF-8 LazyData: true diff --git a/R/cloglogModel.R b/R/cloglogModel.R index 410163d..a7ee3f1 100644 --- a/R/cloglogModel.R +++ b/R/cloglogModel.R @@ -4,6 +4,8 @@ #' @description \code{cloglog_model_nonprobsvy} returns all the methods/objects/functions required to estimate the model, assuming a cloglog link function. #' @param ... Additional, optional arguments. #' +#' @return List with selected methods/objects/functions. +#' #' @seealso #' #' [nonprob()] -- for fitting procedure with non-probability samples. diff --git a/R/simple_methods.R b/R/simple_methods.R index 18af7cd..983fb1d 100644 --- a/R/simple_methods.R +++ b/R/simple_methods.R @@ -17,6 +17,7 @@ pop.size.nonprobsvy <- function(object, #' @description Estimate size of population #' @param object object returned by `nonprobsvy`. #' @param ... additional parameters +#' @return Vector returning the value of the estimated population size. #' @export pop.size <- function(object, ...) { UseMethod("pop.size") diff --git a/R/summary.R b/R/summary.R index e5f6753..e14886a 100644 --- a/R/summary.R +++ b/R/summary.R @@ -10,6 +10,30 @@ #' @param cov Covariance matrix corresponding to regression parameters #' @param ... Additional optional arguments #' +#' @return An object of \code{summary_nonprobsvy} class containing: +#' \itemize{ +#' \item \code{call} -- A call which created \code{object}. +#' \item \code{pop_total} -- A list containing information about the estimated population mean, its standard error and confidence interval. +#' \item \code{sample_size} -- The size of the samples used in the model. +#' \item \code{population_size} -- The estimated size of the population from which the nonoprobability sample was drawn. +#' \item \code{test} -- Type of statistical test performed. +#' \item \code{control} -- A List of control parameters used in fitting the model. +#' \item \code{model} -- A descriptive name of the model used, e.g., "Doubly-Robust", "Inverse probability weighted", or "Mass Imputation". +#' \item \code{aic} -- Akaike's information criterion. +#' \item \code{bic} -- Bayesian (Schwarz's) information criterion. +#' \item \code{residuals} -- Residuals from the model, providing information on the difference between observed and predicted values. +#' \item \code{likelihood} -- Logarithm of likelihood function evaluated at coefficients. +#' \item \code{df_residual} -- Residual degrees of freedom. +#' \item \code{weights} -- Distribution of estimated weights obtained from the model. +#' \item \code{coef} -- Regression coefficients estimated by the model. +#' \item \code{std_err} -- Standard errors of the regression coefficients. +#' \item \code{w_val} -- Wald statistic values for the significance testing of coefficients. +#' \item \code{p_values} -- P-values corresponding to the Wald statistic values, assessing the significance of coefficients. +#' \item \code{crr} -- The correlation matrix of the model coefficients, if requested. +#' \item \code{confidence_interval_coef} -- Confidence intervals for the model coefficients. +#' \item \code{names} -- Names of the fitted models. +#' } +#' #' #' @method summary nonprobsvy #' @importFrom stats pt diff --git a/man/cloglog_model_nonprobsvy.Rd b/man/cloglog_model_nonprobsvy.Rd index 6a851fb..6bf4585 100644 --- a/man/cloglog_model_nonprobsvy.Rd +++ b/man/cloglog_model_nonprobsvy.Rd @@ -9,6 +9,9 @@ cloglog_model_nonprobsvy(...) \arguments{ \item{...}{Additional, optional arguments.} } +\value{ +List with selected methods/objects/functions. +} \description{ \code{cloglog_model_nonprobsvy} returns all the methods/objects/functions required to estimate the model, assuming a cloglog link function. } diff --git a/man/pop.size.Rd b/man/pop.size.Rd index e0ab2ba..ad80f5f 100644 --- a/man/pop.size.Rd +++ b/man/pop.size.Rd @@ -11,6 +11,9 @@ pop.size(object, ...) \item{...}{additional parameters} } +\value{ +Vector returning the value of the estimated population size. +} \description{ Estimate size of population } diff --git a/man/summary.nonprobsvy.Rd b/man/summary.nonprobsvy.Rd index bbc672f..c138af7 100644 --- a/man/summary.nonprobsvy.Rd +++ b/man/summary.nonprobsvy.Rd @@ -21,6 +21,31 @@ be computed from covariance matrix by default \code{FALSE}.} \item{...}{Additional optional arguments} } +\value{ +An object of \code{summary_nonprobsvy} class containing: +\itemize{ +\item \code{call} -- A call which created \code{object}. +\item \code{pop_total} -- A list containing information about the estimated population mean, its standard error and confidence interval. +\item \code{sample_size} -- The size of the samples used in the model. +\item \code{population_size} -- The estimated size of the population from which the nonoprobability sample was drawn. +\item \code{test} -- Type of statistical test performed. +\item \code{control} -- A List of control parameters used in fitting the model. +\item \code{model} -- A descriptive name of the model used, e.g., "Doubly-Robust", "Inverse probability weighted", or "Mass Imputation". +\item \code{aic} -- Akaike's information criterion. +\item \code{bic} -- Bayesian (Schwarz's) information criterion. +\item \code{residuals} -- Residuals from the model, providing information on the difference between observed and predicted values. +\item \code{likelihood} -- Logarithm of likelihood function evaluated at coefficients. +\item \code{df_residual} -- Residual degrees of freedom. +\item \code{weights} -- Distribution of estimated weights obtained from the model. +\item \code{coef} -- Regression coefficients estimated by the model. +\item \code{std_err} -- Standard errors of the regression coefficients. +\item \code{w_val} -- Wald statistic values for the significance testing of coefficients. +\item \code{p_values} -- P-values corresponding to the Wald statistic values, assessing the significance of coefficients. +\item \code{crr} -- The correlation matrix of the model coefficients, if requested. +\item \code{confidence_interval_coef} -- Confidence intervals for the model coefficients. +\item \code{names} -- Names of the fitted models. +} +} \description{ Summary statistics for model of nonprobsvy class. } diff --git a/src/Makevars b/src/Makevars index b6de604..f09302a 100644 --- a/src/Makevars +++ b/src/Makevars @@ -15,5 +15,5 @@ ## set the appropriate value, possibly CXX17. # CXX_STD = CXX11 -# PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -# PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) +PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) +PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)