lhcontab: conti<-function(input=input,var=var,by=by,round.type="sigfig",digit=3,quanti)...

Description Usage Arguments Examples

View source: R/collectedfunctions.R

Description

input<-input[,c(var,by)] l<-stats::reshape(input, varying = var, v.names = "score", timevar = "var", times = var, direction = "long") l1<-l[!is.na(l$score),] l2<-l[is.na(l$score),] l1$qt<-quanti sum<-plyr::ddply(l1,c(by,"var"),summarise, n=length(score), #nmiss=nmiss(score), mean=mean(score,na.rm=T), cv=cv(score), sd=sd(score,na.rm=T), se=se(score), median=median(score,na.rm=T), min=min(score,na.rm=T,na.rm=T), max=max(score), lo_qt975=quantile(score,0.025,na.rm=T), hi_qt975=quantile(score,0.975,na.rm=T), lo_qt95=quantile(score,0.05,na.rm=T), hi_qt95=quantile(score,0.95,na.rm=T), lo_qtxx=quantile(score,1-unique(qt),na.rm=T), hi_qtxx=quantile(score,unique(qt),na.rm=T), lowCI=loci(score), HiCI=upci(score), GeoMean=Gmean(score), GeoCV=Gcv(score) )

Usage

1
2
lhcontab(dat, var, by, format = "by.var", sumry = 1,
  round.type = "sigfig", digit = 3, quant = 0.9)

Arguments

var

List of continuous covariates (ex:c("CRCL","WT"))

by

Stratification variable (ex: by="study")

sumry

Result summary format to be displayed. Type summary.set to see different options of summary sets.

round.type

rounding method, sigfig by default. (ex:"round" for rounding)

digit

Number of round digits or significant figures

data

datset or data frame (ex:data=PKdatat)

colby

Specify sorting variable to be displayed vertically. (ex: colby=by or colby="var")

rowby

Specidy sorting variable horizontally. If by > 1, set rowby=by.

Examples

1
con.tab(data=dat,var=c("WT","crcl","ALT"),by=c("study"),colby="var",rowby=by,sumry=set1)

leonpheng/lhtool documentation built on Dec. 16, 2019, 3:52 a.m.