* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/matchingMarkets.Rcheck’ * using R Under development (unstable) (2025-11-17 r89032) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) GNU Fortran (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) * running under: Fedora Linux 40 (Workstation Edition) * using session charset: UTF-8 * checking for file ‘matchingMarkets/DESCRIPTION’ ... OK * this is package ‘matchingMarkets’ version ‘1.0-4’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘matchingMarkets’ can be installed ... [262s/141s] OK * used C++ compiler: ‘g++ (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)’ * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking whether startup messages can be suppressed ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [26s/26s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for GNU extensions in Makefiles ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking use of PKG_*FLAGS in Makefiles ... OK * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking sizes of PDF files under ‘inst/doc’ ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking examples with --run-donttest ... [30m/31m] ERROR Running examples in ‘matchingMarkets-Ex.R’ failed The error most likely occurred in: > ### Name: stabit > ### Title: Matching model and selection correction for group formation > ### Aliases: stabit > ### Keywords: regression > > ### ** Examples > > ## No test: > ## --- SIMULATED EXAMPLE --- > > ## 1. Simulate one-sided matching data for 200 markets (m=200) with 2 groups > ## per market (gpm=2) and 5 individuals per group (ind=5). True parameters > ## in selection equation is wst=1, in outcome equation wst=0. > > ## 1-a. Simulate individual-level, independent variables > idata <- stabsim(m=200, ind=5, seed=123, gpm=2) > head(idata) m.id g.id wst R 1 1 1 -0.56047565 NA 2 1 1 -0.23017749 NA 3 1 1 1.55870831 NA 4 1 1 0.07050839 NA 5 1 1 0.12928774 NA 6 1 2 1.71506499 NA > > ## 1-b. Simulate group-level variables > mdata <- stabit(x=idata, simulation="NTU", method="model.frame", + selection = list(add="wst"), outcome = list(add="wst"), verbose=FALSE) > head(mdata$OUT) m.id g.id intercept wst.add R xi epsilon 1 1 1 1 0.3698086 1.5670690 -0.8497043 1.5670690 2 1 2 1 -0.2205573 -2.4953827 -1.1373036 -2.4953827 3 2 1 1 0.7198747 1.3680982 -1.1198997 1.3680982 4 2 2 1 -0.3026307 0.3707344 -0.7822018 0.3707344 5 3 1 1 -0.3271234 3.0184259 -0.3719449 3.0184259 6 3 2 1 -0.5219943 -0.1015002 -0.6527744 -0.1015002 > head(mdata$SEL) m.id g.id reg.id wst.add D V eta 1 1 1 2 0.3698086 1 2.7865819 2.41677335 2 1 2 1 -0.2205573 1 -1.5786364 -1.35807906 3 1 3 128 0.1935703 0 -0.1503470 -0.34391723 4 1 4 129 0.2221432 0 1.8206520 1.59850877 5 1 5 130 0.3377849 0 0.2492198 -0.08856511 6 1 6 131 0.3860231 0 1.4668226 1.08079950 > > > ## 2. Bias from sorting > > ## 2-a. Naive OLS estimation > lm(R ~ wst.add, data=mdata$OUT)$coefficients (Intercept) wst.add 1.321692 1.281722 > > ## 2-b. epsilon is correlated with independent variables > with(mdata$OUT, cor(epsilon, wst.add)) [1] 0.3650137 > > ## 2-c. but xi is uncorrelated with independent variables > with(mdata$OUT, cor(xi, wst.add)) [1] 0.001335074 > > ## 3. Correction of sorting bias when valuations V are observed > > ## 3-a. 1st stage: obtain fitted value for eta > lm.sel <- lm(V ~ -1 + wst.add, data=mdata$SEL) > lm.sel$coefficients wst.add 1.006372 > > eta <- lm.sel$resid[mdata$SEL$D==1] > > ## 3-b. 2nd stage: control for eta > lm(R ~ wst.add + eta, data=mdata$OUT)$coefficients (Intercept) wst.add eta 0.09072970 0.09468869 0.94626877 > > > ## 4. Run Gibbs sampler > fit1 <- stabit(x=idata, method="NTU", simulation="NTU", censored=1, + selection = list(add="wst"), outcome = list(add="wst"), + niter=2000, verbose=FALSE) Drawing 2000 MCMC samples... 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **************************************************| > > > ## 5. Coefficient table > summary(fit1) Coefficients for multi-index sample selection model. Method: Klein (2015), one-sided matching market Call: stabit(x = idata, selection = list(add = "wst"), outcome = list(add = "wst"), simulation = "NTU", method = "NTU", censored = 1, niter = 2000, verbose = FALSE) Selection equation: Estimate StdErr t.value p.value wst.add 1.15188 0.41565 2.7713 0.005846 ** Outcome equation: Estimate StdErr t.value p.value intercept 0.0733179 0.3871956 0.1894 0.84991 wst.add -0.0083934 0.4812529 -0.0174 0.98609 delta 0.9632351 0.2999799 3.2110 0.00143 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1> > > ## 6. Plot MCMC draws for coefficients > plot(fit1) > > ## --- REPLICATION, Klein (2015a) --- > > ## 1. Load data > data(baac00) > > ## 2. Run Gibbs sampler > klein15a <- stabit(x=baac00, selection = list(inv="pi",ieq="wst"), + outcome = list(add="pi",inv="pi",ieq="wst", + add=c("loan_size","loan_size2","lngroup_agei")), offsetOut=1, + method="NTU", binary=TRUE, gPrior=TRUE, marketFE=TRUE, niter=800000) Drawing 800000 MCMC samples... 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **************************************************| > > ## 3. Marginal effects > summary(klein15a, mfx=TRUE) Marginal effects for multi-index sample selection model. Method: Klein (2015), one-sided matching market Call: stabit(x = baac00, selection = list(inv = "pi", ieq = "wst"), outcome = list(add = "pi", inv = "pi", ieq = "wst", add = c("loan_size", "loan_size2", "lngroup_agei")), method = "NTU", binary = TRUE, offsetOut = 1, marketFE = TRUE, gPrior = TRUE, niter = 8e+05) Selection equation: Estimate StdErr t.value p.value pi.inv -0.67579 0.91732 -0.7367 0.230668 wst.ieq 0.34752 0.11931 2.9128 0.001798 ** 1 -1.53087 5.08204 -0.3012 0.381625 2 -1.45122 1.07630 -1.3483 0.088803 . 3 -1.17632 1.66944 -0.7046 0.240540 4 -1.34939 1.21813 -1.1078 0.134009 5 0.30208 3.99737 0.0756 0.469882 6 -0.90777 5.38295 -0.1686 0.433044 7 -0.28344 1.88959 -0.1500 0.440384 8 -2.33195 2.40631 -0.9691 0.166269 9 -2.19781 1.67018 -1.3159 0.094130 . 10 -3.09923 2.05383 -1.5090 0.065679 . 11 -2.45849 1.76793 -1.3906 0.082203 . 12 -0.50208 1.78756 -0.2809 0.389409 13 1.57169 1.14379 1.3741 0.084733 . 14 0.18346 1.81988 0.1008 0.459853 Outcome equation: Estimate StdErr t.value p.value pi.inv 1.427143 1.826678 0.7813 0.2192378 wst.ieq -0.571155 0.245290 -2.3285 0.0120727 * loan_size.add 0.942156 0.365942 2.5746 0.0065875 ** loan_size2.add -0.179807 0.081049 -2.2185 0.0156422 * lngroup_agei.add -0.385012 0.112136 -3.4334 0.0006185 *** 0 0.486645 0.239344 2.0332 0.0237889 * 1 -0.037476 0.659038 -0.0569 0.4774443 2 -0.366153 0.620025 -0.5905 0.2787979 3 0.209376 0.497024 0.4213 0.3377229 4 -0.028004 0.552575 -0.0507 0.4798959 5 -0.053175 0.640056 -0.0831 0.4670672 6 0.260408 0.582524 0.4470 0.3284304 7 -0.289024 0.542691 -0.5326 0.2983923 8 -0.131357 0.614770 -0.2137 0.4158555 9 0.428357 0.548905 0.7804 0.2194980 10 -0.197579 0.554121 -0.3566 0.3614911 11 -0.060958 0.540884 -0.1127 0.4553689 12 0.426507 0.706225 0.6039 0.2743688 13 0.187649 0.704099 0.2665 0.3954942 delta 0.505427 0.130164 3.8830 0.0001575 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1> > ## 4. Plot MCMC draws for coefficients > plot(klein15a) * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [87s/88s] OK * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * checking for new files in some other directories ... OK * DONE Status: 1 ERROR See ‘/data/blackswan/ripley/R/packages/tests-devel/matchingMarkets.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 36:06.13, 2195.35 + 50.77