search for: estfrommodelmatrix

Displaying 1 result from an estimated 1 matches for "estfrommodelmatrix".

2007 Apr 05
1
Logistic/Cox regression: Parameter estimates directly from model matrix
...del matrix? Example for Cox regression: ## predictors n <- 50 q1 <- rnorm(n) q2 <- rgamma(n, 2, 2) Z <- cbind(q1, q2) ## response ttf <- rexp(n) tf <- round(runif(n)) ## compute estimates res <- coxph(Surv(ttf, tf) ~ q1 + q2) r <- res$coef My goal is to have a function estFromModelMatrix <- function(tf, ttf, Z){ /* do something meaningful using built-in functions */ return(r)} I have written such functions myself using LL - maximization from scratch, but these are slower than the built-in functions. Since I intend to do some simulations (where I specify the model...