Movatterモバイル変換


[0]ホーム

URL:


dmtools

CRAN statusBuild Statuscodecov

Installation

install.packages("dmtools")# dev-versiondevtools::install_github("KonstantinRyabov/dmtools")library(dmtools)

Overview

For checking the dataset from EDC in clinical trials. Notice, yourdataset should have a postfix( _V1 ) or a prefix( V1_ ) in the names ofvariables. Column names should be unique.

Usage

For example, you want to check laboratory values, you need to createthe excel table like in the example.

*column names without prefix or postfix

lab reference ranges
AGELOWAGEHIGHSEXLBTESTLBORRESLBNRINDLBORNRLOLBORNRHI
1845f|mGlucoseGLUCGLUC_IND3.95.9
1845mAspartate transaminaseASTAST_IND042
1845fAspartate transaminaseASTAST_IND039
dataset
IDAGESEXGLUC_V1GLUC_IND_V1AST_V2AST_IND_V2
0119f5.5norm30norm
0220m4.1NA48norm
0322m9.7norm31norm
# "norm" and "no" it is an example, necessary variable for the estimate, get from the datasetrefs <- system.file("labs_refer.xlsx", package = "dmtools")obj_lab <- lab(refs, ID, AGE, SEX, "norm", "no")obj_lab <- obj_lab %>% check(df)# ok - analysis, which has a correct estimate of the resultobj_lab %>% choose_test("ok")#>   ID AGE SEX                 LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES#> 1 01  19   f                Glucose     GLUC   _V1      3.9      5.9     5.5#> 2 01  19   f Aspartate transaminase      AST   _V2      0.0     39.0      30#> 3 03  22   m Aspartate transaminase      AST   _V2      0.0     42.0      31#>   LBNRIND RES_TYPE_NUM IND_EXPECTED#> 1    norm          5.5         norm#> 2    norm         30.0         norm#> 3    norm         31.0         norm# mis - analysis, which has an incorrect estimate of the resultobj_lab %>% choose_test("mis")#>   ID AGE SEX                 LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES#> 1 02  20   m Aspartate transaminase      AST   _V2      0.0     42.0      48#> 2 03  22   m                Glucose     GLUC   _V1      3.9      5.9     9.7#>   LBNRIND RES_TYPE_NUM IND_EXPECTED#> 1    norm         48.0           no#> 2    norm          9.7           no# skip - analysis, which has an empty value of the estimateobj_lab %>% choose_test("skip")#>   ID AGE SEX  LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES LBNRIND#> 1 02  20   m Glucose     GLUC   _V1      3.9      5.9     4.1    <NA>#>   RES_TYPE_NUM IND_EXPECTED#> 1          4.1         norm
strange_dataset
IDAGESEXV1_GLUCV1_GLUC_INDV2_ASTV2_AST_IND
0119f5,5norm< 5norm
0220m4,1NA48norm
0322m9,7norm31norm
# dmtools can work with the dataset as strange_df# parameter is_post has value FALSE because a dataset has a prefix( V1_ ) in the names of variablesobj_lab <- lab(refs, ID, AGE, SEX, "norm", "no", is_post = F)obj_lab <- obj_lab %>% check(strange_df)# dmtools can understand the value with a comma like 6,6 obj_lab %>% choose_test("ok")#>   ID AGE SEX                 LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES#> 1 01  19   f                Glucose     GLUC   V1_      3.9      5.9     5,5#> 2 03  22   m Aspartate transaminase      AST   V2_      0.0     42.0      31#>   LBNRIND RES_TYPE_NUM IND_EXPECTED#> 1    norm          5.5         norm#> 2    norm         31.0         norm# Notice, if dmtools can't understand the value of lab_vals e.g. < 5, it puts Inf in the RES_TYPE_NUMobj_lab %>% choose_test("mis")#>   ID AGE SEX                 LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES#> 1 01  19   f Aspartate transaminase      AST   V2_      0.0     39.0     < 5#> 2 02  20   m Aspartate transaminase      AST   V2_      0.0     42.0      48#> 3 03  22   m                Glucose     GLUC   V1_      3.9      5.9     9,7#>   LBNRIND RES_TYPE_NUM IND_EXPECTED#> 1    norm          Inf           no#> 2    norm         48.0           no#> 3    norm          9.7           noobj_lab %>% choose_test("skip")#>   ID AGE SEX  LBTEST LBTESTCD VISIT LBORNRLO LBORNRHI LBORRES LBNRIND#> 1 02  20   m Glucose     GLUC   V1_      3.9      5.9     4,1    <NA>#>   RES_TYPE_NUM IND_EXPECTED#> 1          4.1         norm

[8]ページ先頭

©2009-2025 Movatter.jp