shuffle: Shuffle coefficients and standard errors together

View source: R/effective_functions.r

shuffleR Documentation

Shuffle coefficients and standard errors together

Description

Function shuffles together coefficients and standard errors with a significance flag.

Usage

shuffle(b, pv, se, alpha = 0.05, digits = 3, names = NULL)

Arguments

b

Vector of coefficients

pv

Vector of p-values corresponding to b

se

Vector of standard errors corresponding to b

alpha

Alpha level for the significance flag

digits

Number of digits to print

names

A character vector of coefficient names as long as b

Value

A character vector of printed output

Examples


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)

psre documentation built on Aug. 8, 2022, 5:05 p.m.

Related to shuffle in psre...