statistics - Having weights shown as an unused argument in logistf R function -
i kept getting problem following code; "weights=weight" shown unused argument. how should solve problem?
x_0 <- rbinom(1,100, 0.01) x_1 <- rbinom(1,100, 0.1) x <- c(0,0,1,1) y <- c(0,1,0,1) weight <- c(100-x_0, x_0, 100-x_1, x_1) result <- logistf(y ~ x, weights=weight)$coef[2]
also, there way perform whole process shown above 30, 60, or 100 times , generate time (or count), x_0, x_1, , result each time? suggestion great. thanks.
i managed run following code without problems (r v 3.0.0 logistf v 1.10):
arr <- t(sapply(1:30, function(i){ x_0 <- rbinom(1,100, 0.01) x_1 <- rbinom(1,100, 0.1) x <- c(0,0,1,1) y <- c(0,1,0,1) weight <- c(100-x_0, x_0, 100-x_1, x_1) list(count=i,x_0=x_0,x_1=x_1, res= logistf(y ~ x, weights=weight)$coef[2]) }))
Comments
Post a Comment