Articles

Affichage des articles du janvier, 2020

Install lme4ord package

lme4ord package is available in GitHub but cannot be installed due to an error: > library(remotes) > install_github("stevencarlislewalker/lme4ord") Downloading GitHub repo stevencarlislewalker/lme4ord@master Installing 1 packages: ape essai de l'URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/ape_5.3.tgz' Content type 'application/x-gzip' length 2612810 bytes (2.5 MB) ================================================== downloaded 2.5 MB The downloaded binary packages are in /var/folders/1v/rfxtzxc11kj33kb8tg7znw080000gn/T//RtmprjveC6/downloaded_packages ✓  checking for file ‘/private/var/folders/1v/rfxtzxc11kj33kb8tg7znw080000gn/T/RtmprjveC6/remotesda0d258c4827/stevencarlislewalker-lme4ord-5f62664/DESCRIPTION’ (471ms) ─  preparing ‘lme4ord’: ✓  checking DESCRIPTION meta-information ... ─  checking for LF line-endings in source and make files and shell scripts ─  checking for empty or unneeded directories ─  building

Confidence interval for orthogonal regression

I have not found a method to estimate confidence interval of orthogonal regression. Then I build one using bootstrap. OrthogonalRegression <- function(x, y) {   library("pracma")   xnew <- seq(from=min(x), to=max(x), length.out = 100)   replicate <- 1000   m <- matrix(data=NA, nrow=replicate, ncol=length(xnew))   c <- NULL   d <- NULL   odrx <- odregress(x, y)   for (r in 1:replicate) {     s <- sample(1:length(x), length(x), replace = TRUE)     odr <- odregress(x[s], y[s])     cc <- odr$coeff     c <- c(c, cc[1])     d <- c(d, cc[2])     # Prediction     ynew <- cbind(xnew, 1) %*% cc     m[r, ] <- ynew   }   q <- apply(m, MARGIN=2, FUN=quantile, probs=c(0.025, 0.5, 0.975))   q <- rbind(q, x=xnew)   qb <- quantile(c, probs=c(0.025, 0.5, 0.975))   qa <- quantile(d, probs=c(0.025, 0.5, 0.975))     return(list(model=odrx,               values=q,               intercept=qa,               slope=qb))

Point transparency : difference between pch 16 and 19

The pch=19 is a circle and secondary plain circle. The pch=16 is only a plain circle. This is what to use for transparency. plot(rep(1, 10) ,rep(1, 10), pch=19, cex=10, col=rgb(.1, .1, .1, 0.01), lwd=5) plot(rep(1, 10) ,rep(1, 10), pch=16, cex=10, col=rgb(.1, .1, .1, 0.01), lwd=5)