R/MLnp.R

"MLnp" <-
function(Xr,yr,iv,tp){np <- ncol(Xr)
# Maximum likelihood
beta <- tp$beta; tn <- tp$tn
# coefficients
# z  <- riclls(Xr,yr); th <- z$theta[1:np] 
  z  <- lsfit(Xr, yr, intercept=FALSE)
  th <- z$coef
# scale
  if (iv==1) {rr  <- as.vector(yr-Xr%*%as.matrix(th)); v <- Scalen(rr,tn-np,beta)}
list(th1=th,v1=v)}

Try the RobustAFT package in your browser

Any scripts or data that you put into this service are public.

RobustAFT documentation built on Aug. 21, 2023, 5:13 p.m.