The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Title: Providing Demographic Table with the P-Value, Standardized Mean Difference Value
Version: 0.1.0
Description: The Demographic Table in R combines contingency table for categorical variables, mean and standard deviation for continuous variables. t-test, chi-square test and Fisher's exact test calculated the p-value of two groups. The standardized mean difference were performed with 95 % confident interval, and writing table into document file.
License: GPL-3
Encoding: UTF-8
LazyData: true
Imports: officer, magrittr, MASS, stats
RoxygenNote: 6.1.1
Suggests: testthat
NeedsCompilation: no
Packaged: 2019-01-05 00:14:28 UTC; loanrobinson
Author: Loan Robinson [aut, cre]
Maintainer: Loan Robinson <loankimrobinson@gmail.com>
Repository: CRAN
Date/Publication: 2019-01-09 17:30:07 UTC

smd value for categorical variables

Description

smd value for categorical variables

Usage

cat_smd(ntable, var, data)

Arguments

ntable

propotion table of baseline categorical variable and group variable

var

baseline categorical variable

data

data

Examples

set.seed(2018)
group <-round(abs(rnorm(500)*10),0) %% 2
cont_1 <-round(abs(rnorm(500)*10),0)
cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3
data_check <-data.frame(group, cont_1, cat_multi_1)
data_check$group <- factor(data_check$group, levels = c(0,1), labels = c("Control","Treatment"))
data_check$cat_multi_1 <- factor(data_check$cat_multi_1)
cat_smd(table(data_check$cat_multi_1, data_check$group),"cat_multi_1",data_check )

DemoGraphic table for categorical variables

Description

DemoGraphic table for categorical variables

Usage

cat_table(var, strata, data)

Arguments

var

baseline variables

strata

group variable with 1 = treatment and 0 = control

data

data

Examples

set.seed(2018)
group <-round(abs(rnorm(500)*10),0) %% 2
cont_1 <-round(abs(rnorm(500)*10),0)
cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3
data_check <-data.frame(group, cont_1, cat_multi_1)
data_check$group <- factor(data_check$group, levels = c(0,1), labels = c("Control","Treatment"))
data_check$cat_multi_1 <- factor(data_check$cat_multi_1)
cat_table("cat_multi_1","group",data_check )

smd value for continuous variable.

Description

smd value for continuous variable.

Usage

cont_smd(mean1, mean2, var1, var2)

Arguments

mean1

mean of a baseline variable in the treatment group.

mean2

mean of a baseline variable in the control group.

var1

variance a baseline variable in the treatment group.

var2

variance of a baseline variable in the control group.

Value

smd value

Examples

cont_smd(10,11,2,3)

DemoGraphic table for continuous variables

Description

DemoGraphic table for continuous variables

Usage

cont_table(var, strata, data)

Arguments

var

variables

strata

group variable with 1 = treatment and 0 = control

data

data

Value

mean, standard deviation of treatmant and control group, smd, and p value.

Examples

set.seed(2018)
group <-round(abs(rnorm(500)*10),0) %% 2
cont_1 <-round(abs(rnorm(500)*10),0)
cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3
data_check <-data.frame(group, cont_1, cat_multi_1)
data_check$group <- factor(data_check$group, levels = c(0,1), labels = c("Control","Treatment"))
data_check$cat_multi_1 <- factor(data_check$cat_multi_1)
cont_table("cont_1","group", data_check )

Demographic Table for continuous and categorical variables

Description

Demographic Table for continuous and categorical variables

Usage

demo_table(var, strata, data)

Arguments

var

list of baseline variables

strata

group variable with 1 = treatment and 0 = control

data

data

Examples

set.seed(2018)
group <-round(abs(rnorm(500)*10),0) %% 2
cont_1 <-round(abs(rnorm(500)*10),0)
cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3
data_check <-data.frame(group, cont_1, cat_multi_1)
data_check$group <- factor(data_check$group, levels = c(0,1), labels = c("Control","Treatment"))
data_check$cat_multi_1 <- factor(data_check$cat_multi_1)
demo_table(c("cont_1","cat_multi_1"),"group", data_check )

Mean, var function

Description

Mean, var function

Usage

get_mean(x)

Arguments

x

variable

Value

mean table

Examples

get_mean(round(abs(rnorm(500)*10),0))

chi square test to get expected value and p value

Description

chi square test to get expected value and p value

Usage

my.chi.sq(...)

Arguments

...

variables

Examples

set.seed(2018)
group <-round(abs(rnorm(500)*10),0) %% 2
cont_1 <-round(abs(rnorm(500)*10),0)
cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3
data_check <-data.frame(group, cont_1, cat_multi_1)
data_check$group <- factor(data_check$group, levels = c(0,1), labels = c("Control","Treatment"))
data_check$cat_multi_1 <- factor(data_check$cat_multi_1)
my.chi.sq(table(data_check$cat_multi_1, data_check$group))

fisher exact test to get p value if any cell in propotion table of expect value less than 5

Description

fisher exact test to get p value if any cell in propotion table of expect value less than 5

Usage

my.fisher(...)

Arguments

...

variables

Examples

set.seed(2018)
data_check <-data.frame(
  group <-round(abs(rnorm(500)*10),0) %% 2,
  cat_multi_1 <-round(abs(rnorm(500)*10),0) %% 3)
my.fisher(table(data_check$cat_multi_1, data_check$group))

write smd table or demographic table into docx file

Description

write smd table or demographic table into docx file

Usage

mydocx(smd_table, name)

Arguments

smd_table

smd table or demo graphic table.

name

file name to save

Examples

mydocx(data.frame(smd.value <- 3.4, smd.lo <- 1.1, smd.up <- 5.6),"smd_table")

Confident interval for smd

Description

Confident interval for smd

Usage

smd_ci(n1, n2, smd)

Arguments

n1

length of a baseline variable in the treatment group.

n2

length of a baseline variable in the control group.

smd

smd value

Value

vector of 95

Examples

smd_ci(10,12,0.3)

t.test to calculate p value

Description

t.test to calculate p value

Usage

## S3 method for class 'test.p.value'
t(...)

Arguments

...

variables

Value

p value

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.