head	1.8;
access;
symbols
	pkgsrc-2026Q3:1.8.0.2
	pkgsrc-2026Q3-base:1.8
	pkgsrc-2026Q2:1.6.0.2
	pkgsrc-2026Q2-base:1.6
	pkgsrc-2026Q1:1.5.0.12
	pkgsrc-2026Q1-base:1.5
	pkgsrc-2025Q4:1.5.0.10
	pkgsrc-2025Q4-base:1.5
	pkgsrc-2025Q3:1.5.0.8
	pkgsrc-2025Q3-base:1.5
	pkgsrc-2025Q2:1.5.0.6
	pkgsrc-2025Q2-base:1.5
	pkgsrc-2025Q1:1.5.0.4
	pkgsrc-2025Q1-base:1.5
	pkgsrc-2024Q4:1.5.0.2
	pkgsrc-2024Q4-base:1.5
	pkgsrc-2024Q3:1.4.0.12
	pkgsrc-2024Q3-base:1.4
	pkgsrc-2024Q2:1.4.0.10
	pkgsrc-2024Q2-base:1.4
	pkgsrc-2024Q1:1.4.0.8
	pkgsrc-2024Q1-base:1.4
	pkgsrc-2023Q4:1.4.0.6
	pkgsrc-2023Q4-base:1.4
	pkgsrc-2023Q3:1.4.0.4
	pkgsrc-2023Q3-base:1.4
	pkgsrc-2023Q2:1.4.0.2
	pkgsrc-2023Q2-base:1.4
	pkgsrc-2023Q1:1.3.0.14
	pkgsrc-2023Q1-base:1.3
	pkgsrc-2022Q4:1.3.0.12
	pkgsrc-2022Q4-base:1.3
	pkgsrc-2022Q3:1.3.0.10
	pkgsrc-2022Q3-base:1.3
	pkgsrc-2022Q2:1.3.0.8
	pkgsrc-2022Q2-base:1.3
	pkgsrc-2022Q1:1.3.0.6
	pkgsrc-2022Q1-base:1.3
	pkgsrc-2021Q4:1.3.0.4
	pkgsrc-2021Q4-base:1.3
	pkgsrc-2021Q3:1.3.0.2
	pkgsrc-2021Q3-base:1.3
	pkgsrc-2021Q2:1.2.0.16
	pkgsrc-2021Q2-base:1.2
	pkgsrc-2021Q1:1.2.0.14
	pkgsrc-2021Q1-base:1.2
	pkgsrc-2020Q4:1.2.0.12
	pkgsrc-2020Q4-base:1.2
	pkgsrc-2020Q3:1.2.0.10
	pkgsrc-2020Q3-base:1.2
	pkgsrc-2020Q2:1.2.0.8
	pkgsrc-2020Q2-base:1.2
	pkgsrc-2020Q1:1.2.0.4
	pkgsrc-2020Q1-base:1.2
	pkgsrc-2019Q4:1.2.0.6
	pkgsrc-2019Q4-base:1.2
	pkgsrc-2019Q3:1.2.0.2
	pkgsrc-2019Q3-base:1.2;
locks; strict;
comment	@# @;


1.8
date	2026.09.17.06.35.33;	author wiz;	state Exp;
branches;
next	1.7;
commitid	VVWMZxmmItqLoWVG;

1.7
date	2026.07.13.14.09.26;	author mef;	state Exp;
branches;
next	1.6;
commitid	HKb9obKhKOI02vNG;

1.6
date	2026.06.10.22.00.47;	author mef;	state Exp;
branches;
next	1.5;
commitid	bpKpkBNc4w8tHiJG;

1.5
date	2024.11.24.05.23.25;	author mef;	state Exp;
branches;
next	1.4;
commitid	eA9ENZrFp3LjhRyF;

1.4
date	2023.06.02.13.42.34;	author mef;	state Exp;
branches;
next	1.3;
commitid	LQdYWQyfCA9FqnrE;

1.3
date	2021.09.20.00.49.49;	author mef;	state Exp;
branches;
next	1.2;
commitid	ItU15Ni03Jm85D9D;

1.2
date	2019.08.08.19.53.54;	author brook;	state Exp;
branches;
next	1.1;
commitid	K2VPfA0XCw7xfgyB;

1.1
date	2019.07.31.13.30.20;	author brook;	state Exp;
branches;
next	;
commitid	rYYUYABWiqhvqcxB;


desc
@@


1.8
log
@R-survey: remove obsolete clause
@
text
@# $NetBSD: Makefile,v 1.7 2026/07/13 14:09:26 mef Exp $

R_PKGNAME=	survey
R_PKGVER=	4.5

MAINTAINER=	pkgsrc-users@@NetBSD.org
COMMENT=	Analysis of complex survey samples
LICENSE=	gnu-gpl-v2 OR gnu-gpl-v3

DEPENDS+=	R-minqa>=1.2.4:../../math/R-minqa
DEPENDS+=	R-mitools>=2.4:../../math/R-mitools
DEPENDS+=	R-numDeriv-[0-9]*:../../math/R-numDeriv

# Packages suggested but not available:
#   'CompQuadForm', 'AER', 'SUMMER', 'R.rsp'

TEST_DEPENDS+=	R-hexbin-[0-9]*:../../math/R-hexbin
TEST_DEPENDS+=	R-RSQLite-[0-9]*:../../databases/R-RSQLite
TEST_DEPENDS+=	R-quantreg-[0-9]*:../../math/R-quantreg

USE_LANGUAGES=	c++
GCC_REQD+=	8

.include "../../math/R-RcppArmadillo/buildlink3.mk"
.include "../../math/R/Makefile.extension"
.include "../../mk/bsd.pkg.mk"
@


1.7
log
@(math/R-survey) Fix on Darwin and hopefully on Linux
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2026/06/10 22:00:47 mef Exp $
a23 5
.include "../../mk/bsd.prefs.mk"
pre-patch:
.if ${OPSYS} != SunOS && ${OPSYS} != Linux && ${OPSYS} != Darwin
	${CP} ${FILESDIR}/Makevars ${WRKSRC}/src/
.endif
@


1.6
log
@(math/R-survey) Updated 4.4.2 to 4.5

(pkgsrc)
   - There is a file src/Makevars.makefile, but it does not seem to be used
     (changes on that file does not affect anything) so files/Makevars are
     added for PKG_LIBS+= -lexecinfo

(upstream)
4.5	start of first version of multiphase() for arbitrary multiphase sampling
	(experimental, may contain nuts)

	Wilson ('score test') confidence intervals in svyciprop (from Stas Kolenikov)

	svydesign() gives a clearer error message when there are more stages in
	fpc= than in id= (for Stephanie Zimmer)

	svrepdesign(type="ACS") now uses mse=TRUE unless mse=FALSE is explicitly
	given, in which case it warns (for Anthony Damico)

	svystat,svrepstat objects lose their variance attribute and class on
	math operations so the standard errors don't end up misleading. Use
	svycontrast() to get transformed versions with SEs
	(for Pavel Krivitsky)

	The $aic component of svyglm objects, which is undocumented and meaningless,
	is now set to NA. If this breaks your code, your code was already wrong.
	(for Michael Reiss)

	svyby(covmat=TRUE) now works for estimators where subset() doesn't actually
	drop rows

	svydesign(.., weights=1) now works, though it's still not recommended. Attempts
	to recycle a weights vector that isn't of length 1 get an error

	for replicate-weight designs with user-forced degrees of freedom, the
	degrees of freedom shouldn't change under subsetting
	(because that's computationally expensive).  For Joel Barnes, Isabelle Michaud

	clarify that calibrate() can take margins specified in either of the formats
	that rake() accepts

	rake() now handles much larger sets of margins (from Ben Schneider)
	The results may be different if too loose a tolerance was specified or if
	zeroes make the true optimum non-unique.

	confint(withReplicates()) assigns names when there aren't any,
	rather than failing (from Ben Schneider)

	degf<-.svyrep.design() to allow the user to modify the degrees of freedom
	if they specified it by hand

	a bit more detail on svyciprop(type="xlogit") (from Ben Schneider)

	Bell-McCaffrey standard errors (from Stas Kolenikov)

	remove spurious warning in svyvar for replicate-weights with mse=TRUE
	(Ben Schneider)

	change deprecated arma::is_finite to standard::isfinite

	Add option na_weights. If "allow" or "warn", svydesign will drop any
	records with NA weights before setting up the design.
	The default, "fail", will give an error.
	For database-backed designs it is currently only possible to have "fail"
	but this may change in the future (for Stephanie Zimmer and David Wilson)


4.4-3	options(survey.lonely.psu="adjust") needed strata to be a factor or numeric
	(for Richard Li, Durga Nagori)

	Initial version of multiframe() for dual-frame sampling and
	reweight() for optimising frame weights. Methods for svytotal,
	svymean, svyglm, svyvar, svychisq, update, subset

	Initial version of withCrossval() for cross-validation

	withPV with action=fun and rewrite=TRUE wasn't working

	add "pps_spec" virtual class for all the PPS sparse matrix things

	support calibration to the influence functions of a phase-1 model in calibrate.twophase and
	calibrate.twophase2 (currently only with simple random sampling at phase 1)

	added svychisq.twophase2 (for Yilin Zhang)

	twophase2 objects now print the call that created them better

	?svystat and ?svrepstat now point to ?surveysummary, which describes the structure
	(for Terry Therneau)

	predict.svyglm will impute zero for NA coefficients (Terry Therneau).

	With se.fit=FALSE, predict.svyglm returns a numeric vector rather than a
	svystat object
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2024/11/24 05:23:25 mef Exp $
d26 1
a26 1
.if ${OPSYS} != SunOS && ${OPSYS} != Linux
@


1.5
log
@(math/R-survey) Updated 4.2.0 to 4.4.2

4.4-2	Invalid read in C++ code, found by Brian Ripley, fixed by Ben Schneider

	Updated small-area vignette (Peter Gao)

4.4-1   CRAN

4.4	Fixes to calibration for PPS sampling

	A PPS variance matrix can now be specified as phase two of a two-phase design.
	This includes poisson_sampling() as a model for non-response (for Pam Shaw, Jasper Yang)

	svysmoothUnit() and svysmoothArea() as an interface to the SUMMER package for small-area
	estimation (Peter Gao, Jon Wakefield, Richard Li)

4.3	Added Ben Schneider's C++ code for multistage variances. It is currently controlled
	by options(survey.use_rcpp), which defaults to TRUE

	error in scaling Pearson residuals for svyrepglm led to confint.svrepglm with
	likelihood profiling not finding the ends of the interval (Stephanie Zimmer)

	svyolr with rank deficiency and subsetting of cases in raked designs was overwriting
	the 'keep' variable (Justin Wishart)

	print.svyciprop() was printing fewer digits for the upper CI limit than the
	lower limit.

       	C++ code issues fixed

	degrees of freedom for score F-test in loglinear models fixed (Thomas Loughin)

	correct the scale in the F-distributed score test (Keiran Shao)

	allow user to specify degf= in svrepdesign to avoid needing to compute it
	(for Ben Schneider)

	warn if svychisq() is used with a single variable (for Isabelle Michaud)

	fix svyglm(rescale=FALSE) for replicate weights
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2023/06/02 13:42:34 mef Exp $
d4 1
a4 1
R_PKGVER=	4.4-2
d22 1
d24 5
@


1.4
log
@(math/R-survey) Updated 4.1.1 to 4.2.1

Following lines from inst/NEWS

4.2	Handling of influence functions has CHANGED. A function that supplies influence
	functions must supply one for every observation it was given in its input:
	use 0 for observations removed by subsetting. (for Guilherme Jacob)

	regTermTest(method="LRT") required the two models to use the same observations
	(of course), but didn't check, so IT WAS WRONG.
	It now subsets properly. (for Keiran Shao)

	This will probably be the *last* interpreted-R-only version of survey. Future
	versions will likely incorporate C++ code for faster variance computation and
	for small-area estimation.

	deffs in svyglm.svyrep.design (Ben Schneider)

	svynls() allows for prior (eg precision) weights (for Gary Nelson)

	improved names in svyquantile.svyrep.design (Ben Schneider)

	trimWeights() could get into an infinite recursion (Ingmar Sturm)

	data(myco) from Rao, Scott, and Skinner (originally from Clayton & Hills)

	as.svrepdesign now throws an error with post-stratified/raked/calibrated
	designs -- create replicates *first*, then calibrate (for Lauren Kennedy)

	trimWeights now works with replicate-weights designs

	score tests for svyglm (with Keiran Shao)

	svyby(), and thus svyboxplot(), didn't handle the new quantile functions
	correctly when standard error/ci weren't requested (Stephanie Zimmer, Raymond Pan)

	svycontrast() threw an error on the output of svyby() with return.replicates=TRUE
	(Alena Stern)

	Fix regTermTest for svycoxph for the methods lookup changes in R 4.0
	(and consequential change to marginpred)

	We don't provide model.matrix.svycoxph any more;use the inherited
	survival:::model.matrix.coxph

	Recent survival::coxph() switches to robust variances with non-integer weights
	so check for model$naive.var before model$var

	Disable the pass-through from predict.svycoxph to predict.coxph for type="expected"
	(Bryan Shepherd)

	svyby( svyvar) would throw an error on domains with only one observation
	(for Dirk Schumacher)

	svyvar() computes sample size 'n' in the same way for na.rm=TRUE as for a domain
	(for Raymond Pan)

	xdesign() for crossed designs (which aren't strictly surveys, but are basically similar)

	removed redundant loop in saddlepoint approximation to pchisqsum (Qiaolan Deng)

	fix in summary(svyivreg) for variances (Chandler McClellan)

	svyolr() didn't run for subsets of raked/calibrated designs (Antony Damico)

	add predict.svyolr (for Vincent Arel-Bundock)

	add anova.svycoxph (for Bryan Shepherd)

	add stringsToFactors=TRUE to svyby to ensure factors have same levels in domains
	(for various people including Stephanie Zimmer)

	more complicated svyby example in ?svycontrast

	svyranktest() gave an error for multiple groups with replicate weights (Kasuki Yoshida)

	Additional chisquared test for tables with zeros (CrossValidated question #571328)

	svydesign() has a 'calibrate.formula' option to tell R that your weights have
	already been calibrated/raked/post-stratified (for Tobias Schoch)

	svycontrast() didn't work on svrepglm objects without replicates (Thomas Loughlin)

	error in svycoxph with rescale=FALSE (Jing Zhang)

	error in vcov.svyrep.design with mse=TRUE (shows up in svyVGAM)

	svyquantile() didn't pay attention to interval_type for replicate weights (David Jorquera Petersen)

	svyquantile() qrules 5 to 9 now return the single data value when there's
	just one (David Jorquera Petersen)

	regTermTest() on svyolr() objects created in a function now finds the
	design object more reliably. (for Pedro Baldoni)

	regTermTest() will now test against null models in svycoxph()

	Fixes to svyquantile: https://github.com/bschneidr/r-forge-survey-mirror/pull/7
	(Ben Schneider)

	anova.svyloglin was broken by change to anova.glm(test=NULL)
	(Brian Ripley)

	One-sample svyttest() on logical variable now tests for P(TRUE==0) not P(FALSE==0)
	(Stephanie Zimmer)

	rename svykm.fit to svykm_fit because CRAN tests
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2021/09/20 00:49:49 mef Exp $
d4 1
a4 1
R_PKGVER=	4.2-1
d12 4
a15 1
DEPENDS+=	R-numDeriv>=2016.8.1.1:../../math/R-numDeriv
a16 1
# Packages suggested but not available: 'CompQuadForm', 'AER'
d21 1
a21 1
USE_LANGUAGES=	# none
d23 1
@


1.3
log
@(math/R-survey) Updated 3.36 to 4.1.1

4.1-1	CRAN

4.1	svyquantile() has been COMPLETELY REWRITTEN. The old version is available
	as oldsvyquantile() (for David Eduardo Jorquera Petersen)

	svycontrast()'s improvements for statistics with replicates are now also there with
	svyby(), for domain comparisons (Robert Baskin)

	svyttest() now gives an error message if the binary group variable isn't binary
	(for StackOverflow 60930323)

	confint.svyglm Wald-type intervals now correctly label the columns (eg 2.5%, 97.5%)
	(for Molly Petersen)

	svyolr() using linearisation had the wrong standard errors for intercepts
	other than the first, if extracted using vcov (it was correct in summary() output)

	svyglm() gave deffs that were too large by a factor of nrow(design). (Adrianne Bradford)

	svycoxph() now warns if you try to use frailty or other penalised terms, because they
	just come from calling coxph and I have no reason to believe they work correctly
	in complex samples (for Claudia Rivera)

	coef.svyglm() now has a complete= argument to match coef.default(). (for Thomas Leeper)

	summary.svyglm() now gives NA p-values and a warning, rather than Inf standard errors,
	when the residual df are zero or negative (for Dan Simpson and Lauren Kennedy)

	In the multigroup case, svyranktest() now documents which elements of the 'htest'
	object have which parts of the result, because it's a bit weird (for Justin Allen)

	svycontrast() gets a new argument add=TRUE to keep the old coefficients as well

	twophase() can now take strata= arguments that are character, not just factor
	or numeric. (for Pam Shaw)

	add reference to Chen & Lumley on tail probabilities for quadratic forms.

	add reference to Breslow et al for calibrate()

	add svyqqplot and svyqqmath for quantile-quantile plots

	SE.svyby would grab confidence interval limits instead of SEs if vartype=c("ci","se").

	svylogrank(method="small") was wrong (though method="score" and method="large" are ok),
	because of problems in obtaining the at-risk matrix from coxph.detail. (for Zhiwen Yao)

	added as.svrepdesign.svyimputationList and withReplicates.svyimputationList
	(for Ángel Rodríguez Laso)

	logLik.svyglm used to return the deviance and now divides it by -2

	svybys() to make multiple tables by separate variables rather than a joint table
	(for Hannah Evans)

	added predictat= option to svypredmeans for Steven Johnston.

	Fixed bug in postStratify.svyrep.design, was reweighting all reps the same (Steven Johnston)

	Fix date for Thomas & Rao (1987) (Neil Diamond)

	Add svygofchisq() for one-sample chisquared goodness of fit (for Natalie Gallagher)

	confint.svyglm(method="Wald") now uses t distribution with design df by default.
	(for Ehsan Karim)

	confint.svyglm() checks for zero/negative degrees of freedom


	confint.svyglm() checks for zero/negative degrees of freedom

	mrb bootstrap now doesn't throw an error when there's a single PSU in a stratum
	(Steve White)

	oldsvyquantile() bug with producing replicate-weight confidence intervals for
	multiple quantiles (Ben Schneider)

	regTermTest(,method="LRT") didn't work if the survey design object and model were
	defined in a function (for Keiran Shao)

	svyglm() has clearer error message when the subset= argument contains NAs (for Pam Shaw)
	and when the weights contain NAs (for Paige Johnson)

	regTermTest was dropping the first term for coxph() models (Adam Elder)

	svydesign() is much faster for very large datasets with character ids or strata.

	svyglm() now works with na.action=na.exclude (for Terry Therneau)

	extractAIC.svylm does the design-based AIC for the two-parameter Gaussian model, so
	estimating the variance parameter as well as the regression parameters.
	(for Benmei Liu and Barry Graubard)

	svydesign(, pps=poisson_sampling()) for Poisson sampling, and ppscov() for
	specifying PPS design with weighted or unweighted covariance of sampling indicators
	(for Claudia Rivera Rodriguez)


4.0	Some (and eventually nearly all) functions now return influence functions when
	called with a survey.design2 object and the influence=TRUE option.  These allow
	svyby() to estimate covariances between domains, which could previously only be
	done for replicate-weight designs, and so allow svycontrast() to do domain contrasts
	 - svymean, svytotal, svyratio, svymle, svyglm, svykappa

	Nonlinear least squares with svynls() now available

	Document that predict.svyglm() doesn't use a rescaled residual mean square
	to estimate standard errors, and so disagrees with some textbooks. (for Trent Buskirk)

3.38	When given a statistic including replicates, svycontrast() now transforms the replicates
	and calculates the variance, rather than calculating the variance then using the
	delta method.  Allows geometric means to exactly match SAS/SUDAAN (for Robert Baskin)

	vcov.svyrep.design to simplify computing variances from replicates (for William Pelham)

	svykm() no longer throws an error with single-observation domains (for Guy Cafri)

	Documentation for svyglm() specifies that it has always returned
	model-robust standard errors. (for various people wanting to fit relative risk
	regression models).

3.37	RODBC database connections are no longer supported.
	Use the DBI-compatible 'odbc' package

	set scale<-1 if it is still NULL after processing, inside svrepdesign()
        [https://stats.stackexchange.com/questions/409463]

       	Added withPV for replicate-weight designs [for Tomasz Żółtak]

      	svyquantile for replicate-weight designs now uses a supplied alpha to get
       	confidence intervals and estimates SE by dividing confidence interval length
       	by twice abs(qnorm(alpha/2)). [For Klaus Ignacio Lehmann Melendez]

       	All the svyquantile methods now take account of design degrees of freedom and
       	use t distributions for confidence intervals. Specify df=Inf to get a Normal.
       	[For Klaus Ignacio Lehmann Melendez]

       	svyivreg() for 2-stage least-squares (requires the AER package)

       	warn when rho= is used with type="BRR" in svrepdesign [for Tomasz Żółtak]

	Add "ACS" and "successive-difference" to type= in svrepdesign(),
	for the American Community Survey weights

	Add "JK2" to type= in svrepdesign

	Warn when scale, rscales are supplied unnecessarily to svyrepdesign

        More explanation of 'symbolically nested' in anova.svyglm

        Link to blog post about design df with replicate weights.

        Chase 'Encyclopedia of Design Theory' link again.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2019/08/08 19:53:54 brook Exp $
d4 1
a4 1
R_PKGVER=	4.1-1
@


1.2
log
@Update all R packages to canonical form.

The canonical form [1] of an R package Makefile includes the
following:

- The first stanza includes R_PKGNAME, R_PKGVER, PKGREVISION (as
  needed), and CATEGORIES.

- HOMEPAGE is not present but defined in math/R/Makefile.extension to
  refer to the CRAN web page describing the package.  Other relevant
  web pages are often linked from there via the URL field.

This updates all current R packages to this form, which will make
regular updates _much_ easier, especially using pkgtools/R2pkg.

[1] http://mail-index.netbsd.org/tech-pkg/2019/08/02/msg021711.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2019/07/31 13:30:20 brook Exp $
d4 1
a4 2
R_PKGVER=	3.36
CATEGORIES=	math
d14 5
@


1.1
log
@R-survey: initial commit.

Summary statistics, two-sample tests, rank tests, generalised linear
models, cumulative link models, Cox models, loglinear models, and
general maximum pseudolikelihood estimation for multistage stratified,
cluster-sampled, unequally weighted survey samples. Variances by
Taylor series linearisation or replicate weights. Post-stratification,
calibration, and raking. Two-phase subsampling designs. Graphics. PPS
sampling without replacement. Principal components, factor analysis.
@
text
@d1 1
a1 1
# $NetBSD$
d3 3
a5 1
CATEGORIES=	math R
a7 1
HOMEPAGE=	${R_HOMEPAGE_BASE}/survey/
a10 3
R_PKGNAME=	survey
R_PKGVER=	3.36

@

