Survival Analysis R difference between Robust Variance and Greenwood's formula? Hello I am learning about survival analysis. I am curious about the robust option in the survfit function in the survival package. The documentation states that

If a robust is TRUE, or for multi-state curves, then the standard errors of the results will be based on an infinitesimal jackknife (IJ) estimate, otherwise the standard model based estimate will be used.

I am still early on in my statistics knowledge as a undergraduate and have never heard of the IJ estimate.
When I examine it in R it looks identical to greenwood's formula
library(survival)
library(dplyr)
library(broom)
size = 10
deathtime <- seq(1, size)
death = rep(1, size)
df <- data.frame(deathtime, death)

surv.obj<- Surv(df$deathtime, df$death)

surv.fit <- survfit(surv.obj ~ 1, robust = TRUE)

df.fit <- tidy(surv.fit)


df.fit %>% 
  mutate(var.hand = estimate^2 * cumsum(n.event/(n.risk * (n.risk - n.event))), # Green Wood
         var.robust = std.error^2) #Robust 



I know by default survfit will produce the cumulative hazard std.error when robust = FALSE
Here are my questions:

*

*What is different from the robust variance and greenwood? Is it just a calculation difference

*Is there a unintended loophole in the documentation that makes when robust = FALSE std.error are for cumulative hazard function and when robust = TRUE it produces the std.error of the survival function.


The robust argument or a cluster() term in this type of model provides one way to adjust estimates of (co)variances for problems in the modeling that can arise from not meeting model assumptions. Such problems include outliers and the lack of independence among observations that can come from correlations within groups (e.g., patients within hospitals) or multiple events in the same individual. Point estimates in a regression model are the same as otherwise, but the coefficient covariance matrix is adjusted to take such things into account.
The original jackknife is repeating calculations of a statistic as observations are removed one-at-a-time from the data sample and pooling the results. In each calculation you give one observation a weight of 0 and all the others have weights of 1. That provides a way to estimate the influence of individual cases/groups on the model results and to estimate bias and variance. The infinitesimal jackknife can be thought of as the limiting situation as weights approach 0.
Therneau and Grambsch discuss this in Section 7.2 with respect to survival models. They note that for ordinary linear regression:

The infinitesimal jackknife variance estimator and the famous sandwich estimator are usually one and the same,

where the "famous sandwich estimator" is what's used with generalized estimating equations. They show how "dfbeta" residuals calculated from score residuals in a survival model can be used to get an infinitesimal jackknife variance estimate.
In your example data without outliers or correlated outcomes (typically indicated by an "id" term in the model), the variance estimates are the same either way. They won't be, in general.*
As you're starting out to learn about this, be aware that there's an alternate approach to handling lack of independence among survival observations, often called a "frailty" model. That's analogous to mixed models, fitting "frailties" within individuals or shared among members of a group to a specified distribution as part of the modeling.

*I'm not sure why the std.err is nevertheless reported for individual survival times rather than for cumulative hazard when robust = TRUE. That might have to do with things that arise when there actually are clusters, unlike in your data, but I haven't thought that through.
