## STU1
data(stu1)
stu1.ps <- pscore(data = stu1,
formula = therapie~tgr+age)
stu1.match <- ps.match(object = stu1.ps,
ratio = 2,
caliper = 0.5,
givenTmatchingC = FALSE,
matched.by = "pscore",
setseed = 38902)
stu1.est <-
ps.estimate(object = stu1.match,
resp = "pst",
adj = "tmass",
regr = pst~therapie+tgr+age)
## PRIDE
data(pride)
pride.ps <- pscore(data = pride,
formula = PCR_RSV~SEX+RSVINF+REGION+
AGE+ELTATOP+EINZ+EXT,
name.pscore = "ps")
pride.strata <- ps.makestrata(object = pride.ps,
breaks = quantile(pride.ps$pscore,
seq(0,1,0.2)),
stratified.ps = "ps")
pride.est <-
ps.estimate(object = pride.strata,
resp = "SEVERE",
family = "binomial",
adj = "AGE",
regr = SEVERE ~PCR_RSV+SEX+ETHNO+FRUEHG+HERZ+
ELTATOP+REGION+AGE+TOBACCO+VOLLSTIL+EXT+
EINZ+KRANKSUM,
weights = "rr")
Run the code above in your browser using DataLab