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 |
---|---|---|---|
834 | 안녕하세요? mytable에서 나온 결과를 워드 저장하는 방법에 대해 문의드립니다. [2] | 박만영 | 2018.03.12 |
833 | web-R에서 사용되는 명령어를 볼 수 있는 방법이 있을까요? [1] | 통계장님 | 2018.03.15 |
832 | 웹에서 하는 ggplot2에서.. [3] | suein | 2018.03.15 |
831 | r studio server 가 오늘(3/15) 만료된다고 합니다 [2] | 스튜던트 | 2018.03.15 |
830 | 그냥 넋두리.. [2] | 스튜던트 | 2018.03.25 |
829 | Propensity score matching 에 대해 질문드립니다 교수님 [2] | 우루루루 | 2018.03.25 |
828 | cochrane armitage test 질문드립니다. [1] | 달려라하마 | 2018.04.02 |
827 | 질문 드립니다. [1] | 캐천사 | 2018.04.03 |
826 | 통계 공부에 대해서 질문드립니다! [1] | ykoy | 2018.04.18 |
825 | PW 찾기가 안되어 문의드립니다. [2] | 요주식 | 2018.04.18 |
824 | time ROC 에 대해 질문드립니다. | YH | 2018.04.19 |
823 | 출판편향 오류 [2] | 알로하 | 2018.04.19 |
822 | r studio server expired..여서 접속이 안됩니다 [2] | 스튜던트 | 2018.04.22 |
821 | data frame 문의드립니다. [1] | hichoi | 2018.04.25 |
820 | 문의드립니다 [2] | 알로하 | 2018.04.26 |
819 | 생존분석 p 값 [2] | alse | 2018.04.26 |
818 | cox 와 kaplan 분석 시 결과해석 문의드립니다. [2] | 또니 | 2018.04.30 |
817 | 생존분석 결과가 다운되지 않습니다. [2] | 아라리 | 2018.05.02 |
816 | 다중회귀 관련 질문이 있습니다~~ [2] | 짱이야 | 2018.05.03 |
815 | 다중회귀 관련 여러가지 질문들이 있습니다. [2] | 짱이야 | 2018.05.04 |