View source: R/effective_functions.r
shuffle | R Documentation |
Function shuffles together coefficients and standard errors with a significance flag.
shuffle(b, pv, se, alpha = 0.05, digits = 3, names = NULL)
b |
Vector of coefficients |
pv |
Vector of p-values corresponding to |
se |
Vector of standard errors corresponding to |
alpha |
Alpha level for the significance flag |
digits |
Number of digits to print |
names |
A character vector of coefficient names as long as |
A character vector of printed output
library(nnet) data(repress) mrm <- multinom(pts_s ~ pr + cwar + iwar + log(rgdpe) + log(pop), data=repress) b <- coef(mrm) v <- vcov(mrm) b <- c(t(b)) se <- sqrt(diag(v)) pv <- 2*pnorm(abs(b/se), lower.tail=FALSE) tab11_7 <- matrix(shuffle(b, pv, se), ncol=4) rownames(tab11_7) <- rep("", 12) rownames(tab11_7)[seq(1, 12, by=2)] <- colnames(coef(mrm)) colnames(tab11_7) <- paste0("PTS = ", 2:5) noquote(tab11_7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.