BI_pair.PSM: pair.PSM

Description Usage Arguments Author(s) Examples

Description

通过倾向性评分对样本进行1:1的matched。 支持"nonrandom","MatchIt"两种策略。

Usage

1
2
3
4
5
6
7
  pair.random(data,
              contrast,
              cluster,
              seed = 2018,
              ratio=0.2,
              pair = TRUE,
              summary = T)

Arguments

contrast

string.colnames.

seed

seed used in sample()

pair

logic.If T,give a random-matched pair data by giving a contrast

summary

logic.If T,give a simple data.

Author(s)

Weibin Huang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(data.selfprocess2.3)
contrast="N.status"
treat = "Np"
cluster = c("age","gender","pT")

# strategy = "nonrandom"
strategy = c("nonrandom","MatchIt")[1]
pr1 <- pair.PSM(data,
                contrast,treat,cluster,
                strategy,
                seed = 2018,
                ratio = 1,
                summary = F)

## strategy = "MatchIt"
strategy = c("nonrandom","MatchIt")[2]
method = c("nearest","exact", "full", "genetic" , "optimal","subclass")[1]
pr2 <- pair.PSM(data,
                contrast,treat,cluster,
                strategy,method,#strategy = "nonrandom"时可忽略
                seed = 2018,
                ratio=1,
                summary = F)

shijianasdf/BasicBioinformaticsAnalysisFromZhongShan documentation built on Jan. 3, 2020, 10:08 p.m.