1 | print.trq(object, digits = 4)
|
object |
|
digits |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (object, digits = 4)
{
n <- length(object$resid)
p <- length(object$coef)
options(warn = -1)
if (object$int) {
df.num <- p - 1
fstat <- c(t(object$coef[-1]) %*% solve(object$cov[-1,
-1]) %*% (object$coef[-1]))/df.num
}
else {
df.num <- p
fstat <- t(object$coef) %*% solve(object$cov) %*% (object$coef)/df.num
}
pvalue <- 1 - pf(fstat, df.num, (n - p))
regstat <- c(sqrt(object$v), n, fstat, df.num, (n - p), pvalue)
names(regstat) <- c("rse", "n", "F.stat", "df.num", "df.den",
"p.value")
err <- sqrt(diag(object$cov))
tstat <- c(object$coef/err)
tabcoef <- cbind(object$coef, err, tstat, 2 * (1 - pt(abs(tstat),
n - p)))
dimnames(tabcoef) <- list(names(object$coef), c("coef", "std.err",
"t.stat", "p.value"))
options(warn = 0)
print(round(tabcoef, digits))
cat(paste("Winsorized Standard Error of Regression= ", format(round(sqrt(object$v),
digits)), "\n", "N = ", format(n), ", F-statistic = ",
format(round(fstat, digits)), " on ", format(df.num),
" and ", format((n - p)), " df, ", "p-value = ", format(round(pvalue,
digits)), "\n\n", sep = ""))
invisible(list(summary = regstat, coef.table = tabcoef))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.