data(schooldata)
school.x <- data.matrix(schooldata[,1:5])
school.y <- data.matrix(schooldata[,6:8])
#computes MM-estimate and 95% confidence intervals
#based on 999 bootstrap samples:
MMres <- FRBmultiregMM(school.x, school.y, R=999, conf = 0.95)
#or, equivalently using the formula interface
# \donttest{
MMres <- FRBmultiregMM(cbind(reading,mathematics,selfesteem)~., data=schooldata,
R=999, conf = 0.95)
# }
#the print method displays the coefficient estimates
MMres
#the summary function additionally displays the bootstrap standard errors and p-values
#("BCA" method by default)
summary(MMres)
summary(MMres, confmethod="basic")
#ask explicitely for the coefficient matrix:
MMres$coefficients
# or equivalently,
coef(MMres)
#For the error covariance matrix:
MMres$Sigma
#plot some bootstrap histograms for the coefficient estimates
#(with "BCA" intervals by default)
plot(MMres, expl=c("education", "occupation"), resp=c("selfesteem","reading"))
#plot bootstrap histograms for all coefficient estimates
plot(MMres)
#probably the plot-function has made a selection of coefficients to plot here,
#since 'all' was too many to fit on one page, see help(plot.FRBmultireg);
#this is platform-dependent
Run the code above in your browser using DataLab