Package problem for quantile regression for mixed effect

Using following code to run a quantile regress for mixed effect, unable to make the function QRLMM.
First, I installed package "qrLMM", but when trying to load the package, the error message reminds there is no package called ‘tlrmvnmvt’, here is the entire message when run library(qrLMM):

library(qrLMM)
Error: package or namespace load failed for ‘qrLMM’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘tlrmvnmvt’
In addition: Warning message:
package ‘qrLMM’ was built under R version 4.1.3

When tried to install tlrmvnmvt, it says it is not available, the error message listed below, can anyone help fix the problem?

install.packages("tlrmvnmvt")
Installing package into ‘C:/Users/jxzou/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘tlrmvnmvt’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at

#Using the Orthodontic distance growth data

data(Orthodont)
attach(Orthodont)

y  = distance #response
x  = cbind(1,c(rep(0,64),rep(1,44)),age) #design matrix for fixed effects
z  = cbind(1,age) #design matrix for random effects
groups = Subject

model = QRLMM(y,x,z,groups,MaxIter=200)

beta = model$res$beta  #fixed effects
weights = model$res$weight  #random weights
nj = c(as.data.frame(table(groups))[,2]) #obs per subject
fixed = tcrossprod(x,t(beta))
random = rep(0,dim(x)[1])  #initializing random shift

for (j in 1:length(nj)){ 
  z1=matrix(z[(sum(nj[1:j-1])+1):(sum(nj[1:j])),],ncol=dim(z)[2])
  random[(sum(nj[1:j-1])+1):(sum(nj[1:j]))] = tcrossprod(z1,t(weights[j,]))
}

pred = fixed + random  #predictions
group.plot(age,pred,groups,type = "l")
group.points(age,distance,groups)

Above code was copied from example here:
https://rdrr.io/cran/qrLMM/man/QRLMM.html
Thank you!

Works on macOS under R4.2

The package has

Depends: R (≥ 4.2.0)

So, check your R version.

install.packages("tlrmvnmvt")

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.2/tlrmvnmvt_1.1.2.tgz'
Content type 'application/x-gzip' length 2215773 bytes (2.1 MB)
==================================================
downloaded 2.1 MB


The downloaded binary packages are in
	/var/folders/0j/3g7q2zss7fb55q5wqg9t141r0000gn/T//RtmpeFM1zM/downloaded_packages
> 
1 Like

Thank you!
I upgraded R to 4.2.2 and successfully installed tlrmvnmvt.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.