Rstudio을 사용하여 matching을 진행하려고 했습니다..
## Propensity score estimation (pscore object returned)
dat.nonrandom <- pscore(formula = Alc ~ Age + Sex_F0M1 + R_BMI
data = dat,
family = "binomial",
name.pscore = "ps")
## Actual Propensity score matching
res.ps.match <- ps.match(object = dat.nonrandom,
control.matched.by = matched.by,
who.treated = 1, # value 1 is treated
name.match.index = "match.index",
ratio = 1,
caliper = "logit",
x = 0.2,
givenTmatchingC = TRUE,
bestmatch.first = TRUE,
setseed = FALSE,
combine.output = TRUE)
res.ps.match
res.ps.match를 시행하여보면
Matching data: Number of treated obs.: 260 Number of matched treated obs.: 260 Number of untreated obs.: 1061 Number of matched untreated obs.: 260 Number of total matched obs.: 520 Number of not matched obs.: 801 Number of matching sets: 260 Number of incomplete matching sets: 0
이러한 결과가 나오는데
## Extract matched data
defMatched <-dat[unlist(res.ps.match[c("match.index","control.index")]), ]
## Construct a table
tabMatched <- CreateTableOne(vars = vars, factorVars = catvars, strata = "Alc", data = defMatched, test = TRUE)
## Show table with SMD
print(tabMatched, smd = TRUE, test=TRUE)
하면
0 1 p test SMD n 434 86
로 treated 군이 86명으로 나옵니다ㅠ
저는 어디서 잘못된건지 모르겠습니다.ㅠ
위에 결과보면 260씩 매칭이된거 같은데- matched set을 만들때 잘못된건지 모르겠습니다....
저의 작은 지식으로는 이해가 안됩니다.ㅠ
조언부탁드립니다ㅜㅜ 감사합니다.
Comment 0
No. | Subject | Author | Date |
---|---|---|---|
1034 | 표만들기가 진행되지 않아요 [1] | jm1226 | 2016.10.29 |
1033 | 비선형회귀분석 질문드립니다. [2] | 박희정 | 2016.11.08 |
1032 | 통계 결과 값이 SPSS와 다릅니다. [5] | you | 2016.11.09 |
1031 | KM curve에서 legend 에 관한 질문입니다. [1] | 김정환 | 2016.11.13 |
1030 | 로지스틱 회귀분석 질문드립니다. [2] | 정태석 | 2016.11.13 |
1029 | 엑셀로 어떻게 해야하나요? [1] | 권혜미 | 2016.11.17 |
1028 | 교수님 질문이 있습니다 [2] | 카우보이 | 2016.11.19 |
1027 | forest plot 가 다 보이지 않네요~ [8] | 헤세드 | 2016.11.25 |
1026 | 생존 분석 중 발생한 에러에 대하여 [1] | 세자녀아빠 | 2016.12.01 |
» | matching을 하려고 합니다. | 권혜미 | 2016.12.02 |
1024 | 교수님 문의드립니다 [1] | pnuhendo | 2016.12.07 |
1023 | 교수님 문의드립니다 [1] | pnuhendo | 2016.12.08 |
1022 | 부끄럽지만 또 여쭙습니다 [2] | pnuhendo | 2016.12.09 |
1021 | 보고서/플롯 옵션 관련 문의입니다. [1] | wlsrn | 2016.12.12 |
1020 | termplot 과 boxplot 질문 드립니다. [1] | mint | 2016.12.13 |
1019 | cph plot | mint | 2016.12.14 |
1018 | 파일 업로드 방법 문의 [2] | Rooney | 2016.12.14 |
1017 | ggEffect 질문 [1] | 109294858 | 2016.12.19 |
1016 | numeric integration | cardiomoon | 2016.12.20 |
1015 | 효과크기 관련하여 질문드립니다. [2] | happinessdh | 2016.12.22 |