packs <- c("devtools", "knitr", "MASS", "geepack", "htmlTable") lapply(packs, function(x) require(x, character.only = T)) install_github("lisaerein/nicereg") library(nicereg) help(nicereg) options(knitr.kable.NA = '.')
head(survey <- survey)
tab <- niceglm(df = survey, out = "Height", covs = c("Sex", "Age", "Clap"), regtype = "uni", title = "Univariate results", estname = "Estimate", family = "gaussian")
tab <- niceglm(df = survey, out = "Height", covs = c("Sex", "Age", "Clap"), regtype = "multi", title = "Multivariable results", estname = "Estimate", family = "gaussian")
survey$lefthanded <- 0 survey$lefthanded[survey$W.Hnd == "Left"] <- 1 fit <- glm(lefthanded ~ Age + Sex + Height + Exer, data = survey, family = "binomial") tab <- niceglm(fit, estname = "aOR", overallp = T)
survey$clusterid <- rep(1:5, length = nrow(survey)) tab <- nicegee(df = survey, out = "Height", covs = c("Sex", "Age", "Clap"), regtype = "uni", title = "Uni GEE results", estname = "Estimate", family = "gaussian", id = "clusterid", corstr = "exch")
survey$clusterid <- rep(1:5, length = nrow(survey)) tab <- nicegee(df = survey, out = "Height", covs = c("Sex", "Age", "Clap"), regtype = "multi", title = "Multi GEE results", estname = "Estimate", family = "gaussian", id = "clusterid", corstr = "exch")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.