R Under development (unstable) (2023-08-08 r84908 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > cat("# basics test\n") # basics test > # se_comb > COV = matrix(c(.1, .2, .2, .1), nrow=2) > colnames(COV) <- c("x1", "x2") > stopifnot(sqrt(sum(COV))==qgcomp::se_comb(covmat=COV, expnms = c("x1", "x2"))) > stopifnot(sqrt(sum(COV))==qgcomp::se_comb(covmat=COV, expnms = c("x1", "x2"), grad=c(1,1))) > > > #vc_comb > colnames(COV)[1] <- c("(Intercept)") > stopifnot(COV==qgcomp:::vc_comb(aname="(Intercept)", c("x2"), covmat=COV, grad=1.0)) > > > # grad.poly # anything better here? > for(deg in 1:3){ + stopifnot(all(!is.na(qgcomp:::grad.poly(intvals=c(1,2,3), degree=deg)))) + } > > > # stats > set.seed(50) > # linear model > dat = qgcomp::simdata_quantized() > ft = qgcomp::qgcomp.noboot(f=y ~ x1 + x2 + x3 + x4, expnms = c('x1', 'x2'), data=dat, q=2, family=gaussian(), bayes=TRUE) > summary(ft) Mixture slope parameters (Delta method CI): $coefficients Estimate Std. Error Lower CI Upper CI Pr(>|t|) (Intercept) 0.5672164 0.3030633 -0.02677679 1.16121 6.427391e-02 psi1 2.0087597 0.3297667 1.36242892 2.65509 2.253427e-08 > df.residual(ft) Warning message: In df.residual.qgcompfit(ft) : df.residual not implemented for this model > vcov(ft) (intercept) psi1 (intercept) 0.09184738 -0.05825273 psi1 -0.05825273 0.10874605 > AIC(ft) [1] 320.3829 > BIC(ft) [1] 336.0139 > logLik(ft) 'log Lik.' -154.1914 (df=6) > anova(ft) Analysis of Deviance Table Model: gaussian, link: identity Response: y Terms added sequentially (first to last) Df Deviance Resid. Df Resid. Dev F Pr(>F) NULL 99 249.70 x1 1 118.561 98 131.14 88.0745 3.413e-15 *** x2 1 0.787 97 130.35 0.5848 0.4463 x3 1 0.003 96 130.35 0.0022 0.9626 x4 1 2.466 95 127.88 1.8321 0.1791 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > confint(ft) # not working currently lower upper (intercept) -0.02677679 1.16121 psi1 1.36242892 2.65509 > > predict(ft) 1 2 3 4 5 6 2.43515792 2.15352149 2.45666393 0.12962390 0.14603541 2.57724976 7 8 9 10 11 12 2.73957399 2.59748215 0.26662124 2.43770517 0.12580302 2.57597614 13 14 15 16 17 18 2.57597614 2.59875577 0.40743946 2.45411668 2.73957399 0.14603541 19 20 21 22 23 24 0.56721643 0.12962390 2.45793756 0.14603541 0.43021909 2.15352149 25 26 27 28 29 30 2.45539030 2.15606874 2.73702674 2.57597614 0.14858266 2.31711934 31 32 33 34 35 36 0.40998671 2.59748215 -0.01374156 2.45666393 0.28940088 0.28812725 37 38 39 40 41 42 2.29816058 2.15479511 0.12835028 0.12580302 0.12707665 -0.01374156 43 44 45 46 47 48 0.28940088 2.73957399 2.57724976 2.59748215 2.31457209 0.43021909 49 50 51 52 53 54 2.31329846 0.14603541 2.73575311 2.45793756 2.15479511 2.43897880 55 56 57 58 59 60 0.26789487 2.43897880 0.28685362 -0.01119431 0.28940088 2.15606874 61 62 63 64 65 66 2.57852339 0.14730903 0.26916849 2.15606874 0.40998671 0.26789487 67 68 69 70 71 72 -0.01119431 -0.01501519 2.59748215 0.42767184 2.15479511 2.43643155 73 74 75 76 77 78 0.12707665 0.26662124 2.15479511 2.73702674 0.26789487 0.40743946 79 80 81 82 83 84 2.59748215 2.29816058 0.57103731 0.56721643 2.29688696 2.43770517 85 86 87 88 89 90 2.45793756 0.14730903 2.45411668 2.59493489 2.43515792 0.56721643 91 92 93 94 95 96 2.45666393 0.28685362 0.57103731 0.56976368 0.41126034 -0.01501519 97 98 99 100 0.42639821 0.56976368 0.40998671 0.42639821 > predict(ft, newdata = dat[1,]) 1 2.435158 > > proc.time() user system elapsed 2.45 0.34 2.76