Skip to content

Error in COV() function #23

@wellred

Description

@wellred

When using the comp() function, I noticed a discrepancy in the variance between what I calculated (also verified with SAS) and what the comp() output displayed. Using the equation on variance here, I noticed that in the COV() source code, the variance was calculated not with the overall observed events, but with the observed events for only one treatment group. This would only be a problem if an event were observed in multiple groups at the same time - which is how I found it.

It's found in this line: res2 <- x[, (ncg / n) * (1 - (ncg / n)) * ((n - e) / (n - 1)) * e, by=list(t, cg)] where e is the number of events for that time and in that group.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions