data(ais, package="sn") ##Australian Institute of Sport data set
attach(ais)
##It is considered a bivariate regression model
##with Hg and SSF as response variables and
##Hc, Fe, Bfat and LBM as covariates
y<-cbind(Hg,SSF)
n<-nrow(y); m<-ncol(y)
X.aux=model.matrix(~Hc+Fe+Bfat+LBM)
p<-ncol(X.aux)
X<-array(0,dim=c(2*p,m,n))
for(i in 1:n) {
X[1:p,1,i]=X.aux[i,,drop=FALSE]
X[p+1:p,2,i]=X.aux[i,,drop=FALSE]
}
##See the covariate matrix X
##X
fit.MN=estimate.MN(y, X) ##Estimate the parameters for the MN regression model
summary(fit.MN)
fit.MT=estimate.MT(y, X) ##Estimate the parameters for the MT regression model
summary(fit.MT)
# \donttest{
##may take some time on some systems
fit.MSSL=estimate.MSSL(y, X) ##Estimate the parameters for the MSSL regression model
summary(fit.MSSL)
fit.MSTT=estimate.MSTT(y, X) ##Estimate the parameters for the MSTT regression model
summary(fit.MSTT)
fit.MSNC=estimate.MSNC(y, X) ##Estimate the parameters for the MSNC regression model
summary(fit.MSNC)
fit.MSCEC=estimate.MSCEC(y, X) ##Estimate the parameters for the MSCEC regression model
summary(fit.MSCEC)
# }
Run the code above in your browser using DataLab