Package quickreg. R topics documented:

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package vinereg. August 10, 2018

Package epitab. July 4, 2018

Package catenary. May 4, 2018

Package bisect. April 16, 2018

Package modmarg. R topics documented:

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package fastdummies. January 8, 2018

Package docxtools. July 6, 2018

Package vip. June 15, 2018

Package ECctmc. May 1, 2018

Package WordR. September 7, 2017

Package MIICD. May 27, 2017

Package mason. July 5, 2018

Package GFD. January 4, 2018

Package citools. October 20, 2018

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package geneslope. October 26, 2016

Package rereg. May 30, 2018

Package qualmap. R topics documented: September 12, Type Package

Package robotstxt. November 12, 2017

Package svalues. July 15, 2018

Package FWDselect. December 19, 2015

Package gppm. July 5, 2018

Package datasets.load

Package ezsummary. August 29, 2016

Package splithalf. March 17, 2018

Package CBCgrps. R topics documented: July 27, 2018

Package canvasxpress

Package embed. November 19, 2018

Package weco. May 4, 2018

Package facerec. May 14, 2018

Package tidystats. May 6, 2018

Package InformativeCensoring

Package validara. October 19, 2017

Package addhaz. September 26, 2018

Package widyr. August 14, 2017

Package fcr. March 13, 2018

Package gtrendsr. October 19, 2017

Package editdata. October 7, 2017

Package QCAtools. January 3, 2017

Package gtrendsr. August 4, 2018

Package balance. October 12, 2018

Package sure. September 19, 2017

Package reghelper. April 8, 2017

Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Package climber. R topics documented:

Package treedater. R topics documented: May 4, Type Package

Package RcmdrPlugin.survival

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package infer. July 11, Type Package Title Tidy Statistical Inference Version 0.3.0

Package tidylpa. March 28, 2018

Package MTLR. March 9, 2019

Package fitbitscraper

Package queuecomputer

Package CausalImpact

Package simsurv. May 18, 2018

Package bayesdp. July 10, 2018

Package dalmatian. January 29, 2018

Package RNAseqNet. May 16, 2017

Package interplot. R topics documented: June 30, 2018

Package pcr. November 20, 2017

Package glmnetutils. August 1, 2017

Package sizemat. October 19, 2018

Package ggseas. June 12, 2018

Package benchmarkme. R topics documented: February 26, Type Package Title Crowd Sourced System Benchmarks Version 0.2.

Package edfreader. R topics documented: May 21, 2017

Package bife. May 7, 2017

Package SEMrushR. November 3, 2018

Package tidytransit. March 4, 2019

Package ggmosaic. February 9, 2017

Package optimus. March 24, 2017

Package assertr. R topics documented: February 23, Type Package

Package nngeo. September 29, 2018

Package permuco. February 14, Type Package

Package ecotox. June 28, 2018

Package jtrans. August 29, 2016

Package sigqc. June 13, 2018

Package strat. November 23, 2016

Package OLScurve. August 29, 2016

Package MatchIt. April 18, 2017

Package barcoder. October 26, 2018

Package smcfcs. March 30, 2019

Package PDN. November 4, 2017

Package parmsurvfit. October 8, 2018

Package palmtree. January 16, 2018

Package BiDimRegression

Package PSTR. September 25, 2017

Package TVsMiss. April 5, 2018

Package rpst. June 6, 2017

Package distdichor. R topics documented: September 24, Type Package

Package rfsa. R topics documented: January 10, Type Package

Package zebu. R topics documented: October 24, 2017

Package effectr. January 17, 2018

Package abe. October 30, 2017

Package ClusterBootstrap

Package dyncorr. R topics documented: December 10, Title Dynamic Correlation Package Version Date

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package subscreen. June 22, 2018

Package auctestr. November 13, 2017

Transcription:

Package quickreg September 28, 2017 Title Build Regression Models Quickly and Display the Results Using 'ggplot2' Version 1.5.0 A set of functions to extract results from regression models and plot the effect size using 'ggplot2' seamlessly. While 'broom' is useful to convert statistical analysis objects into tidy data frames, 'coefplot' is adept at showing multivariate regression results. With specific outcome, this package could build regression models automatically, extract results into a data frame and provide a quicker way to summarize models' statistical findings using 'ggplot2'. Depends R (>= 3.0.0) Imports ggplot2 (>= 2.0.0), rlang (>= 0.1.2), survival, psych, utils, stats, nortest, dplyr Suggests ggthemes, knitr, rmarkdown, testthat License GPL-2 LazyData true RoxygenNote 6.0.1 VignetteBuilder knitr NeedsCompilation no Author Xikun Han [aut, cre] Maintainer Xikun Han <hanxikun2014@163.com> Repository CRAN Date/Publication 2017-09-28 06:41:12 UTC R topics documented: diabetes........................................... 2 display_table........................................ 2 plot.reg........................................... 4 reg.............................................. 5 reg_x............................................ 6 reg_y............................................ 7 Index 8 1

2 display_table diabetes A hypothetical dataset Format See Also A hypothetical dataset extracted from package PredictABEL diabetes A data frame with 1000 rows and 14 variables: sex: 1=male, 2=female age: age of the participants(years) smoking: 0=non smoker, 1=smoker education: 0=without bachelor degree, 1=bachelor degree or above diabetes: diabetes mellitus, 0= health, 1= diabetes BMI: body mass index (kg/cm2) systolic: systolic blood pressure(mmhg) diastolic: diastolic blood pressure(mmhg)... : other genetic information, see the ExampleData in PredictABEL-package. ExampleData display_table Display a table used in paper Display count, frequency or mean, standard deviation and test of normality, etc. display_table(data = NULL, variables = NULL, group = NULL, mean_or_median = "mean", addna = TRUE, table_margin = 2, discrete_limit = 10, exclude_discrete = TRUE, save_to_file = NULL, normtest = NULL, fill_variable = FALSE) display_table_group(data = NULL, variables = NULL, group = NULL, super_group = NULL, group_combine = FALSE, mean_or_median = "mean", addna = TRUE, table_margin = 2, discrete_limit = 10, exclude_discrete = TRUE, normtest = NULL, fill_variable = FALSE)

display_table 3 data variables group A data.frame Column indices or names of the variables in the dataset to display, the default columns are all the variables except group variable Column indices or names of the first subgroup variables. Must provide. mean_or_median A character to specify mean or median to used for continuous variables, either "mean" or "median". The default is "mean" addna table_margin Whether to include NA values in the table, see table for more details Index of generate margin for, see prop.table for more details discrete_limit Defining the minimal of unique value to display the variable as count and frequency, the default is 10 exclude_discrete Logical, whether to exclude discrete variables with more unique values specified by discrete_limit save_to_file normtest fill_variable super_group group_combine Functions Note A character, containing file name or path A character indicating test of normality, the default method is shapiro.test when sample size no more than 5000, otherwise lillie.test Kolmogorov- Smirnov is used, see package nortest for more methods.use shapiro.test, lillie.test, ad.test, etc to specify methods. A logical, whether to fill the variable column in result, the default is FALSE Column indices or names of the further subgroup variables. A logical, subgroup analysis for combination of variables or for each variable. The default is FALSE (subgroup analysis for each variable) display_table_group: Allow more subgroup analysis, see the package vignette for more details The return table is a data.frame. - P.value1 is ANOVA P value for continuous variables and chi-square test P value for discrete variables - P.value2 is Kruskal-Wallis test P value for continuous variables and fisher test P value for discrete variables if expected counts less than 5 - normality is normality test P value for each group Examples ## Not run: data(diabetes) head(diabetes) library(dplyr);library(rlang)

4 plot.reg result_1<-diabetes %>% group_by(sex) %>% do(display_table(data=.,variables=c("age","smoking"),group="cfhrs2230199")) %>% ungroup() result_2<-display_table_group(data=diabetes,variables=c("age","smoking"), group="cfhrs2230199",super_group = "sex") identical(result_1,result_2) result_3<-display_table_group(data=diabetes,variables=c("age","education"), group=c("smoking"),super_group = c("cfhrs2230199","sex")) result_4<-display_table_group(data=diabetes,variables=c("age","education"), group=c("smoking"),super_group = c("cfhrs2230199","sex"),group_combine=true) ## End(Not run) plot.reg plot the result of regression result plot coefficients, OR or HR of regression models. ## S3 method for class 'reg' plot(x, limits = c(na, NA), sort = "order", title = NULL, remove = TRUE,...) plot_reg(x, limits = c(na, NA), sort = "order", title = NULL, remove = TRUE, term = NULL, center = NULL, low = NULL, high = NULL, model = NULL,...) x limits sort title remove A reg, reg_y or reg_x object without covariates information, cov_show=false A numeric vector of length two providing limits of the scale. Use NA to refer to the existing minimum or maximum value. A character determining the order of variables to plot, alphabetical or order. The later is the default to sort variables according to their effect size. title of plot A logical, whether to remove infinite and NA value. The default is TRUE... additional arguments. When using your own regression results rather than from quickreg, please provide term, center, lower, high and model for plot. term center low high model A character of x axis variable in plot A character of coefficient, OR or HR variable in plot A character of lower confidence interval variable A character of upper confidence interval variable A character of model, "lm", "glm" or "coxph"

reg 5 See Also reg, reg_x, reg_y Examples reg_glm<-reg(data = diabetes, y = 5, factor = c(1, 3, 4), model = 'glm') plot(reg_glm) plot(reg_glm, limits = c(na, 3)) reg Build regression models Build general linear model, logistic regression model, cox regression model with one or more dependent variables. Allow regression based on subgroup variables. reg(data = NULL, x = NULL, y = NULL, group = NULL, cov = NULL, factors = NULL, model = NULL, time = NULL, cov_show = FALSE, confint_glm = "default", group_combine = FALSE) data x y group cov factors model time cov_show confint_glm group_combine A data.frame to build the regression model. Integer column indices or names of the variables to be included in univariate analysis. If NULL, the default columns are all the variables except y, group, time and cov. Integer column indice or name of dependent variables, integer or character, allow more than one dependent variables Integer column indice or name of subgroup variables. Integer column indices or name of covariate variables Integer column indices or names of variables to be treated as factor regression model, see lm, glm, coxph for more details Integer column indices or name of survival time, used in cox regression, see coxph for more details A logical, whether to create covariates result, default FALSE A character, default or profile. The default method for glm class to compute confidence intervals assumes asymptotic normality confint, you can also use profile likelihood method confint.glm, but it is pretty slow. In this case you could specify default for speed. A logical, subgroup analysis for combination of group variables or each group variables. The default is FALSE (subgroup analysis for each group variable)

6 reg_x Value The return result is a concentrated result in a data.frame. reg_x Build regression models only one dependent variable Build general linear model, generalized linear model, cox regression model with only one dependent variables. reg_x(data = NULL, x = NULL, y = NULL, cov = NULL, factors = NULL, model = NULL, time = NULL, cov_show = FALSE, detail_show = FALSE, confint_glm = "default", save_to_file = NULL) data x y cov factors model time cov_show detail_show confint_glm save_to_file A data.frame to build the regression model. Integer column indices or names of the variables to be included in univariate analysis. If NULL, the default columns are all the variables except y, time and cov. Integer column indice or name of dependent variable, only one integer or character Integer column indices or name of covariate variables Integer column indices or names of variables to be treated as factor regression model, see lm, glm, coxph for more details Integer column indices or name of survival time, used in cox regression, see coxph for more details A logical, whether to create covariates result, default FALSE A logical, whether to create each regression result, default FALSE. If TRUE, with many regressions, the return result could be very large. A character, default or profile. The default method for glm class to compute confidence intervals assumes asymptotic normality confint, you can also use profile likelihood method confint.glm, but it is pretty slow. In this case you could specify default for speed. A character, containing file name or path Value If detail_show is TRUE, the return result is a list including two components, the first part is a detailed analysis result, the second part is a concentrated result in a data.frame. Otherwise, only return concentrated result in a data.frame.

reg_y 7 Examples reg_glm<-reg_x(data = diabetes, x = c(1:4, 6), y = 5, factors = c(1, 3, 4), model = 'glm') ## other methods fit<-reg_x(data = diabetes, x = c(1, 3:6), y = "age", factors = c(1, 3, 4), model = 'lm') fit<-reg_x(data = diabetes, x = c( "sex","education","bmi"), y = "diabetes", time ="age", factors = c("sex","smoking","education"), model = 'coxph') reg_y Build regression models with more than one dependent variable Build general linear model, generalized linear model, cox regression model,etc. reg_y(data = NULL, x = NULL, y = NULL, cov = NULL, factors = NULL, model = NULL, time = NULL, confint_glm = "default", cov_show = FALSE) data x y cov factors model time confint_glm cov_show A data.frame Integer column indices or names of the variables to be included in univariate analysis, the default columns are all the variables except y and time and cov. Integer column indices or name of dependent variable Integer column indices or name of covariate variables Integer column indices or names of variables to be treated as factor regression model, see lm, glm, coxph for more details Integer column indices or name of survival time, used in cox regression, see coxph for more details A character, default or profile. The default method for glm class to compute confidence intervals assumes asymptotic normality confint, you can also use profile likelihood method confint.glm, but it is pretty slow. In this case you could specify default for speed. A logical, whether to create covariates result, default FALSE Value The return result is a concentrated result in a data.frame.

Index Topic datasets diabetes, 2 confint, 5 7 confint.glm, 5 7 coxph, 5 7 diabetes, 2 display_table, 2 display_table_group (display_table), 2 ExampleData, 2 glm, 5 7 lillie.test, 3 lm, 5 7 plot.reg, 4 plot_reg (plot.reg), 4 prop.table, 3 reg, 5, 5 reg_x, 5, 6 reg_y, 5, 7 shapiro.test, 3 table, 3 8