* using log directory ‘/data/localhost/ripley/R/packages/tests-noLD/mvord.Rcheck’ * using R Under development (unstable) (2026-07-17 r90265) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) GNU Fortran (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2) * running under: Fedora Linux 44 (Server Edition) * using session charset: UTF-8 * current time: 2026-07-17 05:08:28 UTC * using option ‘--no-stop-on-test-error’ * checking for file ‘mvord/DESCRIPTION’ ... OK * this is package ‘mvord’ version ‘1.2.6’ * 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 ‘mvord’ can be installed ... [11s/24s] OK * used C compiler: ‘gcc (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2)’ * used Fortran compiler: ‘GNU Fortran (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2)’ * 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 use of S3 registration ... 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 ... [20s/42s] 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 pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking usage of KIND in Fortran files ... OK * checking sizes of PDF files under ‘inst/doc’ ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... [6s/11s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘check_methods.R’ Running ‘check_mvord_data.R’ Running ‘check_mvord_errors.R’ Running ‘check_set_threshold_type.R’ Running ‘check_toy_example.R’ [19s/37s] Running ‘check_transf_sigmas.R’ Running ‘check_transf_thresholds.R’ [35s/65s] ERROR Running the tests in ‘tests/check_toy_example.R’ failed. Complete output: > library(mvord) Loading required package: minqa Loading required package: BB Loading required package: ucminf Loading required package: dfoptim > library(MASS) > > > #data(data_toy_example) > tolerance <- 1e-6 > > mult.obs <- 2 > sigma <- matrix(c(1,0.8,0.8,1), ncol = 2) > betas <- list(c(0.8,-0.5), + c(0.8,-0.5)) > thresholds <- list(c(-1,1),c(-1,1)) > nobs <- 100 > suppressWarnings(RNGversion("3.5.0")) > set.seed(2017) > errors <- mvrnorm(n = nobs, mu = rep(0, mult.obs), Sigma = sigma) > > X1 <- rnorm(nobs, 0, 1) > X2 <- rnorm(nobs, 0, 1) > > pred <- cbind(X1, X2) > > y <- sapply(1:mult.obs, function(j) pred %*% betas[[j]] + errors[, j], simplify = "array") > y.ord <- sapply(1:mult.obs, function(j) cut(y[, , j], c(min(y[, , j]) - 1, + c(thresholds[[j]]), max(y[, , j]) + 1), + labels = FALSE), simplify = "array") > > predictors.fixed <- lapply(1:mult.obs, function(j) pred) > y <- as.data.frame(y.ord) > > for(i in 1:mult.obs){ + y[, i] <- factor(y[, i], levels = sort(unique(y[, i])), + ordered = TRUE) + } > > > > > data_toy_example <- cbind.data.frame(y, predictors.fixed[[1]]) > colnames(data_toy_example) <- c("Y1","Y2", "X1", "X2") > w <- c(rep(1/20, 20), rep(1/30, 30), rep(1/20, 20), rep(1/30, 30)) > > > > # convert data_toy_example into long format > df <- cbind.data.frame("i" = rep(1:100,2), + "j" = rep(1:2,each = 100), + "Y" = c(data_toy_example$Y1, data_toy_example$Y2), + "X1" = rep(data_toy_example$X1,2), + "X2" = rep(data_toy_example$X2,2), + "f1" = factor(sample(rep(data_toy_example$Y2,2)), + ordered = FALSE), + "f2" = factor(rep(data_toy_example$Y1,2), ordered = FALSE), + w = rep(w,2)) > df$X3 <- cut(df$X2, c(-Inf, -0.2, 0.2, Inf)) > > > > # library(ROI) > # ROI_solver <- function(starting.values, objFun, control){ > # n <- length(starting.values) > # op <- OP(objective = F_objective(objFun, n = n), > # bounds = V_bound(li = seq_len(n), lb = rep.int(-Inf, n))) > # optRes <- ROI_solve(op, solver = "nlminb", > # control = c(list(start = starting.values), > # control)) > # list(optpar = optRes$solution, > # objective = optRes$objval) # a vector of length equal to number of parameters to optimize > # } > # > # > # > > # Test MMO() ---- > > ## Coef constraints as vector ---- > > res <- mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = c(1,1), + contrasts = list(f1 = function(x) + contr.treatment(nlevels(df$f1), base = 1), + f2 = "contr.sum"), + control= mvord.control(solver="BFGS",se=TRUE)) Warning message: In mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, link = mvprobit(), : Variables f1 and f2 are absent, the contrasts will be ignored. > options(digits = 22) > > res.summary <- summary(res, short = FALSE) Call: mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cor_general(~1), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), contrasts = list(f1 = function(x) contr.treatment(nlevels(df$f1), base = 1), f2 = "contr.sum"), control = mvord.control(solver = "BFGS", se = TRUE)) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -134.91 280.34 294.06 32 Thresholds: Estimate Std. Error z value 1 1|2 -0.96257386663437372043 0.16613952738610665572 -5.7937700000000003087 1 2|3 1.03347036873219533248 0.15004482537619490135 6.8877399999999999736 2 1|2 -0.96257386663437372043 0.16613952738610665572 -5.7937700000000003087 2 2|3 1.03347036873219533248 0.15004482537619490135 6.8877399999999999736 Pr(>|z|) 1 1|2 6.8825e-09 *** 1 2|3 5.6684e-12 *** 2 1|2 6.8825e-09 *** 2 2|3 5.6684e-12 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.63801035062347777327 0.13576747301364094911 4.6992900000000004113 X2 1 -0.42672524816256218738 0.13643665802450738456 -3.1276399999999999757 Pr(>|z|) X1 1 2.6107e-06 *** X2 1 0.0017621 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.854266728221401816512 0.062440889990301867707 13.681210000000000093 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.96257386663519672876, 1.03347036873223707687, -0.96257386663519672876, 1.03347036873223707687), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.63801035062404309883, -0.42672524816263474046), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.85426672822122684536), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.16613952738605441972, 0.15004482537617935822, 0.16613952738605441972, 0.15004482537617935822), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.13576747301357894315, 0.13643665802446261481), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.062440889990360744222), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -134.90867383086322207, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 280.3436634512001433, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 294.05508548271637892, tolerance = tolerance)) > > > ## Coef constraints as list of matrices ---- > > res2 <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = list(matrix(rep(1,4), ncol = 1), matrix(rep(1,4), ncol = 1))) > > mvord:::check(all.equal(res$beta, res2$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res2$sebeta, tolerance = tolerance)) > > ## Without coefficients ---- > > res <- mvord::mvord(formula = MMO(Y) ~ -1, + data = df, + link = mvprobit(), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + control= mvord.control(solver="BFGS",se=TRUE)) > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ -1, data = df, error.structure = cor_general(~1), link = mvprobit(), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS", se = TRUE)) Formula: MMO(Y) ~ -1 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -153.66 313.51 321.57 26 Thresholds: Estimate Std. Error z value 1 1|2 -0.75479706534335111456 0.13105603927672343501 -5.7593500000000004135 1 2|3 0.86086304368830379730 0.13360642334316605306 6.4432799999999996743 2 1|2 -0.75479706534335111456 0.13105603927672343501 -5.7593500000000004135 2 2|3 0.86086304368830379730 0.13360642334316605306 6.4432799999999996743 Pr(>|z|) 1 1|2 8.4440e-09 *** 1 2|3 1.1692e-10 *** 2 1|2 8.4440e-09 *** 2 2|3 1.1692e-10 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value Pr(>|z|) Error Structure: Estimate Std. Error z value corr 1 2 0.905795171446981961516 0.038855435948833359772 23.311930000000000263 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.75479706538110091785, 0.86086304364935783973, -0.75479706538110091785, 0.86086304364935783973), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(numeric(0)), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.90579517144642240911), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.13105603927553965971, 0.13360642334434202905, 0.13105603927553965971, 0.13360642334434202905), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(numeric(0)), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.038855435949034601573), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -153.66397119528727444, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 313.51350940088383368, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 321.57073678022845797, tolerance = tolerance)) > > #polychor > res <- mvord::mvord(formula = MMO(Y) ~ 1, + data = df, + link = mvprobit(), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + control= mvord.control(solver="BFGS",se=TRUE)) Note: First threshold for each response is fixed to 0 in order to ensure identifiability! > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 1, data = df, error.structure = cor_general(~1), link = mvprobit(), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS", se = TRUE)) Formula: MMO(Y) ~ 1 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit fix1first 100 2 -153.56 315.46 326.32 51 Thresholds: Estimate Std. Error z value 1 1|2 0.00000000000000000000 0.00000000000000000000 NA 1 2|3 1.61576075497765492273 0.15607113681841799924 10.3527199999999997 2 1|2 0.00000000000000000000 0.00000000000000000000 NA 2 2|3 1.61576075497765492273 0.15607113681841799924 10.3527199999999997 Pr(>|z|) 1 1|2 NA 1 2|3 < 2.22e-16 *** 2 1|2 NA 2 2|3 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error (Intercept) 1 0.73786225123975501816 0.13500906203374141157 (Intercept) 2 0.77255635006398992726 0.14063945848441813946 z value Pr(>|z|) (Intercept) 1 5.4652799999999999159 4.6218e-08 *** (Intercept) 2 5.4931700000000001083 3.9478e-08 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.906373932587943742512 0.038916052690501058697 23.290489999999998361 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(0.0000000000000000000, 1.6157607546978449697, 0.0000000000000000000, 1.6157607546978449697), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.73786225358709867095, 0.77255634837212872057), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.90637393266264265623), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.00000000000000000000, 0.15607113684416776267, 0.00000000000000000000, 0.15607113684416776267), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.13500906208906049422, 0.14063945843173727979), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.038916052675185497378), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -153.5640565887688922, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 315.46144651087109878, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 326.31632228582151356, tolerance = tolerance)) > > ## cor_general(~factor) + probit ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~f2), + threshold.constraints = c(1,1), + coef.constraints = c(1,1), + contrasts = list(f2 = "contr.sum")) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cor_general(~f2), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), contrasts = list(f2 = "contr.sum"), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -134.17 283.39 303 38 Thresholds: Estimate Std. Error z value 1 1|2 -0.90552506790490738808 0.18265647646917093638 -4.9575300000000002143 1 2|3 1.00420547521773073640 0.17467164336593765661 5.7491000000000003212 2 1|2 -0.90552506790490738808 0.18265647646917093638 -4.9575300000000002143 2 2|3 1.00420547521773073640 0.17467164336593765661 5.7491000000000003212 Pr(>|z|) 1 1|2 7.1395e-07 *** 1 2|3 8.9718e-09 *** 2 1|2 7.1395e-07 *** 2 2|3 8.9718e-09 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.64793126338524931196 0.14153585035882265686 4.5778600000000002623 X2 1 -0.42893128334007774027 0.13989943737309815108 -3.0659999999999998366 Pr(>|z|) X1 1 4.6976e-06 *** X2 1 0.0021695 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error corr f21 1 2 0.736678597234034060470 0.178238394308577990932 corr f22 1 2 0.918298263052403807016 0.068858656199907136708 corr f23 1 2 0.837106119712592633419 0.131036082998734149108 z value Pr(>|z|) corr f21 1 2 4.1331100000000002836 3.5789e-05 *** corr f22 1 2 13.3359900000000006770 < 2.22e-16 *** corr f23 1 2 6.3883599999999995944 1.6767e-10 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, + c(-0.90552506790519915469, 1.00420547521745429087, -0.90552506790519915469, 1.00420547521745429087), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, + c(0.64793126338493944871, -0.42893128334048874484), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, + c(0.73667859723415496376, 0.91829826305234418804, 0.83710611971260706632), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, + c(0.18265647646915181279, 0.17467164336594759311, 0.18265647646915181279, 0.17467164336594759311), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, + c(0.14153585035881874332, 0.13989943737309898375), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, + c(0.17823839430849069965, 0.06885865619995423792, 0.13103608299872890330), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -134.17046176709035876, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 283.39468697504094052, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 303.00349482656417877, tolerance = tolerance)) > > ## cor_general(~1) + logit ---- > res <- mvord::mvord(formula = MMO(Y, i, j) ~ 0 + X1 + X2, + data = df, + link = mvlogit(df = 8L), + error.structure = cor_general(~1)) > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y, i, j) ~ 0 + X1 + X2, data = df, error.structure = cor_general(~1), link = mvlogit(df = 8L)) Formula: MMO(Y, i, j) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvlogit flexible 100 2 -132.87 285.51 311.28 518 Thresholds: Estimate Std. Error z value 1 1|2 -1.61992843008548503825 0.33738753962232748140 -4.8013899999999996027 1 2|3 1.83247470527484490610 0.36742755620118178195 4.9873099999999999099 2 1|2 -1.61590255918030423210 0.33963203730282670589 -4.7577999999999995850 2 2|3 1.74613476419911450854 0.30112278228371741617 5.7987500000000000711 Pr(>|z|) 1 1|2 1.5757e-06 *** 1 2|3 6.1226e-07 *** 2 1|2 1.9571e-06 *** 2 2|3 6.6812e-09 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 1.28924147599048888324 0.30395056353864113863 4.2416200000000001680 X1 2 0.88420394089828513451 0.29740834920774883443 2.9730300000000000615 X2 1 -0.84290957705760327645 0.30080366116020412770 -2.8021899999999999586 X2 2 -0.71568742791981476703 0.25697669884663804085 -2.7850299999999998946 Pr(>|z|) X1 1 2.2192e-05 *** X1 2 0.0029488 ** X2 1 0.0050757 ** X2 2 0.0053523 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.883893425405178345677 0.071174670988525381987 12.418649999999999523 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > # mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-1.6170817306633420, 1.7855897338762188, -1.6170817306633420, 1.7855897338762188), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$coefficients$Estimate, c(1.07242200717115987, 1.07242200717115987, -0.76715925377701732, -0.76715925377701732), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.85317690560688531), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.28997405649500174, 0.27427389826231802, 0.28997405649500174, 0.27427389826231802), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.24111402270822993, 0.24111402270822993, 0.24156664773225886, 0.24156664773225886), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.063316529381183581), tolerance = tolerance)) > # mvord:::check(all.equal(logLik(res), -135.41665313840898, tolerance = tolerance)) > # mvord:::check(all.equal(AIC(res), 281.35962206629165, tolerance = tolerance)) > # mvord:::check(all.equal(BIC(res), 295.07104409780789, tolerance = tolerance)) > > ## some fixed threshold values ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cov_general(~1), + threshold.constraints = c(1,1), + threshold.values = list(c(-1,NA), + c(-1,NA)), + coef.constraints = c(1,1)) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cov_general(~1), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), threshold.values = list(c(-1, NA), c(-1, NA)), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit fix1first 100 2 -134.64 282.04 298.67 37 Thresholds: Estimate Std. Error z value 1 1|2 -1.00000000000000000000 0.00000000000000000000 NA 1 2|3 1.08266798008479359083 0.24926043418211965563 4.3435199999999998255 2 1|2 -1.00000000000000000000 0.00000000000000000000 NA 2 2|3 1.08266798008479359083 0.24926043418211965563 4.3435199999999998255 Pr(>|z|) 1 1|2 NA 1 2|3 1.4022e-05 *** 2 1|2 NA 2 2|3 1.4022e-05 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.68834946142132802382 0.15128036741878822524 4.5501599999999999824 X2 1 -0.45406517655219541529 0.15704134440949746310 -2.8913700000000002177 Pr(>|z|) X1 1 5.3606e-06 *** X2 1 0.0038356 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.856153637803471867507 0.061822221469716505393 13.8486399999999996169 sigma 1 1.001934583870321970878 0.185187960684477181950 5.4103700000000003456 sigma 2 1.089828199316845491751 0.197593289724319026712 5.5155099999999999127 Pr(>|z|) corr 1 2 < 2.22e-16 *** sigma 1 6.2896e-08 *** sigma 2 3.4777e-08 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-1.000000000000000000000, 1.082667980083374503764, -1.000000000000000000000, 1.082667980083374503764), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.6883494614209317852271, -0.4540651765505133163892), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.8561536378031743277361, 1.0019345838689188710191, 1.0898281993157663549709), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.0000000000000000000000, 0.2492604341815170820862, 0.0000000000000000000000, 0.2492604341815170820862), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1512803674185349001036, 0.1570413444091093568833), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.06182222146981963123435, 0.18518796068392143205905, 0.19759328972385112321852), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -134.6391112878561102661, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 282.0441800225207202857, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 298.6729258905298252103, tolerance = tolerance)) > > > ## cor_equi(~1) + coef.constraints matrix ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_equi(~1), + threshold.constraints = c(1,1), + coef.constraints = cbind(c(1,1),c(1,2))) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cor_equi(~1), link = mvprobit(), coef.constraints = cbind(c(1, 1), c(1, 2)), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -134.84 282.45 299.08 35 Thresholds: Estimate Std. Error z value 1 1|2 -0.96275665235739271708 0.16703865743959539492 -5.7636799999999999145 1 2|3 1.03388029135896997168 0.15203091606551882853 6.8004600000000001714 2 1|2 -0.96275665235739271708 0.16703865743959539492 -5.7636799999999999145 2 2|3 1.03388029135897019373 0.15203091606551882853 6.8004600000000001714 Pr(>|z|) 1 1|2 8.2301e-09 *** 1 2|3 1.0429e-11 *** 2 1|2 8.2301e-09 *** 2 2|3 1.0429e-11 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.63820467410884895720 0.13670492809270148871 4.6684799999999997411 X2 1 -0.44676561119523566790 0.15900879662669639703 -2.8096899999999997988 X2 2 -0.40750155519095393464 0.13850979189706100203 -2.9420399999999999885 Pr(>|z|) X1 1 3.0343e-06 *** X2 1 0.0049589 ** X2 2 0.0032606 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value (Intercept) 1.2729005712546992424 0.2322161184793219979 5.4815300000000002356 Pr(>|z|) (Intercept) 4.2165e-08 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.9627566523584676350112, 1.0338802913596250032668, -0.9627566523584676350112, 1.0338802913596247812222), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.6382046741095841468905, -0.4467656111955374820255, -0.4075015551913261924177), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$error.structure$Estimate, c(1.272900571254629964457), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.1670386574395647250046, 0.1520309160654948199554, 0.1670386574395647250046, 0.1520309160654948199554), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1367049280926301846328, 0.1590087966266460206555, 0.1385097918969951935608), tolerance = tolerance)) > # mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.2322161184793045674013), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -134.8432321319771745038, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 282.4524217107628487611, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 299.0811675787719536856, tolerance = tolerance)) > > ## cor_equi(~1) + coef.constraints list ---- > res2 <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_equi(~1), + threshold.constraints = c(1,1), + coef.constraints = list(X2 = cbind(c(1,1,0,0), c(0,0,1,1)), + X1 = matrix(rep(1,4), ncol = 1))) > > mvord:::check(all.equal(res$beta, res2$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res2$sebeta, tolerance = tolerance)) > > ## cor_ar1(~1) ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_ar1(~ 1 + X1), + threshold.constraints = c(1,1), + coef.constraints = c(1,1)) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cor_ar1(~1 + X1), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -133.94 280.64 297.27 35 Thresholds: Estimate Std. Error z value 1 1|2 -0.95722951152607094194 0.16558288168121362838 -5.7809699999999999420 1 2|3 1.03746793968293560262 0.15306952616699889824 6.7777599999999997848 2 1|2 -0.95722951152607094194 0.16558288168121362838 -5.7809699999999999420 2 2|3 1.03746793968293560262 0.15306952616699889824 6.7777599999999997848 Pr(>|z|) 1 1|2 7.4272e-09 *** 1 2|3 1.2206e-11 *** 2 1|2 7.4272e-09 *** 2 2|3 1.2206e-11 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.65304208674275188162 0.13584016202006010676 4.8074300000000000921 X2 1 -0.42273136793605414763 0.13820217716273577868 -3.0587900000000001199 Pr(>|z|) X1 1 1.5288e-06 *** X2 1 0.0022223 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error (Intercept) 1.29891554197172931495 0.24517466007554486462 X1 0.29350892362908137523 0.29416988646865427359 z value Pr(>|z|) (Intercept) 5.29792000000000040671 1.1713e-07 *** X1 0.99775000000000002576 0.3184 --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.9572295115261755249492, 1.0374679396833161870717, -0.9572295115261755249492, 1.0374679396833161870717), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.6530420867428219366957, -0.4227313679354475217664), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(1.298915541971320308789, 0.293508923629326790028), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.1655828816811988069002, 0.1530695261669812456962, 0.1655828816811988069002, 0.1530695261669812456962), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1358401620200463122412, 0.1382021771627104100855), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.2451746600755327076815, 0.2941698864686516090572), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -133.938827675498004055, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 280.6436127978045078635, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 297.272358665813612788, tolerance = tolerance)) > > > ## cor_ar1(~ 1 + covariate) ---- > res2 <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_ar1(~1 + X1), + threshold.constraints = c(1,1), + coef.constraints = list(matrix(rep(1,4), ncol = 1), + matrix(rep(1,4), ncol = 1))) > > mvord:::check(all.equal(res$beta, res2$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res2$sebeta, tolerance = tolerance)) > > # MMO2() + NA in coef.constraints matrix ---- > res <- mvord(formula = MMO2(Y1,Y2) ~ 0 + X1 + X2, + data = data_toy_example, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = cbind(c(1,2),c(NA,1))) > > res.summary <- summary(res, short = FALSE) Call: mvord(formula = MMO2(Y1, Y2) ~ 0 + X1 + X2, data = data_toy_example, error.structure = cor_general(~1), link = mvprobit(), coef.constraints = cbind(c(1, 2), c(NA, 1)), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS")) Formula: MMO2(Y1, Y2) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -137.65 288.06 304.69 63 Thresholds: Estimate Std. Error z value Y1 1|2 -0.89892942527426689114 0.16246077762265453970 -5.5332100000000004059 Y1 2|3 0.98413365940509711649 0.15981657213962835451 6.1578900000000000858 Y2 1|2 -0.89892942527426689114 0.16246077762265453970 -5.5332100000000004059 Y2 2|3 0.98413365940509700547 0.15981657213962835451 6.1578900000000000858 Pr(>|z|) Y1 1|2 3.1442e-08 *** Y1 2|3 7.3718e-10 *** Y2 1|2 3.1442e-08 *** Y2 2|3 7.3718e-10 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.681944859288537541531 0.174961892922590345201 3.89767999999999981142 X1 2 0.468376583108100374986 0.157106006693626315540 2.98127999999999993008 X2 1 -0.052179801987648086192 0.089798215416096324737 -0.58108000000000004093 Pr(>|z|) X1 1 9.712e-05 *** X1 2 0.0028705 ** X2 1 0.5611876 --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr Y1 Y2 0.890390657144559005687 0.063175533024076371835 14.09392000000000067 Pr(>|z|) corr Y1 Y2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.8989294252736504953205, 0.9841336594057152886705, -0.8989294252736503842982, 0.9841336594057153996928), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.68194485928859438494953, 0.46837658310856356003171, -0.05217980198794509860694), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.8903906571446290607597), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.1624607776227008359982, 0.1598165721396140603883, 0.1624607776227008359982, 0.1598165721396140603883), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.17496189292260000414103, 0.15710600669362786985239, 0.08979821541610534529898), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.0631755330240382911855), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -137.6494615446075613363, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 288.064880536023622426, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 304.6936264040327273506, tolerance = tolerance)) > > > ## MMO2() + coef.constraints list ---- > res2 <- mvord::mvord(formula = MMO2(Y1,Y2) ~ 0 + X1 + X2, + data = data_toy_example, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = list(X1 = cbind(c(1,1,0,0), c(0,0,1,1)), + X2 = matrix(c(rep(0,2),rep(1,2)), ncol = 1))) > > mvord:::check(all.equal(res$beta, res2$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res2$sebeta, tolerance = tolerance)) > > # MMO() + offset ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + offset(X2), + data = df, + #index = c("i", "j"), + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + #se = TRUE, + error.structure = cor_general(~1), + threshold.constraints = c(1,2), + coef.constraints = list(X1 = cbind(c(1,1,0,0), c(0,0,1,1)))) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + offset(X2), data = df, error.structure = cor_general(~1), link = mvprobit(), coef.constraints = list(X1 = cbind(c(1, 1, 0, 0), c(0, 0, 1, 1))), threshold.constraints = c(1, 2), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + offset(X2) link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -194.33 403.71 423.31 78 Thresholds: Estimate Std. Error z value 1 1|2 -0.76726526231290581581 0.12023341892198760594 -6.3814599999999996882 1 2|3 0.89190483008289811462 0.13058942975152154631 6.8298399999999999110 2 1|2 -0.79675344625499111562 0.11172347359894702068 -7.1314799999999998192 2 2|3 0.87294080475425606114 0.13662238116328184745 6.3894399999999995643 Pr(>|z|) 1 1|2 1.7540e-10 *** 1 2|3 8.5010e-12 *** 2 1|2 9.9297e-13 *** 2 2|3 1.6649e-10 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.53370081955545267682 0.13636430505169050420 3.9137900000000001022 X1 2 0.34385576063209577491 0.10634167793895876741 3.2334999999999998188 Pr(>|z|) X1 1 9.086e-05 *** X1 2 0.0012228 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.940808527829555263367 0.033697206765219915592 27.919480000000000075 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-0.7672652623027305107684, 0.8919048301000485068357, -0.7967534462687086982413, 0.8729408047614937160574), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.5337008195901541407480, 0.3438557606717420056519), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.9408085278204662005308), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.1202334189234334493879, 0.1305894297520299174309, 0.1117234735991832761393, 0.1366223811642423013879), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1363643050543318635537, 0.1063416779401736012023), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.03369720676949919391241), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -194.3258468555947047207, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 403.705457152049632441, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 423.314265003572927526, tolerance = tolerance)) > > res2 <- mvord::mvord(formula = MMO(Y) ~ 0 + X1, + offset = list(df$X2[1:100], df$X2[101:200]), + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,2), + coef.constraints = list(X1 = cbind(c(1,1,0,0), c(0,0,1,1)))) > > mvord:::check(all.equal(res$beta, res2$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res2$sebeta, tolerance = tolerance)) > > res3 <- mvord::mvord(formula = MMO2(Y1,Y2) ~ 0 + X1 + offset(X2), + data = data_toy_example, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + #se = TRUE, + error.structure = cor_general(~1), + threshold.constraints = c(1,2), + coef.constraints = list(X1 = cbind(c(1,1,0,0), c(0,0,1,1)))) > mvord:::check(all.equal(res$beta, res3$beta, tolerance = tolerance)) > mvord:::check(all.equal(res$sebeta, res3$sebeta, tolerance = tolerance)) > > # MMO() + coef values ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df, + #index = c("i", "j"), + link = mvlogit(), + #solver = "newuoa", + #se = TRUE, + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = cbind(c(NA, NA), c(1,2)), + coef.values = cbind(c(1, 1), c(NA,NA))) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df, error.structure = cor_general(~1), link = mvlogit(), coef.constraints = cbind(c(NA, NA), c(1, 2)), coef.values = cbind(c(1, 1), c(NA, NA)), threshold.constraints = c(1, 1)) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvlogit flexible 100 2 -135.52 281.57 295.28 183 Thresholds: Estimate Std. Error z value 1 1|2 -1.58328807903068535801 0.25851080785979041465 -6.1246499999999999275 1 2|3 1.75864310979426385906 0.24251589429374961759 7.2516600000000002169 2 1|2 -1.58328807903068535801 0.25851080785979041465 -6.1246499999999999275 2 2|3 1.75864310979426385906 0.24251589429374961759 7.2516600000000002169 Pr(>|z|) 1 1|2 9.0883e-10 *** 1 2|3 4.1169e-13 *** 2 1|2 9.0883e-10 *** 2 2|3 4.1169e-13 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X2 1 -0.77306152336150613102 0.26732808001454183566 -2.8918099999999999916 X2 2 -0.72430385743402359022 0.24403986351180820269 -2.9679700000000002191 Pr(>|z|) X2 1 0.0038303 ** X2 2 0.0029977 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.855894208212903184751 0.060599281401956930915 14.123829999999999885 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > tolerance2 <- 1e-4 > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-1.583288915548024533564, 1.758642501421955106622, -1.583288915548024533564, 1.758642501421955106622), tolerance = tolerance2)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(-0.7730608423417825170176, -0.7243032675736262859800), tolerance = tolerance2)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.8558944465934688050623), tolerance = tolerance2)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.2585108482987530376107, 0.2425159370850978601819, 0.2585108482987530376107, 0.2425159370850978601819), tolerance = tolerance2)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.2673280928737744588375, 0.2440398419906193439033), tolerance = tolerance2)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.06059919526643173237623), tolerance = tolerance2)) > mvord:::check(all.equal(logLik(res)[[1]], -135.5210996495467554723, tolerance = tolerance2)) > mvord:::check(all.equal(AIC(res), 281.568515088567210114, tolerance = tolerance2)) > mvord:::check(all.equal(BIC(res), 295.2799371200834457341, tolerance = tolerance2)) > > # MMO() + factor covariate ---- > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X3, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + coef.constraints = c(1,1)) > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X3, data = df, error.structure = cor_general(~1), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X3 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 100 2 -136.05 284.87 301.5 34 Thresholds: Estimate Std. Error z value 1 1|2 -1.21270698724947734171 0.21131407873821006493 -5.7388799999999999812 1 2|3 0.75845153901255235596 0.18860790313554481878 4.0213099999999997181 2 1|2 -1.21270698724947734171 0.21131407873821006493 -5.7388799999999999812 2 2|3 0.75845153901255235596 0.18860790313554481878 4.0213099999999997181 Pr(>|z|) 1 1|2 9.5302e-09 *** 1 2|3 5.7874e-05 *** 2 1|2 9.5302e-09 *** 2 2|3 5.7874e-05 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error X1 1 0.582346304092301814137 0.133874274950989191613 X3(-0.2,0.2] 1 0.065949564661063303506 0.394250784463522463419 X3(0.2, Inf] 1 -0.639867558057638841085 0.239596299509531901473 z value Pr(>|z|) X1 1 4.34994999999999976126 1.3617e-05 *** X3(-0.2,0.2] 1 0.16728000000000001202 0.8671512 X3(0.2, Inf] 1 -2.67060999999999992838 0.0075714 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.85797576566124267305 0.06239182988603435287 13.751409999999999911 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-1.212706987250618206886, 0.758451539011639419563, -1.212706987250618206886, 0.758451539011639419563), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.58234630409261545214150, 0.06594956465951176682871, -0.63986755805831896370961), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.8579757656611409766256), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.2113140787381464491546, 0.1886079031355630819533, 0.2113140787381464491546, 0.1886079031355630819533), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1338742749509412854891, 0.3942507844634823288565, 0.2395962995094961522913), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.06239182988606906121731), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -136.0526219854373835005, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 284.8712014176832667545, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 301.499947285692371679, tolerance = tolerance)) > > # MMO() + interaction ---- > res <- mvord::mvord(formula = MMO(Y) ~ 1 + X1 * X2, + data = df, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,1), + threshold.values = list(c(-1,NA), + c(-1,NA)), + coef.constraints = c(1,1)) > res.summary <- summary(res, short = TRUE) Call: mvord::mvord(formula = MMO(Y) ~ 1 + X1 * X2, data = df, error.structure = cor_general(~1), link = mvprobit(), coef.constraints = c(1, 1), threshold.constraints = c(1, 1), threshold.values = list(c(-1, NA), c(-1, NA)), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 1 + X1 * X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit fix1first 100 2 -134.63 282.02 298.65 34 Thresholds: Estimate Std. Error z value 1 1|2 -1.00000000000000000000 0.00000000000000000000 NA 1 2|3 1.00269513578591284997 0.22781659168153570172 4.4013299999999997425 Pr(>|z|) 1 1|2 NA 1 2|3 1.0759e-05 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error (Intercept) 1 -0.021913582739169424479 0.167100624889607557444 X1 1 0.621621046245789399265 0.138540865251088579635 X2 1 -0.427624354283898666651 0.140667605271843715320 X1:X2 1 -0.102567255998614298429 0.150381573286403613654 z value Pr(>|z|) (Intercept) 1 -0.13114000000000000656 0.8956645 X1 1 4.48690999999999995396 7.2262e-06 *** X2 1 -3.03996000000000021757 0.0023661 ** X1:X2 1 -0.68205000000000004512 0.4952094 --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.853574805224873611742 0.063090989221274776377 13.529270000000000351 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > mvord:::check(all.equal(res.summary$thresholds$Estimate, c(-1.000000000000000000000, 1.002695135787324165477), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(-0.02191358273802538475516, 0.62162104624596714597118, -0.42762435428426853745165, -0.10256725599972128792903), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.8535748052245384354109), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.0000000000000000000000, 0.2278165916815008962271), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1671006248895306467439, 0.1385408652510198845853, 0.1406676052717547309445, 0.1503815732862690546234), tolerance = tolerance)) > #mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.063097735777156036), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.06309098922138993426056), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -134.6255603757719541136, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 282.0170781983524079806, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 298.6458240663615129051, tolerance = tolerance)) > > > # MMO() + MISSINGS ---- > > df_NA <- df[-c(1,90:110),] > > > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df_NA, + link = mvprobit(), + control = mvord.control(solver = "BFGS"), + error.structure = cor_general(~1), + threshold.constraints = c(1,2)) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df_NA, error.structure = cor_general(~1), link = mvprobit(), threshold.constraints = c(1, 2), control = mvord.control(solver = "BFGS")) Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 99 2 -119.45 258.71 284.4 51 Thresholds: Estimate Std. Error z value 1 1|2 -1.02012637737766942436 0.19996641229665171324 -5.1014900000000000801 1 2|3 1.14180364925589206138 0.22379090694084638469 5.1021000000000000796 2 1|2 -0.90662822299088441369 0.19059651595776885835 -4.7567899999999996297 2 2|3 0.99945117268890837359 0.17403069740247403829 5.7429600000000000648 Pr(>|z|) 1 1|2 3.3699e-07 *** 1 2|3 3.3590e-07 *** 2 1|2 1.9669e-06 *** 2 2|3 9.3036e-09 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.83733616645764474828 0.18898470050601187675 4.4307100000000003703 X1 2 0.49821075301199846397 0.16630384261006037061 2.9957899999999999530 X2 1 -0.44740279449501990650 0.18763575165175883086 -2.3844199999999999839 X2 2 -0.35390389962212687180 0.14489624593594169211 -2.4424600000000000755 Pr(>|z|) X1 1 9.3924e-06 *** X1 2 0.0027374 ** X2 1 0.0171060 * X2 2 0.0145874 * --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.910650307812029824461 0.070553566084035831962 12.907220000000000582 Pr(>|z|) corr 1 2 < 2.22e-16 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, + c(-1.0201263773742383911269, 1.1418036492524186176212, -0.9066282230038859024646, 0.9994511726914282467860), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.8373361664658567349306, 0.4982107530258053085248, -0.4474027944949834356692, -0.3539038996339812781500), + tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.9106503078209118307029), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.1999664122961394840949, 0.2237909069393826111405, 0.1905965159570501277209, 0.1740306974019930341679), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.1889847005044749950198, 0.1663038426085674814647, 0.1876357516513920686840, 0.1448962459360401411335), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.07055356607861483497768), tolerance = tolerance)) > mvord:::check(all.equal(logLik(res)[[1]], -119.4526280916837492896, tolerance = tolerance)) > mvord:::check(all.equal(AIC(res), 258.7052561833675099479, tolerance = tolerance)) > mvord:::check(all.equal(BIC(res), 284.3969426996999345647, tolerance = tolerance)) > > #weights > df_NA$weights <- 0.5 > res <- mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, + data = df_NA, + link = mvprobit(), + weights.name = "weights", + error.structure = cor_general(~1), + threshold.constraints = c(1,2)) > > res.summary <- summary(res, short = FALSE) Call: mvord::mvord(formula = MMO(Y) ~ 0 + X1 + X2, data = df_NA, error.structure = cor_general(~1), link = mvprobit(), threshold.constraints = c(1, 2), weights.name = "weights") Formula: MMO(Y) ~ 0 + X1 + X2 link threshold nsubjects ndim logPL CLAIC CLBIC fevals mvprobit flexible 99 2 -59.73 139.25 164.94 483 Thresholds: Estimate Std. Error z value 1 1|2 -1.02012856158743625556 0.39993314138171803807 -2.5507499999999998508 1 2|3 1.14180491806422734768 0.44758338022045901505 2.5510399999999999743 2 1|2 -0.90661637732424438241 0.38119351363488990225 -2.3783599999999998076 2 2|3 0.99945820411513941472 0.34806068030253622947 2.8715099999999997848 Pr(>|z|) 1 1|2 0.0107492 * 1 2|3 0.0107401 * 2 1|2 0.0173897 * 2 2|3 0.0040852 ** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Coefficients: Estimate Std. Error z value X1 1 0.83733347246744915804 0.37797046603080047822 2.2153399999999998649 X1 2 0.49821372241736727737 0.33260835756233397831 1.4979000000000000092 X2 1 -0.44740669452608511358 0.37527219869907996186 -1.1922200000000000575 X2 2 -0.35390623779682617300 0.28979242703642738022 -1.2212400000000001032 Pr(>|z|) X1 1 0.026737 * X1 2 0.134159 X2 1 0.233175 X2 2 0.221995 --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 Error Structure: Estimate Std. Error z value corr 1 2 0.91064678507582907940 0.14111091931059813187 6.4534099999999998687 Pr(>|z|) corr 1 2 1.0936e-10 *** --- Signif. codes: 0 '***' 0.001000000000000000020817 '**' 0.01000000000000000020817 '*' 0.05000000000000000277556 '.' 0.1000000000000000055511 ' ' 1 > > options(digits = 22) > > # paste(format(res.summary$thresholds$Estimate), collapse = ",") > # paste(format(res.summary$coefficients$Estimate), collapse = ",") > # paste(format(res.summary$error.structure$Estimate), collapse = ",") > mvord:::check(all.equal(res.summary$thresholds$Estimate, + c(-1.0201283793713198377873, 1.1418048707357395521456, -0.9066161533747665313143, 0.9994581570190742558779), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$Estimate, c(0.8373332969208180376341, 0.4982136050008418859392, -0.4474066175154422508875, -0.3539061566757252808024), + tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$Estimate, c(0.9106469196938988819312), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$thresholds$`Std. Error`, c(0.3999331442401471981007, 0.4475833313547766811880, 0.3811935020996289336104, 0.3480606771313752845209), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$coefficients$`Std. Error`, c(0.3779704499331774103510, 0.3326083385001772918521, 0.3752721890043577146479, 0.2897924558296670061175), tolerance = tolerance)) > mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, c(0.1411107414052604758226), tolerance = tolerance)) Error in mvord:::check(all.equal(res.summary$error.structure$`Std. Error`, : ..1 is not TRUE Calls: -> stopifnot Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [68s/129s] OK * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/data/localhost/ripley/R/packages/tests-noLD/mvord.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 6:41.56, 192.50 + 10.41