419595891 发表于 2018-3-16 12:27

请教大神这个S-plus script是否正确?可以改动转换到R运行吗?

本帖最后由 419595891 于 2018-3-16 13:51 编辑

这是一篇文献里给出的script,但我放到S-plus里跑不出来,有错误,有可能是我不会用S-plus,所以请教大神下面的script是否有错,没有错的话怎么解决错误?能不能改动换到R里运行?

library(Design)                                                        
reri <- function(datsam)                                                        
{                                                        
fitlr <- glm(outcome ~ determinant A * determinant B, family=binomial, data=datsam)                                                        
reri <- exp(fitlr$coef+fitlr$coef+fitlr$coef) - exp(fitlr$coef) - exp(fitlr$coef) + 1                                                        
}                                                        
summary.bootstrap(bootstrap(dataset, reri(dataset), B=10000), probs=c(0.025,0.5, 0.975))                                             

————————————我是分割线——————————————————————————————      



library(Design)
> reri <- function(datsam)
+ {fitlr <- glm(DM.0813 ~ smoking * rs163184, famliy=binomial, data=datsam)
+ reri <- exp(fitlr$coef+fitlr$coef+fitlr$coef) - exp(fitlr$coef) -exp(fitlr$coef) + 1}
    Last expression in function is an assignment
                (You probably wanted to return the left-hand side)
         in: reri <- exp(fitlr$coef + fitlr$coef + fitlr$coef) - exp(fitlr$coef) - exp(fitlr$coef) + 1
> summary.bootstrap(bootstrap(smoking, reri(smoking), B=10000), probs=c(0.025,0.5, 0.975))                                               
Warning messages:
  Numerical expression has 7028 elements: only the first used in: model.frame(formula, data, na.action, dots)
Problem: Object "DM.0813" not found
Use traceback() to see the call stack


不明白这个错误什么意思,小白求指导……


发表于 1970-1-1 08:00

发表于 1970-1-1 08:00

页: [1]
查看完整版本: 请教大神这个S-plus script是否正确?可以改动转换到R运行吗?