Learn R Programming

autoReg (version 0.3.3)

gaze: Produce table for descriptive statistics

Description

Produce table for descriptive statistics by groups for several variables easily. Depending on the nature of these variables, different descriptive statistical methods were used(t-test, ANOVA, Kruskal-Wallis, chi-squared, Fisher's,...)

Usage

gaze(x, ...)

# S3 method for formula gaze(x, ...)

# S3 method for data.frame gaze(x, ...)

# S3 method for coxph gaze(x, ...)

# S3 method for survreg gaze(x, ...)

# S3 method for glm gaze(x, ...)

# S3 method for lm gaze(x, ...)

# S3 method for tidycrr gaze(x, ...)

Value

An object of class "gaze" which inherits from the class "data.frame" with at least the following attributes:

attr(*,"yvars)

character. name of dependent variable

Arguments

x

An R object, formula or data.frame

...

arguments to be passed to gaze.data.frame or gaze.formula

Methods (by class)

  • gaze(formula): S3 method for formula

  • gaze(data.frame): default S3 method

  • gaze(coxph): default S3 method

  • gaze(survreg): default S3 method

  • gaze(glm): default S3 method

  • gaze(lm): default S3 method

  • gaze(tidycrr): default S3 method

Examples

Run this code
library(moonBook)
library(dplyr)
gaze(acs)
gaze(~age+sex,data=acs)
gaze(sex~.,data=acs,digits=1,method=1,show.p=TRUE) %>% myft()
# \donttest{
gaze(sex~age+Dx,data=acs)
gaze(EF~.,data=acs) %>% myft()
gaze(sex+Dx~.,data=acs,show.p=TRUE) %>% myft()
gaze(sex+Dx~.,data=acs)
gaze(Dx+sex~cardiogenicShock,data=acs,show.p=TRUE) %>% myft()
gaze(Dx+sex+HBP~cardiogenicShock,data=acs,show.p=TRUE)
gaze(~mpg+cyl,data=mtcars)
gaze(~.,data=mtcars)
gaze(cyl~.,data=mtcars,show.p=TRUE)
gaze(hp~.,data=mtcars)
gaze(cyl+am~.,data=mtcars)
# }
library(survival)
x=coxph(Surv(time,status) ~rx,data=anderson1)
gaze(x)
x=coxph(Surv(time,status) ~rx*logWBC,data=anderson1)
gaze(x)
library(survival)
x=survreg(Surv(time, status) ~ rx, data=anderson,dist="exponential")
gaze(x)
x=survreg(Surv(time, status) ~ ph.ecog + age + sex, lung)
gaze(x)
data(cancer,package="survival")
fit=glm(status~rx+sex+age+obstruct+nodes,data=colon,family="binomial")
gaze(fit)
fit=lm(mpg~wt*hp+am+I(wt^2),data=mtcars)
gaze(fit)
data(melanoma,package="boot")
melanoma$status_crr=ifelse(melanoma$status==1,1,ifelse(melanoma$status==2,0,2))
fit=crrFormula(time+status_crr~age+sex+thickness+ulcer,data=melanoma)
gaze(fit)

Run the code above in your browser using DataLab