NULL

作者: 六胜一平 | 来源:发表于2020-10-15 13:26 被阅读0次
    data=read.csv('F:/SRC/GPSM.csv',stringsAsFactors = F)
    data=data[,-1]
    data$treat=as.factor(data$group)
    mnps.AOD <- mnps(treat ~ Gender + Age + Location + stage + size+Pre_chemo+resection,
                     data = data, 
                     estimand = "ATE", 
                     verbose = FALSE, 
                     stop.method = c("es.mean", "ks.mean"), 
                     n.trees = 3000)
    
    
    library(survey)
    data$w <- get.weights(mnps.AOD, stop.method = "es.mean")
    design.mnps <- svydesign(ids=~1, weights=~w, data=data)
    
    st=strata(data, stratanames=c('treat'), size=c(300,300,300), method=c("srswor","srswr","poisson",
                                                  "systematic")[4], pik=1/data$w,description=T)
    
    sda=data[st$ID_unit,]
    write.csv(sda,'f:/SRC/SDA.CSV')
    
    

    相关文章

      网友评论

          本文标题:NULL

          本文链接:https://www.haomeiwen.com/subject/tvgnpktx.html