Called by coxreg, but a user can call it directly.
coxreg.fit( X, Y, rs, weights, t.offset = NULL, strats, offset, init, max.survs, method = "efron", boot = FALSE, efrac = 0, calc.martres = TRUE, control, verbose = TRUE, calc.hazards = NULL, center = NULL )
| X | The design matrix. |
|---|---|
| Y | The survival object. |
| rs | The risk set composition. If absent, calculated. |
| weights | Case weights; time-fixed or time-varying. |
| t.offset | Case offset; time-varying. |
| strats | The stratum variable. Can be absent. |
| offset | Offset. Can be absent. |
| init | Start values. If absent, equal to zero. |
| max.survs | Sampling of risk sets? If so, gives the maximum number of survivors in each risk set. |
| method | Either "efron" (default) or "breslow". |
| boot | Number of bootstrap replicates. Defaults to FALSE, no bootstrapping. |
| efrac | Upper limit of fraction failures in 'mppl'. |
| calc.martres | Should martingale residuals be calculated? |
| control | See |
| verbose | Should Warnings about convergence be printed? |
| calc.hazards | Deprecated. See |
| center | Deprecated. See |
A list with components
Estimated regression parameters.
Covariance matrix of estimated coefficients.
First component is value at init, second at maximum.
Score test statistic, at initial value.
Linear predictors.
Martingale residuals.
Estimated baseline hazard. At value zero of 'design' variables.
Means of the columns of the design matrix.
The bootstrap replicates, if requested on input.
TRUE if convergence.
TRUE if variables converged.
TRUE if failure.
Number of performed iterations.
rs is dangerous to use when NA's are present.
It is the user's responsibility to check that indata is sane.
Göran Broström
X <- as.matrix(data.frame( x= c(0, 2,1,4,1,0,3), sex= c(1, 0,0,0,1,1,1))) time <- c(1,2,3,4,5,6,7) status <- c(1,1,1,0,1,1,0) stratum <- rep(1, length(time)) coxreg.fit(X, Surv(time, status), strats = stratum, max.survs = 6, control = list(eps=1.e-4, maxiter = 10, trace = FALSE))#> $coefficients #> [1] -0.7716698 -1.7543183 #> #> $df #> [1] 2 #> #> $n #> [1] 7 #> #> $sd #> [1] 0.5529464 1.3474828 #> #> $var #> [,1] [,2] #> [1,] 0.3057497 0.3037635 #> [2,] 0.3037635 1.8157100 #> #> $loglik #> [1] -7.138867 -5.273533 #> #> $score #> [1] 3.274765 #> #> $linear.predictors #> [,1] #> [1,] 0.4607732 #> [2,] 0.6717520 #> [3,] 1.4434217 #> [4,] -0.8715875 #> [5,] -0.3108965 #> [6,] 0.4607732 #> [7,] -1.8542360 #> #> $residuals #> [1] 0.8470621 0.5829125 -0.7145486 -0.1693379 0.4243571 -1.4838069 -0.2453139 #> #> $noOfRisksets #> [1] 5 #> #> $hazards #> [[1]] #> [,1] [,2] #> [1,] 1 0.8839056 #> [2,] 2 1.0681447 #> [3,] 3 1.7571622 #> [4,] 5 3.4881900 #> [5,] 6 7.1577751 #> #> attr(,"class") #> [1] "hazdata" #> #> $means #> x sex #> 1.5714286 0.5714286 #> #> $bootstrap #> NULL #> #> $boot.sd #> NULL #> #> $conver #> [1] 1 #> #> $f.conver #> [1] 1 #> #> $fail #> [1] 0 #> #> $iter #> [1] 5 #>